/* ============================================================
   CastArab Design System
   Single source of truth — link this in every page
   <link rel="stylesheet" href="design-system.css">
   ============================================================ */

/* ------------------------------------------------------------
   FONTS
   ------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ------------------------------------------------------------
   TOKENS
   ------------------------------------------------------------ */
:root {
  /* — Background scale — */
  --bg:         #0A0806;   /* deepest — page background */
  --bg-1:       #0F0D0B;   /* cards, panels on bg */
  --bg-2:       #161310;   /* elevated cards, modals */
  --bg-3:       #1E1A16;   /* hover states, active items */
  --bg-4:       #27221C;   /* borders that need fill */

  /* — Light surface scale (settings, forms, legal) — */
  --parchment:  #FAF7F2;
  --cream:      #F5F0E8;
  --warm-white: #FFFDF9;
  --sand:       #E8DCC8;

  /* — Text scale — */
  --text:       #F5F3EF;   /* primary text on dark */
  --text-2:     #C8BFB3;   /* secondary / muted on dark */
  --text-3:     #857870;   /* placeholder / faint on dark */
  --text-4:     #5A4E40;   /* disabled / hint / barely-visible on dark */
  --ink:        #1C1812;   /* primary text on light */
  --ink-soft:   #3D3529;
  --ink-muted:  #6B5E4E;
  --ink-faint:  #A09080;

  /* — Actor accent — terra/amber — */
  --terra:      #C4714A;
  --terra-lt:   #D98B65;   /* hover */
  --terra-dk:   #A85C38;   /* pressed */
  --terra-pale: #F5E6DF;   /* tinted backgrounds */
  --terra-glow: rgba(196,113,74,.18);

  /* — Director accent — sage/teal — */
  --sage:       #7A9E8E;
  --sage-lt:    #92B5A5;   /* hover */
  --sage-dk:    #5A8070;   /* pressed */
  --sage-pale:  #EAF3EF;   /* tinted backgrounds */
  --sage-glow:  rgba(122,158,142,.18);

  /* — Gold (logo, dividers, premium) — */
  --gold:       #C9A84C;
  --gold-lt:    #DFC06A;
  --gold-pale:  #F7EDD2;

  /* — Status — */
  --success:    #5AAF82;
  --success-pale: rgba(90,175,130,.12);
  --warning:    #D4A843;
  --warning-pale: rgba(212,168,67,.12);
  --error:      #C45A5A;
  --error-pale: rgba(196,90,90,.12);

  /* — Borders — */
  --border:     rgba(180,155,120,0.14);
  --border-md:  rgba(180,155,120,0.28);
  --border-lg:  rgba(180,155,120,0.44);
  --border-light: rgba(180,155,120,0.22);   /* on light surfaces */

  /* — Shadows — */
  --shadow-xs:  0 1px 4px  rgba(0,0,0,.28);
  --shadow-sm:  0 2px 12px rgba(0,0,0,.36);
  --shadow-md:  0 8px 32px rgba(0,0,0,.44);
  --shadow-lg:  0 20px 60px rgba(0,0,0,.56);
  --shadow-terra: 0 4px 20px rgba(196,113,74,.22);
  --shadow-sage:  0 4px 20px rgba(122,158,142,.22);

  /* — Typography — */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-ui:      'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-logo:    'Cinzel', serif;

  /* — Type scale — */
  --text-xs:    11px;
  --text-sm:    13px;
  --text-base:  15px;
  --text-md:    17px;
  --text-lg:    20px;
  --text-xl:    24px;
  --text-2xl:   32px;
  --text-3xl:   clamp(32px, 5vw, 48px);
  --text-4xl:   clamp(44px, 7vw, 72px);
  --text-hero:  clamp(52px, 9vw, 96px);

  /* — Spacing — */
  --space-1:    4px;
  --space-2:    8px;
  --space-3:    12px;
  --space-4:    16px;
  --space-5:    20px;
  --space-6:    24px;
  --space-8:    32px;
  --space-10:   40px;
  --space-12:   48px;
  --space-16:   64px;
  --space-20:   80px;
  --space-24:   96px;

  /* — Radii — */
  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius:     10px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-pill: 100px;

  /* — Layout — */
  --nav-h:      70px;
  --sidebar-w:  260px;
  --content-max: 1200px;
  --wrap-max:   760px;

  /* — Transitions — */
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:    cubic-bezier(0.4, 0, 1, 1);
  --ease-out:   cubic-bezier(0, 0, 0.2, 1);
  --t-fast:     .15s;
  --t-base:     .22s;
  --t-slow:     .38s;
  --t-page:     .48s;
}

