/* ═══════════════════════════════════════════════════════
   Census Design System v3 — المستشارية الثقافية
   Aesthetic: Refined Government — Warm Dark & Gold
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
  --ink:         #08131f;
  --navy:        #0c1e30;
  --navy-2:      #122840;
  --navy-3:      #1a3354;
  --gold:        #d4a017;
  --gold-2:      #e8b830;
  --gold-3:      #f5cc5a;
  --gold-pale:   #fdf5e0;
  --gold-glow:   rgba(212,160,23,.18);
  --cream:       #faf7f2;
  --white:       #ffffff;
  --bg:          #f2efe9;
  --card:        #ffffff;
  --card-2:      #faf9f7;
  --border:      #e2ddd6;
  --border-2:    #d0ccc5;
  --text:        #1a1410;
  --text-2:      #3d3730;
  --text-3:      #7a7268;
  --text-4:      #b0a99f;
  --success:     #0a7c52;
  --success-bg:  #f0faf5;
  --error:       #b91c1c;
  --error-bg:    #fef2f2;
  --warning:     #b45309;
  --warning-bg:  #fffbeb;

  --r-xs: 6px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --sh-xs: 0 1px 4px rgba(8,19,31,.06);
  --sh-sm: 0 2px 10px rgba(8,19,31,.08), 0 1px 3px rgba(8,19,31,.04);
  --sh-md: 0 6px 24px rgba(8,19,31,.11), 0 2px 8px rgba(8,19,31,.06);
  --sh-lg: 0 14px 48px rgba(8,19,31,.15), 0 4px 14px rgba(8,19,31,.08);
  --sh-gold: 0 4px 20px rgba(212,160,23,.25);

  --font: 'Tajawal', sans-serif;
  --tr: .2s cubic-bezier(.4,0,.2,1);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────
   HEADER
───────────────────────────────── */
.c-header {
  background: var(--ink);
  height: 66px;
  display: flex;
  align-items: center;
  padding: 0 clamp(16px,4vw,48px);
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 4px 20px rgba(0,0,0,.4);
}

.c-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}
.c-emblem {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(212,160,23,.25), rgba(212,160,23,.06));
  border: 1px solid rgba(212,160,23,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-2);
  font-size: 17px;
  font-weight: 900;
  flex-shrink: 0;
}
.c-brand-name {
  color: rgba(255,255,255,.92);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}
.c-brand-sub {
  color: rgba(255,255,255,.32);
  font-size: 10.5px;
  font-weight: 400;
}

.c-back {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,.42);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: color var(--tr);
  white-space: nowrap;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50px;
}
.c-back:hover { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.16); }

/* ─────────────────────────────────
   NOTICE BAR
───────────────────────────────── */
.c-notice {
  background: var(--navy);
  border-bottom: 1px solid rgba(212,160,23,.12);
  padding: 9px clamp(16px,4vw,48px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: rgba(255,255,255,.42);
}
.c-notice strong { color: rgba(255,255,255,.8); font-weight: 700; }
.c-notice a { color: var(--gold-2); text-decoration: none; font-weight: 700; }
.c-notice a:hover { text-decoration: underline; }
.c-notice-sep { width: 3px; height: 3px; border-radius: 50%; background: rgba(212,160,23,.35); flex-shrink: 0; }

/* ─────────────────────────────────
   HERO
───────────────────────────────── */
.c-hero {
  background: var(--navy);
  padding: clamp(48px,9vw,88px) clamp(16px,4vw,48px) clamp(64px,12vw,108px);
  position: relative;
  overflow: hidden;
  text-align: center;
}

/* Geometric pattern */
.c-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 75% 30%, rgba(212,160,23,.12) 0%, transparent 55%),
    radial-gradient(circle at 20% 70%, rgba(26,51,84,.9) 0%, transparent 60%),
    linear-gradient(180deg, rgba(8,19,31,0) 0%, rgba(8,19,31,.5) 100%);
  pointer-events: none;
}