/* ------------------------------------------------------------
   RESET
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}
ul, ol { list-style: none; }
hr { border: none; }

/* ------------------------------------------------------------
   TYPOGRAPHY UTILITIES
   ------------------------------------------------------------ */
.font-display  { font-family: var(--font-display); }
.font-ui       { font-family: var(--font-ui); }
.text-xs       { font-size: var(--text-xs); }
.text-sm       { font-size: var(--text-sm); }
.text-base     { font-size: var(--text-base); }
.text-md       { font-size: var(--text-md); }
.text-lg       { font-size: var(--text-lg); }
.text-xl       { font-size: var(--text-xl); }
.text-2xl      { font-size: var(--text-2xl); }

.text-muted    { color: var(--text-2); }
.text-faint    { color: var(--text-3); }
.text-terra    { color: var(--terra); }
.text-sage     { color: var(--sage); }
.text-gold     { color: var(--gold); }
.italic        { font-style: italic; }
.uppercase     { text-transform: uppercase; }
.tracking-wide { letter-spacing: .08em; }
.tracking-wider{ letter-spacing: .15em; }
.tracking-widest{letter-spacing: .22em; }

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
}
.eyebrow-terra { color: var(--terra); }
.eyebrow-sage  { color: var(--sage); }

/* ------------------------------------------------------------
   LAYOUT UTILITIES
   ------------------------------------------------------------ */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: var(--space-12) var(--space-6) var(--space-20);
}
.flex   { display: flex; }
.grid   { display: grid; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

.divider {
  border-top: 1px solid var(--border);
  margin: var(--space-8) 0;
}

/* ------------------------------------------------------------
   NAVIGATION
   ------------------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: rgba(10,8,6,.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-base) var(--ease);
}
.nav.scrolled {
  background: rgba(10,8,6,.96);
}

/* Inner pages with an action group: grid keeps logo perfectly centred */
.nav:has(.nav-back) {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

/* Inner pages WITHOUT an action group: flex + absolutely centred logo.
   The injected lang-btn sits left of the back link. */
.nav:has(.nav-back):not(:has(.nav-actions)):not(:has(.nav-cta-group)) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-4);
}
.nav:has(.nav-back):not(:has(.nav-actions)):not(:has(.nav-cta-group)) .nav-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Light nav variant (settings, legal, light-themed pages) */
.nav--light {
  background: rgba(250,247,242,.92);
  border-bottom: 1px solid var(--border-light);
}
.nav--light.scrolled {
  background: rgba(250,247,242,.98);
}

.nav-logo svg {
  display: block;
  height: clamp(40px, 5vw, 52px);
  width: auto;
}

.nav-back {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: color var(--t-fast);
  white-space: nowrap;
}
.nav-back:hover           { color: var(--text); }
.nav-back--terra:hover    { color: var(--terra); }
.nav-back--sage:hover     { color: var(--sage); }
.nav-back--light          { color: var(--ink-muted); }
.nav-back--light:hover    { color: var(--ink); }

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Injected by lang.js on pages with no nav-cta-group / nav-actions */
.nav-lang-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ------------------------------------------------------------
   LOGO (SVG inline — shared markup)
   Reference: <svg class="logo-svg" ...> in nav-logo div
   ------------------------------------------------------------ */
.logo-svg { display: block; }

/* ------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 11px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--t-base) var(--ease);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — terra (actor) */
.btn-terra {
  background: var(--terra);
  color: #fff;
  box-shadow: var(--shadow-terra);
}
.btn-terra:hover {
  background: var(--terra-lt);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(196,113,74,.38);
}
.btn-terra:active { transform: translateY(0) scale(0.98); box-shadow: var(--shadow-terra); }

/* Primary — sage (director) */
.btn-sage {
  background: var(--sage);
  color: #fff;
  box-shadow: var(--shadow-sage);
}
.btn-sage:hover {
  background: var(--sage-lt);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(122,158,142,.38);
}
.btn-sage:active { transform: translateY(0) scale(0.98); box-shadow: var(--shadow-sage); }

/* Primary — gold */
.btn-gold {
  background: var(--gold);
  color: var(--bg);
  font-weight: 700;
}
.btn-gold:hover {
  background: var(--gold-lt);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201,168,76,.3);
}
.btn-gold:active { transform: translateY(0) scale(0.98); }

/* Ghost — terra */
.btn-ghost-terra {
  background: transparent;
  border: 1.5px solid rgba(196,113,74,.4);
  color: var(--terra);
}
.btn-ghost-terra:hover {
  background: var(--terra);
  border-color: var(--terra);
  color: #fff;
  transform: translateY(-1px);
}
.btn-ghost-terra:active { transform: translateY(0) scale(0.98); }

/* Ghost — sage */
.btn-ghost-sage {
  background: transparent;
  border: 1.5px solid rgba(122,158,142,.4);
  color: var(--sage);
}
.btn-ghost-sage:hover {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
  transform: translateY(-1px);
}
.btn-ghost-sage:active { transform: translateY(0) scale(0.98); }

/* Ghost — neutral dark */
.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border-md);
  color: var(--text-2);
}
.btn-ghost:hover {
  border-color: var(--text-2);
  color: var(--text);
  background: rgba(255,255,255,.04);
}
.btn-ghost:active { transform: scale(0.98); }

/* Ghost — neutral light (for light pages) */
.btn-ghost-light {
  background: transparent;
  border: 1.5px solid var(--border-light);
  color: var(--ink-muted);
}
.btn-ghost-light:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* Size variants */
.btn-sm { padding: 8px 18px; font-size: var(--text-xs); }
.btn-lg { padding: 15px 36px; font-size: var(--text-base); }
.btn-xl { padding: 18px 44px; font-size: var(--text-md); }

/* Director-style button with role subtitle */
.btn--has-sub { flex-direction: column; align-items: center; gap: 3px; height: auto; padding-top: 12px; padding-bottom: 12px; }
.btn-main { display: block; line-height: 1; }
.btn-hint { display: block; font-size: 9px; font-weight: 400; letter-spacing: .04em; opacity: .6; text-transform: none; line-height: 1.3; }

/* Icon-only square button */
.btn-icon {
  padding: 10px;
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
}

/* ------------------------------------------------------------
   FORM ELEMENTS
   ------------------------------------------------------------ */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: var(--space-5);
}
.field label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--text-2);
  text-transform: uppercase;
}
.field label .req  { color: var(--terra); margin-left: 2px; }
.field label .opt  { color: var(--text-3); font-weight: 400; font-size: 10px; text-transform: none; margin-left: 4px; letter-spacing: 0; }

/* On light surfaces */
.field--light label { color: var(--ink-soft); text-transform: none; font-size: 12px; letter-spacing: .04em; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-3); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.1);
}
.field input.error,
.field select.error,
.field textarea.error { border-color: var(--error); }
.field input.valid,
.field select.valid,
.field textarea.valid { border-color: var(--success); }

/* ── Password visibility toggle ── */
.pw-wrap { position: relative; }
.pw-wrap input[type="password"],
.pw-wrap input[type="text"] { padding-right: 44px !important; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 4px; cursor: pointer;
  color: var(--text-3); display: flex; align-items: center; justify-content: center;
  transition: color var(--t-fast);
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Focus color variants */
.field--terra input:focus, .field--terra select:focus, .field--terra textarea:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px var(--terra-glow);
}
.field--sage input:focus, .field--sage select:focus, .field--sage textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-glow);
}

/* Light-surface inputs */
.field--light input,
.field--light select,
.field--light textarea {
  background: var(--parchment);
  color: var(--ink);
  border-color: var(--border-light);
}
.field--light input::placeholder,
.field--light textarea::placeholder { color: var(--ink-faint); }
.field--light input:focus,
.field--light select:focus,
.field--light textarea:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(196,113,74,.08);
}

.field textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23857870' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.field--light select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A09080' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.field-hint { font-size: var(--text-xs); color: var(--text-3); }
.field-error { font-size: var(--text-xs); color: var(--error); display: none; }
.field.has-error .field-error { display: block; }