/* Decorative rings */
.c-hero-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(212,160,23,.08);
  pointer-events: none;
}
.c-hero-ring-1 { width: 500px; height: 500px; top: -200px; left: -100px; }
.c-hero-ring-2 { width: 300px; height: 300px; top: 40px; right: -60px; border-color: rgba(255,255,255,.04); }
.c-hero-ring-3 { width: 180px; height: 180px; bottom: 20px; left: 25%; border-color: rgba(212,160,23,.06); }

/* Bottom curve */
.c-hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 56px;
  background: var(--bg);
  clip-path: ellipse(60% 100% at 50% 100%);
}

.c-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
}

.c-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(212,160,23,.1);
  border: 1px solid rgba(212,160,23,.22);
  border-radius: 50px;
  padding: 5px 16px 5px 12px;
  color: var(--gold-3);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 22px;
  letter-spacing: .02em;
}
.c-hero-dot {
  width: 7px; height: 7px;
  background: var(--gold-2);
  border-radius: 50%;
  animation: pulse 2.4s ease infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.35;transform:scale(.65)} }

.c-hero h1 {
  color: #fff;
  font-size: clamp(26px,5vw,46px);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 14px;
  letter-spacing: -.01em;
}
.c-hero h1 em {
  font-style: normal;
  color: var(--gold-2);
}
.c-hero-desc {
  color: rgba(255,255,255,.5);
  font-size: clamp(14px,2vw,16px);
  max-width: 500px;
  margin: 0 auto 36px;
  line-height: 1.85;
  font-weight: 400;
}

.c-hero-stats {
  display: inline-flex;
  gap: clamp(20px,5vw,52px);
  flex-wrap: wrap;
  justify-content: center;
  padding: 16px clamp(20px,5vw,48px);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-lg);
}
.c-stat-val {
  display: block;
  font-size: clamp(24px,4vw,36px);
  font-weight: 900;
  color: var(--gold-2);
  line-height: 1;
  margin-bottom: 4px;
}
.c-stat-lbl {
  font-size: 11px;
  color: rgba(255,255,255,.3);
  font-weight: 400;
}

/* ─────────────────────────────────
   LAYOUT
───────────────────────────────── */
.c-layout {
  flex: 1;
  max-width: 860px;
  margin: -32px auto 0;
  padding: 0 clamp(12px,3vw,24px) 72px;
  position: relative;
  z-index: 2;
}

/* ─────────────────────────────────
   PROGRESS
───────────────────────────────── */
.c-progress {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 24px 18px;
  box-shadow: var(--sh-md);
  margin-bottom: 18px;
}

.c-progress-track {
  height: 5px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 18px;
}
.c-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy-3), var(--gold-2));
  border-radius: 3px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

.c-steps {
  display: flex;
  position: relative;
}
.c-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  position: relative;
}
/* Connector line */
.c-step + .c-step::before {
  content: '';
  position: absolute;
  top: 14px;
  right: 50%;
  left: -50%;
  height: 1px;
  background: var(--border);
  z-index: 0;
}
.c-step-bubble {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-4);
  transition: all var(--tr);
  position: relative;
  z-index: 1;
}
.c-step.active .c-step-bubble {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--gold-2);
  box-shadow: 0 0 0 5px rgba(12,30,48,.09);
}
.c-step.done .c-step-bubble {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}
.c-step-label {
  font-size: 10.5px;
  color: var(--text-4);
  text-align: center;
  font-weight: 500;
  white-space: nowrap;
}
.c-step.active .c-step-label { color: var(--navy); font-weight: 700; }
.c-step.done  .c-step-label  { color: var(--success); }
@media(max-width:520px){ .c-step-label { display: none; } }

/* ─────────────────────────────────
   SECTION CARD
───────────────────────────────── */
.c-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-md);
  margin-bottom: 16px;
  display: none;
}
.c-section.active {
  display: block;
  animation: sectionIn .32s cubic-bezier(.4,0,.2,1);
}
@keyframes sectionIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.c-section-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.c-section-header::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}
.c-section-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(212,160,23,.15);
  border: 1px solid rgba(212,160,23,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-2);
  font-size: 17px;
  flex-shrink: 0;
}
.c-section-header h2 {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 2px;
}
.c-section-header p {
  color: rgba(255,255,255,.4);
  font-size: 12px;
  font-weight: 400;
}