/* Grid helpers for forms */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }

/* Option chips (radio/checkbox styled as pills) */
.option-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.option-chip input { display: none; }
.option-chip label {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-md);
  background: var(--bg-2);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
  user-select: none;
}
.option-chip label:hover { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,.06); }
.option-chip label:active { transform: scale(0.96); }
.option-chip input:checked + label { background: var(--gold); border-color: var(--gold); color: var(--bg); box-shadow: 0 2px 8px rgba(201,168,76,.25); }

.option-chip--terra label:hover { border-color: var(--terra); color: var(--terra); background: rgba(196,113,74,.06); }
.option-chip--terra input:checked + label { background: var(--terra); border-color: var(--terra); color: #fff; box-shadow: 0 2px 8px rgba(196,113,74,.25); }

.option-chip--sage label:hover { border-color: var(--sage); color: var(--sage); background: rgba(122,158,142,.06); }
.option-chip--sage input:checked + label { background: var(--sage); border-color: var(--sage); color: #fff; box-shadow: 0 2px 8px rgba(122,158,142,.25); }

/* Light surface chip variant */
.option-chip--light label {
  background: var(--parchment);
  border-color: var(--border-light);
  color: var(--ink-soft);
}
.option-chip--light label:hover { border-color: var(--sage); color: var(--sage); background: rgba(122,158,142,.06); }
.option-chip--light input:checked + label { background: var(--sage); border-color: var(--sage); color: #fff; box-shadow: 0 2px 8px rgba(122,158,142,.25); }

/* ------------------------------------------------------------
   TOGGLE SWITCH
   ------------------------------------------------------------ */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle input { display: none; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.toggle input:checked ~ .toggle-track {
  background: var(--terra);
  border-color: var(--terra);
}
.toggle--sage input:checked ~ .toggle-track {
  background: var(--sage);
  border-color: var(--sage);
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  transition: transform var(--t-base) var(--ease), background var(--t-fast);
}
.toggle input:checked ~ .toggle-thumb {
  transform: translateX(20px);
  background: #fff;
}

/* Light variant */
.toggle--light .toggle-track { background: var(--sand); border-color: transparent; }
.toggle--light input:checked ~ .toggle-track { background: var(--terra); }
.toggle--light .toggle-thumb { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); }

/* ------------------------------------------------------------
   CARDS
   ------------------------------------------------------------ */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}
.card:hover { border-color: var(--border-md); }

.card--light {
  background: var(--warm-white);
  border-color: var(--border-light);
}

.card--terra { border-color: rgba(196,113,74,.2); }
.card--terra:hover { border-color: rgba(196,113,74,.4); box-shadow: var(--shadow-terra); transform: translateY(-2px); }

.card--sage { border-color: rgba(122,158,142,.2); }
.card--sage:hover { border-color: rgba(122,158,142,.4); box-shadow: var(--shadow-sage); transform: translateY(-2px); }

.card--glass {
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(255,255,255,.08);
}

/* ------------------------------------------------------------
   SECTION LABELS
   ------------------------------------------------------------ */
.section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: var(--space-5);
}
.section-label--terra { color: var(--terra); }
.section-label--sage  { color: var(--sage); }
.section-label--light { color: var(--terra); }  /* on parchment surface */

/* ------------------------------------------------------------
   BADGES / TAGS
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .03em;
}
.badge-verified  { background: var(--success-pale); color: var(--success); border: 1px solid rgba(90,175,130,.2); }
.badge-pending   { background: var(--warning-pale); color: var(--warning); border: 1px solid rgba(212,168,67,.2); }
.badge-terra     { background: var(--terra-glow); color: var(--terra-lt); border: 1px solid rgba(196,113,74,.22); }
.badge-sage      { background: var(--sage-glow); color: var(--sage-lt); border: 1px solid rgba(122,158,142,.22); }
.badge-gold      { background: rgba(201,168,76,.12); color: var(--gold); border: 1px solid rgba(201,168,76,.22); }
.badge-muted     { background: var(--bg-3); color: var(--text-3); border: 1px solid var(--border); }

/* Tag chip (non-interactive) */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.tag--terra { background: var(--terra-glow); color: var(--terra-lt); border-color: rgba(196,113,74,.2); }
.tag--sage  { background: var(--sage-glow);  color: var(--sage-lt);  border-color: rgba(122,158,142,.2); }
.tag--gold  { background: rgba(201,168,76,.1); color: var(--gold);   border-color: rgba(201,168,76,.2); }

/* ------------------------------------------------------------
   PROGRESS BAR
   ------------------------------------------------------------ */
.progress-bar {
  height: 4px;
  background: var(--bg-3);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--terra);
  transition: width .6s var(--ease);
}
.progress-fill--sage   { background: var(--sage); }
.progress-fill--gold   { background: var(--gold); }
.progress-fill--gradient {
  background: linear-gradient(90deg, var(--terra), var(--gold));
}

/* ------------------------------------------------------------
   AVATAR
   ------------------------------------------------------------ */
.avatar {
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-weight: 600;
  border: 2px solid var(--border);
}
.avatar-sm  { width: 36px;  height: 36px;  font-size: 14px; }
.avatar-md  { width: 56px;  height: 56px;  font-size: 20px; }
.avatar-lg  { width: 80px;  height: 80px;  font-size: 28px; }
.avatar-xl  { width: 120px; height: 120px; font-size: 40px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--terra { border-color: var(--terra); }
.avatar--sage  { border-color: var(--sage); }
.avatar--gold  { border-color: var(--gold); }

/* ------------------------------------------------------------
   STAT CARD
   ------------------------------------------------------------ */
.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
}
.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--text);
  line-height: 1.1;
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--text-3);
  letter-spacing: .05em;
  margin-top: 4px;
}

/* ------------------------------------------------------------
   NOTIFICATION DOT
   ------------------------------------------------------------ */
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terra);
  flex-shrink: 0;
}
.notif-dot--sage { background: var(--sage); }
.notif-dot--gold { background: var(--gold); }

/* ------------------------------------------------------------
   SIDEBAR LAYOUT
   ------------------------------------------------------------ */
.page-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--nav-h));
  align-items: start;
}
.sidebar {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-3) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 2px; }
.main-content {
  padding: var(--space-8) var(--space-8) var(--space-20);
  min-width: 0;
}

/* Sidebar nav */
.sidebar-nav { padding: var(--space-5) var(--space-4); }
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
}
.sidebar-nav-item:hover  { background: var(--bg-2); color: var(--text); padding-left: calc(var(--space-4) + 2px); }
.sidebar-nav-item:active { transform: scale(0.98); }
.sidebar-nav-item.active { background: var(--bg-2); color: var(--text); font-weight: 600; }
.sidebar-nav-item.active--terra { color: var(--terra); background: rgba(196,113,74,.08); }
.sidebar-nav-item.active--sage  { color: var(--sage);  background: rgba(122,158,142,.08); }

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 300;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--terra);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all var(--t-base) var(--ease);
}
.sidebar-toggle:hover { background: var(--terra-lt); transform: scale(1.05); }

/* Mobile sidebar drawer */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 250;
  opacity: 0;
  transition: opacity var(--t-base);
}
.sidebar-overlay.open { opacity: 1; }

/* ------------------------------------------------------------
   STEP PROGRESS (multi-step forms)
   ------------------------------------------------------------ */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--space-10);
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  flex: 1;
  max-width: 120px;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 1px;
  background: var(--border-md);
  transition: background var(--t-slow);
}
.step-item.completed:not(:last-child)::after { background: var(--terra); }
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1.5px solid var(--border-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-3);
  transition: all var(--t-base) var(--ease);
  position: relative;
  z-index: 1;
}
.step-item.active   .step-num { border-color: var(--terra); color: var(--terra); background: var(--terra-glow); }
.step-item.completed .step-num { background: var(--terra); border-color: var(--terra); color: #fff; }
.step-label {
  font-size: 10px;
  color: var(--text-3);
  text-align: center;
  transition: color var(--t-base);
}
.step-item.active    .step-label { color: var(--terra); font-weight: 600; }
.step-item.completed .step-label { color: var(--text-2); }

/* Sage variant (director flows) */
.steps--sage .step-item.active    .step-num   { border-color: var(--sage); color: var(--sage); background: var(--sage-glow); }
.steps--sage .step-item.completed .step-num   { background: var(--sage); border-color: var(--sage); }
.steps--sage .step-item.completed::after      { background: var(--sage); }
.steps--sage .step-item.active    .step-label { color: var(--sage); }

/* ------------------------------------------------------------
   PHOTO UPLOAD ZONE
   ------------------------------------------------------------ */
.upload-zone {
  border: 1.5px dashed var(--border-md);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-8);
  cursor: pointer;
  transition: all var(--t-base);
  background: var(--bg-2);
  text-align: center;
}
.upload-zone:hover {
  border-color: var(--terra);
  background: var(--terra-glow);
}
.upload-zone--sage:hover { border-color: var(--sage); background: var(--sage-glow); }
.upload-icon { font-size: 28px; opacity: .5; }
.upload-label { font-size: var(--text-sm); color: var(--text-2); font-weight: 500; }
.upload-hint  { font-size: var(--text-xs); color: var(--text-3); }