.c-section-body { padding: 28px; }
@media(max-width:480px){ .c-section-body { padding: 20px 16px; } }

/* ─────────────────────────────────
   FIELDS
───────────────────────────────── */
.c-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.c-grid .span-2 { grid-column: 1 / -1; }
@media(max-width:560px){
  .c-grid { grid-template-columns: 1fr; }
  .c-grid .span-2 { grid-column: 1; }
}

.c-field { display: flex; flex-direction: column; gap: 7px; }

.c-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.c-req { color: var(--error); font-size: 14px; line-height: 1; }
.c-opt { font-size: 11px; color: var(--text-4); font-weight: 400; }

.c-input, .c-select {
  width: 100%;
  background: var(--card-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 15px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: all var(--tr);
  appearance: none;
}
.c-input:hover, .c-select:hover { border-color: var(--border-2); }
.c-input:focus, .c-select:focus {
  border-color: var(--navy-2);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(12,30,48,.07);
}
.c-input.err, .c-select.err {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(185,28,28,.06);
}
.c-input::placeholder { color: var(--text-4); }
.c-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b0a99f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 13px center;
  padding-left: 38px;
  cursor: pointer;
}

.c-hint { font-size: 11.5px; color: var(--text-4); line-height: 1.5; }
.c-field-err { font-size: 11.5px; color: var(--error); display: none; align-items: center; gap: 5px; }
.c-field-err.show { display: flex; }

/* ─────────────────────────────────
   RADIO CARDS
───────────────────────────────── */
.c-radios { display: flex; gap: 10px; flex-wrap: wrap; }
.c-radio {
  flex: 1;
  min-width: 120px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--tr);
  user-select: none;
  background: var(--card-2);
}
.c-radio:hover { border-color: var(--border-2); background: var(--white); }
.c-radio.sel {
  border-color: var(--navy);
  background: rgba(12,30,48,.04);
  box-shadow: 0 0 0 3px rgba(12,30,48,.07);
}
.c-radio-pip {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  flex-shrink: 0;
  transition: all var(--tr);
}
.c-radio.sel .c-radio-pip { border-color: var(--navy); border-width: 5px; }
.c-radio-lbl { font-size: 13.5px; font-weight: 700; color: var(--text-2); line-height: 1.3; }
.c-radio-sub { font-size: 11px; color: var(--text-4); }

/* ─────────────────────────────────
   CODE BADGE
───────────────────────────────── */
.c-code-reveal {
  display: none;
  margin-top: 20px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 100%);
  border-radius: var(--r);
  padding: 20px 24px;
  align-items: center;
  gap: 18px;
  animation: sectionIn .3s ease;
  border: 1px solid rgba(212,160,23,.2);
}
.c-code-reveal.show { display: flex; }
.c-code-icon-wrap {
  width: 52px; height: 52px;
  border-radius: var(--r-sm);
  background: rgba(212,160,23,.12);
  border: 1px solid rgba(212,160,23,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-2);
  font-size: 22px;
  flex-shrink: 0;
}
.c-code-lbl { font-size: 11px; color: rgba(255,255,255,.35); margin-bottom: 5px; letter-spacing:.04em; font-weight: 500; }
.c-code-val {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold-2);
  direction: ltr;
  letter-spacing: .07em;
  font-family: 'Courier New', monospace;
  line-height: 1;
  margin-bottom: 4px;
}
.c-code-desc { font-size: 11.5px; color: rgba(255,255,255,.35); }

/* ─────────────────────────────────
   ALERTS
───────────────────────────────── */
.c-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: var(--r-sm);
  padding: 14px 16px;
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.6;
}
.c-alert i { flex-shrink: 0; margin-top: 1px; }
.c-alert-info    { background: rgba(12,30,48,.05); color: var(--navy-3); border: 1px solid rgba(12,30,48,.1); }
.c-alert-warn    { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(180,83,9,.16); }
.c-alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(10,124,82,.16); }