/* ------------------------------------------------------------
   MATCH BAR
   ------------------------------------------------------------ */
.match-bar-wrap { display: flex; align-items: center; gap: var(--space-3); }
.match-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-3);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.match-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--sage), var(--success));
  transition: width .8s var(--ease);
}
.match-pct {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--sage);
  white-space: nowrap;
}

/* ------------------------------------------------------------
   EMPTY STATE
   ------------------------------------------------------------ */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--text-3);
}
.empty-icon { font-size: 40px; margin-bottom: var(--space-4); opacity: .4; }
.empty-title { font-family: var(--font-display); font-size: var(--text-lg); color: var(--text-2); margin-bottom: var(--space-2); }
.empty-desc { font-size: var(--text-sm); line-height: 1.8; }

/* ------------------------------------------------------------
   TOAST / ALERT STRIP
   ------------------------------------------------------------ */
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  line-height: 1.6;
}
.toast-info    { background: rgba(201,168,76,.1);  border: 1px solid rgba(201,168,76,.2);  color: var(--gold); }
.toast-success { background: var(--success-pale);  border: 1px solid rgba(90,175,130,.2);  color: var(--success); }
.toast-warning { background: var(--warning-pale);  border: 1px solid rgba(212,168,67,.2);  color: var(--warning); }
.toast-error   { background: var(--error-pale);    border: 1px solid rgba(196,90,90,.2);   color: var(--error); }

/* ------------------------------------------------------------
   PAGINATION
   ------------------------------------------------------------ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding-top: var(--space-8);
}
.page-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  text-decoration: none;
}
.page-btn:hover   { background: var(--bg-3); color: var(--text); }
.page-btn.active  { background: var(--terra); border-color: var(--terra); color: #fff; }
.page-btn--sage.active { background: var(--sage); border-color: var(--sage); }

/* ------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------ */
.footer {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  padding: var(--space-16) var(--space-6) var(--space-10);
}
.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-8);
}
.footer-brand-desc {
  font-size: var(--text-sm);
  color: var(--text-3);
  line-height: 1.8;
  margin-top: var(--space-5);
  max-width: 280px;
}
.footer-col-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: var(--space-5);
}
.footer-links { display: flex; flex-direction: column; gap: var(--space-3); }
.footer-link {
  font-size: var(--text-sm);
  color: var(--text-3);
  transition: color var(--t-fast);
  text-decoration: none;
}
.footer-link:hover { color: var(--gold); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.footer-copy {
  font-size: var(--text-xs);
  color: var(--text-3);
}
.footer-legal {
  display: flex;
  gap: var(--space-5);
}
.footer-legal a {
  font-size: var(--text-xs);
  color: var(--text-3);
  transition: color var(--t-fast);
}
.footer-legal a:hover { color: var(--gold); }

/* Gold divider line (decorative) */
.footer-gold-line {
  width: 60px;
  height: 1px;
  background: var(--gold);
  opacity: .4;
  margin: var(--space-5) 0;
}

/* ------------------------------------------------------------
   SCROLL ANIMATIONS
   ------------------------------------------------------------ */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.fade-up.in-view {
  opacity: 1;
  transform: none;
}
.fade-in {
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}
.fade-in.in-view { opacity: 1; }

/* Stagger delay helpers */
.delay-1 { transition-delay: .1s; }
.delay-2 { transition-delay: .2s; }
.delay-3 { transition-delay: .3s; }
.delay-4 { transition-delay: .4s; }
.delay-5 { transition-delay: .5s; }
.delay-6 { transition-delay: .6s; }

/* ------------------------------------------------------------
   PAGE TRANSITION
   ------------------------------------------------------------ */
.page-enter {
  animation: pageEnter var(--t-page) var(--ease) forwards;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   SKELETON LOADING
   ------------------------------------------------------------ */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: var(--radius-sm);
}
.skeleton-text   { height: 14px; border-radius: 3px; }
.skeleton-circle { border-radius: 50%; }

/* ------------------------------------------------------------
   DECORATIVE ARCS (shared across 404, login, reset-password)
   ------------------------------------------------------------ */
.arc-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.arc-decoration svg { position: absolute; }

/* ------------------------------------------------------------
   RESPONSIVE BREAKPOINTS
   ------------------------------------------------------------ */

/* Tablet */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --nav-h: 56px;
    --sidebar-w: 280px;
  }

  .container, .wrap { padding-left: var(--space-4); padding-right: var(--space-4); }
  .wrap { padding-top: var(--space-8); }

  .page-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 260;
    transform: translateX(-100%);
    transition: transform var(--t-base) var(--ease);
    width: var(--sidebar-w);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay { display: block; pointer-events: none; }
  .sidebar-overlay.open { pointer-events: auto; }
  .sidebar-toggle { display: flex; }

  .main-content { padding: var(--space-6) var(--space-4) var(--space-16); }

  .nav { padding: 0 var(--space-4); }

  /* Inner-page navs: logo overlaps btn + back link at mobile widths — hide it.
     Brand is still visible in page content / login card / etc. */
  .nav:has(.nav-back) .nav-logo {
    display: none;
  }

  .footer-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }

  .steps { gap: 0; }
  .step-label { display: none; }

  .btn-xl { padding: 15px 32px; font-size: var(--text-base); }
}

/* Extra small */
@media (max-width: 380px) {
  .btn-lg { padding: 12px 24px; }
  .stat-value { font-size: var(--text-xl); }
}

/* ------------------------------------------------------------
   UTILITY CLASSES
   ------------------------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pointer  { cursor: pointer; }
.no-select{ user-select: none; }

/* RTL support — layout */
[dir="rtl"] .nav-back { flex-direction: row-reverse; }
[dir="rtl"] .sidebar  { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .sidebar-toggle { right: auto; left: var(--space-6); }

/* RTL sidebar drawer — mobile only (desktop sidebar is a sticky grid column, no transform needed) */
@media (max-width: 640px) {
  [dir="rtl"] .sidebar  { left: auto; right: 0; transform: translateX(100%); }
  [dir="rtl"] .sidebar.open { transform: translateX(0); }
}

/* RTL — nav & header */
[dir="rtl"] .nav { direction: rtl; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .nav-cta-group { flex-direction: row-reverse; }
[dir="rtl"] .nav-item { flex-direction: row-reverse; }
[dir="rtl"] .nav-badge { margin-left: 0; margin-right: 8px; }

/* RTL — forms */
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea { direction: rtl; text-align: right; }
[dir="rtl"] .field label { text-align: right; }
[dir="rtl"] .field-group.cols-2,
[dir="rtl"] .field-group.cols-3 { direction: rtl; }
[dir="rtl"] select { background-position: left 14px center; padding-right: 16px; padding-left: 36px; }

/* RTL — chips & option groups */
[dir="rtl"] .option-group,
[dir="rtl"] .will-opts,
[dir="rtl"] .yn-opts,
[dir="rtl"] .drive-chips,
[dir="rtl"] .work-chips,
[dir="rtl"] .casting-chips { flex-direction: row-reverse; }

/* RTL — step progress */
[dir="rtl"] .progress-fill { left: auto; right: 0; }
[dir="rtl"] .step-num-label { text-align: right; }
[dir="rtl"] .step-title,
[dir="rtl"] .step-subtitle { text-align: right; }

/* RTL — cards & sections */
[dir="rtl"] .how-step { flex-direction: row-reverse; }
[dir="rtl"] .stat-row { flex-direction: row-reverse; }
[dir="rtl"] .talent-card-meta { flex-direction: row-reverse; }
[dir="rtl"] .talent-card-chips { flex-direction: row-reverse; flex-wrap: wrap-reverse; }
[dir="rtl"] .feed-card-chips { flex-direction: row-reverse; flex-wrap: wrap; }
[dir="rtl"] .ci-item { flex-direction: row-reverse; }
[dir="rtl"] .upload-zone { direction: rtl; }
[dir="rtl"] .form-header { text-align: right; }
[dir="rtl"] .section-title,
[dir="rtl"] .section-desc { text-align: right; }
[dir="rtl"] .eyebrow { text-align: right; }
[dir="rtl"] .hero-title,
[dir="rtl"] .hero-sub { text-align: right; }
[dir="rtl"] .hero-actions { flex-direction: row-reverse; }
[dir="rtl"] .cta-card { text-align: right; }

/* ------------------------------------------------------------
   LANGUAGE TOGGLE
   ------------------------------------------------------------ */
.lang-btn {
  background: transparent;
  border: 1px solid var(--border-md);
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast);
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.lang-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,.06);
}
.lang-btn:active {
  transform: scale(0.94);
  background: rgba(201,168,76,.12);
}