.c-privacy {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 20px;
}
.c-privacy i { color: var(--navy-3); flex-shrink: 0; margin-top: 2px; }

/* ─────────────────────────────────
   BUTTONS
───────────────────────────────── */
.c-btn-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  flex-wrap: wrap;
}
.c-btn-row-end { justify-content: flex-end; }

.c-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--tr);
  text-decoration: none;
  white-space: nowrap;
}
.c-btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 4px 14px rgba(8,19,31,.28);
}
.c-btn-primary:hover {
  background: var(--navy-2);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(8,19,31,.34);
}
.c-btn-gold {
  background: var(--gold);
  color: var(--navy);
  box-shadow: var(--sh-gold);
}
.c-btn-gold:hover {
  background: var(--gold-2);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(212,160,23,.4);
}
.c-btn-ghost {
  background: transparent;
  color: var(--text-3);
  border: 1.5px solid var(--border);
}
.c-btn-ghost:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: rgba(12,30,48,.03);
}
.c-btn:disabled { opacity: .38; cursor: not-allowed; transform: none !important; }

/* ─────────────────────────────────
   REVIEW TABLE
───────────────────────────────── */
.c-review-block {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 14px;
}
.c-review-head {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  padding: 10px 18px;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .02em;
}
.c-review-head i { color: var(--gold-2); font-size: 13px; }
.c-review-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  gap: 16px;
}
.c-review-row:last-child { border-bottom: none; }
.c-review-row:nth-child(even) { background: var(--card-2); }
.c-review-lbl { color: var(--text-3); flex-shrink: 0; min-width: 100px; }
.c-review-val { font-weight: 700; color: var(--text); text-align: left; direction: auto; }
.c-review-code {
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
  background: var(--gold-pale);
  padding: 2px 12px;
  border-radius: 6px;
}

/* ─────────────────────────────────
   LOADING OVERLAY
───────────────────────────────── */
.c-loading {
  position: fixed;
  inset: 0;
  background: rgba(8,19,31,.82);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.c-loading.show { display: flex; }
.c-spinner {
  width: 52px; height: 52px;
  border: 3px solid rgba(255,255,255,.08);
  border-top-color: var(--gold-2);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.c-loading-text { color: rgba(255,255,255,.55); font-size: 14px; font-weight: 500; }

/* ─────────────────────────────────
   FOOTER
───────────────────────────────── */
.c-footer {
  background: linear-gradient(180deg, var(--navy-2) 0%, var(--ink) 100%);
  border-top: 2px solid var(--gold);
  padding: 34px clamp(16px, 4vw, 48px) 28px;
  text-align: center;
  margin-top: auto;
  position: relative;
  overflow: hidden;
}
.c-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(212, 160, 23, .07) 0%, transparent 68%);
  pointer-events: none;
}
.c-footer-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}
.c-footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.c-footer-logo {
  height: 54px;
  width: auto;
  object-fit: contain;
  opacity: .94;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .32));
}
.c-footer-brand { text-align: center; }
.c-footer-title {
  color: rgba(255, 255, 255, .93);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  margin-bottom: 4px;
}
.c-footer-sub {
  color: var(--gold-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
}
.c-footer-flag {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.c-footer-flag span { height: 4px; width: 50px; }
.c-footer-flag span:nth-child(1) { background: #c0392b; border-radius: 2px 0 0 2px; }
.c-footer-flag span:nth-child(2) { background: rgba(255, 255, 255, .55); }
.c-footer-flag span:nth-child(3) { background: rgba(0, 0, 0, .35); border-radius: 0 2px 2px 0; }
.c-footer-divider {
  width: 72px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 16px;
  border-radius: 2px;
}
.c-footer-copy {
  font-size: 12px;
  color: rgba(255, 255, 255, .48);
  margin: 0 0 6px;
  font-weight: 500;
  line-height: 1.6;
}
.c-footer-note {
  font-size: 11px;
  color: rgba(255, 255, 255, .24);
  margin: 0;
  line-height: 1.5;
}
.c-footer p { font-size: 12px; color: rgba(255, 255, 255, .2); }