/* ------------------------------------------------------------
   ARABIC / RTL TYPOGRAPHY
   ------------------------------------------------------------ */
[lang="ar"] body,
[lang="ar"] p,
[lang="ar"] span,
[lang="ar"] div,
[lang="ar"] li,
[lang="ar"] td,
[lang="ar"] th,
[lang="ar"] label,
[lang="ar"] button,
[lang="ar"] a {
  font-family: 'Almarai', 'DM Sans', sans-serif;
  letter-spacing: 0;
}

[lang="ar"] h1,
[lang="ar"] h2,
[lang="ar"] h3,
[lang="ar"] h4,
[lang="ar"] h5,
[lang="ar"] .hero-title,
[lang="ar"] .section-title,
[lang="ar"] .cta-title,
[lang="ar"] .step-title,
[lang="ar"] .doc-title {
  font-family: 'Almarai', 'Playfair Display', serif;
  letter-spacing: 0;
}

/* Profile names always keep their English font — names are not translated */
[lang="ar"] .actor-name,
[lang="ar"] .dir-name,
[lang="ar"] .director-name,
[lang="ar"] .sc-name,
[lang="ar"] .card-name,
[lang="ar"] .page-title em,
[lang="ar"] #profile-actor-name,
[lang="ar"] #sidebar-actor-name,
[lang="ar"] #sidebar-director-name,
[lang="ar"] #dir-profile-name,
[lang="ar"] #dir-name,
[lang="ar"] #nav-user-name,
[lang="ar"] #nav-director-name {
  font-family: var(--font-display);
  letter-spacing: normal;
  color: inherit;
}

/* Eyebrows + labels keep minimal spacing in Arabic */
[lang="ar"] .eyebrow,
[lang="ar"] .step-num-label,
[lang="ar"] .how-panel-role,
[lang="ar"] .feed-card-type,
[lang="ar"] .cta-card-label {
  letter-spacing: 0.03em;
}

/* Nav layout mirrors in RTL */
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .hero-trust { flex-direction: row-reverse; }
[dir="rtl"] .how-panel-cta { text-align: right; }
[dir="rtl"] .footer-grid { direction: rtl; }

/* ------------------------------------------------------------
   CUSTOM SVG ICON SYSTEM
   ------------------------------------------------------------ */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm  { width: 14px; height: 14px; }
.icon-md  { width: 18px; height: 18px; }
.icon-lg  { width: 24px; height: 24px; }
.icon-xl  { width: 32px; height: 32px; }
.icon-2xl { width: 40px; height: 40px; }

/* Brand icon colours */
.icon-instagram { color: #E1306C; }
.icon-whatsapp  { color: #25D366; }
.icon-tiktok    { color: var(--text); }

/* Upload zone icon */
.upload-zone .icon { width: 32px; height: 32px; margin-bottom: 8px; color: var(--text-3); }
.upload-zone:hover .icon { color: var(--terra-lt); }
