/* ============================================
   مساري — Design System
   Premium Career Guidance Platform
   RTL-First | Mobile-First | Accessible
   ============================================ */

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

/* --- CSS Custom Properties --- */
:root {
  /* Core Palette */
  --burgundy-deep:    #2B0D18;
  --burgundy-rich:    #5A1A35;
  --burgundy-mid:     #7A2040;
  --plum-dark:        #3C1120;
  --plum-mid:         #4E1530;
  --rose-muted:       #B33263;
  --rose-soft:        #C75B8A;
  --gold-primary:     #D8B16E;
  --gold-light:       #E8CA96;
  --gold-muted:       #A68B5B;
  --ivory-warm:       #F5EDE0;
  --ivory-light:      #FAF6F0;
  --offwhite:         #FDFBF8;
  --neutral-900:      #1A1A1A;
  --neutral-800:      #2D2D2D;
  --neutral-700:      #404040;
  --neutral-600:      #5C5C5C;
  --neutral-500:      #787878;
  --neutral-400:      #9E9E9E;
  --neutral-300:      #C4C4C4;
  --neutral-200:      #E0E0E0;
  --neutral-100:      #F0F0F0;

  /* Functional */
  --success:          #2D8A56;
  --error:            #C0392B;
  --warning:          #D4A843;

  /* Typography */
  --font-primary:     'Cairo', sans-serif;
  --text-xs:          0.75rem;
  --text-sm:          0.875rem;
  --text-base:        1rem;
  --text-lg:          1.125rem;
  --text-xl:          1.25rem;
  --text-2xl:         1.5rem;
  --text-3xl:         1.875rem;
  --text-4xl:         2.25rem;
  --text-5xl:         3rem;
  --text-6xl:         3.75rem;
  --line-tight:       1.3;
  --line-normal:      1.6;
  --line-relaxed:     1.8;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 30px rgba(0,0,0,.12);
  --shadow-xl:    0 16px 50px rgba(0,0,0,.15);
  --shadow-gold:  0 4px 20px rgba(216,177,110,.25);

  /* Transitions */
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:  cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast:  200ms;
  --duration-normal: 350ms;
  --duration-slow:   500ms;

  /* Layout */
  --container-max: 1200px;
  --nav-height: 72px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--line-normal);
  color: var(--neutral-800);
  background-color: var(--offwhite);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

ul, ol { list-style: none; }

/* --- Utility Classes --- */
.container-m {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-wide {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Text alignment helpers */
.text-center {
  text-align: center;
}

.text-center .section-label {
  justify-content: center;
}

.text-center .heading-2,
.text-center .heading-1,
.text-center .heading-3 {
  margin-left: auto;
  margin-right: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --- Typography --- */
.heading-1 {
  font-size: var(--text-5xl);
  font-weight: 800;
  line-height: var(--line-tight);
  letter-spacing: -0.02em;
  color: var(--offwhite);
}

.heading-2 {
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: var(--line-tight);
  letter-spacing: -0.01em;
}

.heading-3 {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: var(--line-tight);
}

.heading-4 {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: var(--line-tight);
}

.text-balance {
  text-wrap: balance;
}

.text-gold {
  color: var(--gold-primary);
}

.text-rose {
  color: var(--rose-muted);
}

.text-muted-custom {
  color: var(--neutral-500);
}

/* --- Background System --- */
.bg-masari {
  background:
    radial-gradient(circle at 16% 12%, rgba(179,50,99,.16), transparent 18%),
    radial-gradient(circle at 88% 10%, rgba(216,177,110,.10), transparent 18%),
    linear-gradient(155deg, rgba(43,13,24,.82), rgba(60,17,32,.70));
  background-color: var(--burgundy-deep);
}

.bg-masari-subtle {
  background:
    radial-gradient(circle at 80% 80%, rgba(179,50,99,.06), transparent 40%),
    radial-gradient(circle at 20% 30%, rgba(216,177,110,.04), transparent 40%);
  background-color: var(--offwhite);
}

.bg-warm {
  background-color: var(--ivory-warm);
}

.bg-dark-section {
  background:
    radial-gradient(circle at 50% 50%, rgba(179,50,99,.08), transparent 60%),
    var(--burgundy-deep);
}

/* --- Navigation --- */
.nav-masari {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: var(--nav-height);
  z-index: 1000;
  transition: background var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.nav-masari.scrolled {
  background: rgba(43, 13, 24, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(216, 177, 110, 0.1);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.nav-logo {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--offwhite);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
}

.nav-logo span {
  color: var(--gold-primary);
}

.nav-logo-img {
  height: 48px;
  width: auto;
  max-width: 160px;
  display: block;
  object-fit: contain;
  transition: height var(--duration-normal) var(--ease-out);
}

.nav-masari.scrolled .nav-logo-img {
  height: 42px;
  max-width: 140px;
}

.nav-extra {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-4);
}

.nav-extra:empty {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(253, 251, 248, 0.7);
  transition: color var(--duration-fast) var(--ease-out);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--offwhite);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--gold-primary);
  border-radius: 1px;
  transition: width var(--duration-normal) var(--ease-out);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: var(--gold-primary);
   color: var(--burgundy-deep);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--duration-fast) var(--ease-out);
}

.nav-cta:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

/* Distinct style for the "Join Initiative" button — solid gold with stronger hover */
.nav-cta-join {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  color: var(--burgundy-deep);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(216, 177, 110, 0.25);
}

.nav-cta-join:hover {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
  box-shadow: 0 6px 20px rgba(216, 177, 110, 0.4);
}

/* WhatsApp button — outline style so the Join button stays primary */
.nav-cta-whatsapp {
  background: transparent;
  color: var(--offwhite);
  border: 1px solid rgba(253, 251, 248, 0.3);
}

.nav-cta-whatsapp:hover {
  background: rgba(253, 251, 248, 0.1);
  border-color: rgba(253, 251, 248, 0.5);
  box-shadow: none;
}

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--offwhite);
  border-radius: 1px;
  transition: all var(--duration-fast) var(--ease-out);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(43, 13, 24, 0.97);
  backdrop-filter: blur(24px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.nav-mobile-overlay.active {
  display: flex;
  opacity: 1;
}

.nav-mobile-overlay a {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--offwhite);
  transition: color var(--duration-fast);
}

.nav-mobile-overlay a:hover {
  color: var(--gold-primary);
}

/* --- Buttons --- */
.btn-m {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  font-weight: 600;
  font-size: var(--text-base);
  border-radius: var(--radius-full);
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn-m:active {
  transform: scale(0.97);
}

.btn-m:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
  color: var(--burgundy-deep);
  box-shadow: 0 4px 15px rgba(216, 177, 110, 0.3);
}

.btn-gold:hover {
  box-shadow: 0 6px 25px rgba(216, 177, 110, 0.45);
  transform: translateY(-2px);
}

.btn-outline {
  border: 1.5px solid rgba(216, 177, 110, 0.5);
  color: var(--gold-primary);
  background: transparent;
}

.btn-outline:hover {
  background: rgba(216, 177, 110, 0.1);
  border-color: var(--gold-primary);
}

.btn-white {
  background: var(--offwhite);
  color: var(--burgundy-deep);
}

.btn-white:hover {
  background: var(--ivory-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-whatsapp {
  background: #25D366;
  color: white;
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-lg);
}

.btn-whatsapp:hover {
  background: #20BD5A;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.3);
}

.btn-ghost {
  color: rgba(253, 251, 248, 0.8);
  padding: var(--space-2) var(--space-4);
}

.btn-ghost:hover {
  color: var(--gold-primary);
}

.btn-lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-lg);
}

.btn-sm {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
}

/* --- Hero Section --- */
.hero-m {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: var(--space-32) 0 var(--space-16);
}

.hero-m::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(179,50,99,.2), transparent 70%);
  border-radius: 50%;
  animation: float-slow 20s ease-in-out infinite;
}

.hero-m::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(216,177,110,.12), transparent 70%);
  border-radius: 50%;
  animation: float-slow 25s ease-in-out infinite reverse;
}

/* Two-column hero layout (text + image).
   RTL => text on the right (column 1), image on the left (column 2).
   Source order: text first, image second — gives correct placement. */
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-16);
  align-items: center;
  position: relative;
  z-index: 2;
  direction: rtl;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

/* Ensure side-by-side layout stays on tablet sizes */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  .hero-image {
    max-height: 400px;
  }
  .hero-image-wrap {
    min-height: 320px;
  }
}

.hero-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.hero-image {
  position: relative;
  z-index: 2;
  max-width: 100%;
  max-height: 520px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, .35));
  animation: float-slow 8s ease-in-out infinite;
}

.hero-image-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 90%;
  background: radial-gradient(circle, rgba(216, 177, 110, .35), transparent 65%);
  filter: blur(40px);
  z-index: 1;
}

.hero-image-placeholder {
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(216, 177, 110, .05);
  border: 1px dashed rgba(216, 177, 110, .25);
  border-radius: var(--radius-2xl);
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: rgba(216, 177, 110, 0.12);
  border: 1px solid rgba(216, 177, 110, 0.2);
  border-radius: var(--radius-full);
  color: var(--gold-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-8);
}

.hero-title {
  margin-bottom: var(--space-6);
}

.hero-title .highlight {
  color: var(--gold-primary);
  position: relative;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: rgba(253, 251, 248, 0.75);
  line-height: var(--line-relaxed);
  max-width: 600px;
  margin-bottom: var(--space-10);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Floating shapes for hero */
.hero-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
}

.hero-shape-1 {
  width: 300px;
  height: 300px;
  background: var(--rose-muted);
  top: 10%;
  left: 5%;
  animation: float-diagonal 18s ease-in-out infinite;
}

.hero-shape-2 {
  width: 200px;
  height: 200px;
  background: var(--gold-primary);
  top: 60%;
  right: 10%;
  animation: float-diagonal 22s ease-in-out infinite reverse;
}

.hero-shape-3 {
  width: 150px;
  height: 150px;
  background: var(--offwhite);
  bottom: 15%;
  left: 20%;
  animation: float-slow 15s ease-in-out infinite;
}

/* --- Section Styles --- */
.section-m {
  padding: var(--space-24) 0;
  position: relative;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--rose-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--rose-muted);
  border-radius: 1px;
}

.section-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: var(--line-tight);
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: var(--text-lg);
  color: var(--neutral-600);
  line-height: var(--line-relaxed);
  max-width: 600px;
}

/* --- Storytelling / Journey Section --- */
.journey-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.journey-visual {
  position: relative;
}

.journey-visual-inner {
  position: relative;
  background: linear-gradient(145deg, rgba(179,50,99,.1), rgba(216,177,110,.06));
  border-radius: var(--radius-2xl);
  padding: var(--space-12);
  border: 1px solid rgba(216, 177, 110, 0.15);
}

.journey-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--neutral-200);
}

.journey-step:last-child {
  border-bottom: none;
}

.journey-step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--burgundy-rich), var(--plum-dark));
  color: var(--gold-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  border-radius: var(--radius-full);
}

.journey-step-title {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.journey-step-desc {
  font-size: var(--text-sm);
  color: var(--neutral-500);
  line-height: var(--line-normal);
}

/* --- Problem Section --- */
.problem-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.problem-card {
  padding: var(--space-8);
  background: rgba(253, 251, 248, 0.03);
  border: 1px solid rgba(216, 177, 110, 0.1);
  border-radius: var(--radius-lg);
  transition: all var(--duration-normal) var(--ease-out);
}

.problem-card:hover {
  border-color: rgba(216, 177, 110, 0.25);
  background: rgba(253, 251, 248, 0.06);
  transform: translateY(-4px);
}

.problem-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(179, 50, 99, 0.15);
  border-radius: var(--radius-md);
  color: var(--rose-soft);
  font-size: var(--text-xl);
  margin-bottom: var(--space-5);
}

.problem-card h4 {
  color: var(--offwhite);
  margin-bottom: var(--space-3);
}

.problem-card p {
  color: rgba(253, 251, 248, 0.6);
  font-size: var(--text-sm);
  line-height: var(--line-relaxed);
}

/* --- CTA Section --- */
.cta-m {
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.cta-m .section-title {
  margin-bottom: var(--space-6);
}

.cta-m .section-desc {
  margin: 0 auto var(--space-10);
}

/* --- Test Intro Section --- */
.test-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.test-intro .section-desc {
  margin: 0 auto var(--space-10);
}

.test-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  max-width: 900px;
  margin: 0 auto;
}

.test-feature {
  text-align: center;
  padding: var(--space-6);
}

.test-feature-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(216,177,110,.15), rgba(216,177,110,.05));
  border: 1px solid rgba(216, 177, 110, 0.2);
  border-radius: var(--radius-lg);
  color: var(--gold-primary);
  font-size: var(--text-2xl);
  margin: 0 auto var(--space-4);
}

.test-feature h4 {
  margin-bottom: var(--space-2);
  font-size: var(--text-base);
}

.test-feature p {
  font-size: var(--text-sm);
  color: var(--neutral-500);
}

/* --- Footer --- */
.footer-m {
  background: var(--burgundy-deep);
  padding: var(--space-16) 0 var(--space-8);
  position: relative;
}

.footer-m::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(to left, transparent, rgba(216,177,110,.3), transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-16);
  margin-bottom: var(--space-12);
}

.footer-brand {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--offwhite);
  margin-bottom: var(--space-4);
}

.footer-brand span {
  color: var(--gold-primary);
}

.footer-desc {
  color: rgba(253, 251, 248, 0.5);
  font-size: var(--text-sm);
  line-height: var(--line-relaxed);
  max-width: 400px;
}

.footer-heading {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-6);
}

.footer-link {
  display: block;
  padding: var(--space-2) 0;
  color: rgba(253, 251, 248, 0.6);
  font-size: var(--text-sm);
  transition: color var(--duration-fast);
}

.footer-link:hover {
  color: var(--offwhite);
}

.footer-socials {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.footer-social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(216, 177, 110, 0.2);
  border-radius: var(--radius-full);
  color: var(--gold-primary);
  transition: all var(--duration-fast) var(--ease-out);
}

.footer-social-link:hover {
  background: rgba(216, 177, 110, 0.1);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
}

.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid rgba(253, 251, 248, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom-centered {
  flex-direction: column;
  gap: var(--space-3);
  text-align: center;
  padding-top: 0;
  padding-bottom: var(--space-4);
  border-top: none;
}

.footer-copyright {
  color: rgba(253, 251, 248, 0.4);
  font-size: var(--text-xs);
}

.footer-credit {
  color: rgba(253, 251, 248, 0.55);
  font-size: var(--text-sm);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.footer-credit i {
  color: rgba(253, 251, 248, 0.55);
}

/* Pre-footer section: distinct warm background that bridges content & footer */
.bg-pre-footer {
  background:
    radial-gradient(circle at 80% 80%, rgba(216, 177, 110, .14), transparent 55%),
    radial-gradient(circle at 15% 20%, rgba(179, 50, 99, .08), transparent 50%),
    linear-gradient(180deg, var(--ivory-warm) 0%, var(--ivory-light) 100%);
}

.bg-pre-footer .section-label {
  color: var(--rose-muted);
}

.bg-pre-footer .section-label::before {
  background: var(--rose-muted);
}

/* ============================================
   TEST / ASSESSMENT PAGES
   ============================================ */

/* --- Test Layout --- */
.test-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 12%, rgba(179,50,99,.16), transparent 18%),
    radial-gradient(circle at 88% 10%, rgba(216,177,110,.10), transparent 18%),
    linear-gradient(155deg, rgba(43,13,24,.82), rgba(60,17,32,.70));
  background-color: var(--burgundy-deep);
}

.test-container {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + var(--space-8)) var(--space-6) var(--space-8);
}

/* --- Test Intro (before questions) --- */
.test-intro-card {
  text-align: center;
  padding: var(--space-12);
}

.test-intro-card h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--offwhite);
  margin-bottom: var(--space-4);
}

.test-intro-card p {
  color: rgba(253, 251, 248, 0.7);
  margin-bottom: var(--space-8);
  line-height: var(--line-relaxed);
}

/* Pre-fill box — pulls name & phone from registration form, user can edit */
.prefill-box {
  text-align: right;
  background: rgba(216, 177, 110, 0.06);
  border: 1px solid rgba(216, 177, 110, 0.18);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin: 0 auto var(--space-8);
  max-width: 560px;
}

.prefill-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--gold-primary);
  font-weight: 600;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px dashed rgba(216, 177, 110, 0.2);
}

.prefill-header span {
  color: rgba(253, 251, 248, 0.7);
  font-weight: 500;
}

.prefill-box .form-group {
  margin-bottom: var(--space-4);
}

.prefill-box .form-input {
  background: rgba(253, 251, 248, 0.06);
}

/* --- Answer Scale Legend --- */
.scale-legend {
  background: rgba(253, 251, 248, 0.04);
  border: 1px solid rgba(216, 177, 110, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-10);
}

.scale-legend h3 {
  color: var(--gold-primary);
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.scale-legend p {
  color: rgba(253, 251, 248, 0.65);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}

.scale-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.scale-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
}

.scale-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(216, 177, 110, 0.12);
  border: 1px solid rgba(216, 177, 110, 0.2);
  border-radius: var(--radius-full);
  color: var(--gold-primary);
  font-size: var(--text-sm);
  font-weight: 700;
}

.scale-text {
  color: rgba(253, 251, 248, 0.75);
  font-size: var(--text-sm);
}

/* --- Question Card --- */
.question-card {
  animation: fadeInUp var(--duration-slow) var(--ease-out);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-8);
}

.question-progress-text {
  color: rgba(253, 251, 248, 0.5);
  font-size: var(--text-sm);
}

.question-progress-text strong {
  color: var(--gold-primary);
}

.question-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(253, 251, 248, 0.08);
  border-radius: 2px;
  margin-bottom: var(--space-10);
  overflow: hidden;
}

.question-progress-fill {
  height: 100%;
  background: linear-gradient(to left, var(--gold-primary), var(--rose-muted));
  border-radius: 2px;
  transition: width var(--duration-slow) var(--ease-out);
}

.question-text {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--offwhite);
  line-height: var(--line-relaxed);
  margin-bottom: var(--space-10);
  text-align: center;
  text-wrap: balance;
}

/* --- Interactive Answer Options --- */
.answer-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.answer-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: rgba(253, 251, 248, 0.03);
  border: 1.5px solid rgba(253, 251, 248, 0.08);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}

.answer-option:hover {
  background: rgba(253, 251, 248, 0.06);
  border-color: rgba(216, 177, 110, 0.25);
  transform: translateX(-4px);
}

.answer-option.selected {
  background: rgba(216, 177, 110, 0.08);
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 1px rgba(216, 177, 110, 0.2), var(--shadow-md);
}

.answer-option input[type="radio"] {
  display: none;
}

.answer-option-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(253, 251, 248, 0.05);
  border: 1.5px solid rgba(253, 251, 248, 0.12);
  border-radius: var(--radius-full);
  color: rgba(253, 251, 248, 0.6);
  font-size: var(--text-base);
  font-weight: 700;
  transition: all var(--duration-fast) var(--ease-out);
}

.answer-option.selected .answer-option-number {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
  border-color: var(--gold-primary);
  color: var(--burgundy-deep);
}

.answer-option-label {
  font-size: var(--text-sm);
  color: rgba(253, 251, 248, 0.65);
  transition: color var(--duration-fast);
}

.answer-option.selected .answer-option-label {
  color: var(--offwhite);
}

/* --- Question Navigation --- */
.question-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-10);
  gap: var(--space-4);
}

/* --- Validation Message --- */
.validation-msg {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: rgba(192, 57, 43, 0.12);
  border: 1px solid rgba(192, 57, 43, 0.25);
  border-radius: var(--radius-md);
  color: #F1948A;
  font-size: var(--text-sm);
  margin-top: var(--space-6);
  animation: fadeInUp var(--duration-fast) var(--ease-out);
}

.validation-msg.visible {
  display: flex;
}

/* ============================================
   RESULT PAGE
   ============================================ */

.result-container {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + var(--space-12)) var(--space-6) var(--space-12);
  text-align: center;
}

.result-card {
  padding: var(--space-12);
  background: rgba(253, 251, 248, 0.03);
  border: 1px solid rgba(216, 177, 110, 0.12);
  border-radius: var(--radius-2xl);
  animation: resultReveal 0.8s var(--ease-out);
}

.result-label {
  font-size: var(--text-lg);
  color: rgba(253, 251, 248, 0.6);
  margin-bottom: var(--space-6);
}

.result-codes {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.result-code {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(216,177,110,.15), rgba(216,177,110,.05));
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-xl);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--gold-primary);
  animation: codeReveal 0.6s var(--ease-out) both;
}

.result-code:nth-child(2) { animation-delay: 0.15s; }
.result-code:nth-child(3) { animation-delay: 0.3s; }

.result-separator {
  font-size: var(--text-2xl);
  color: rgba(216, 177, 110, 0.4);
  font-weight: 300;
}

.result-note {
  color: rgba(253, 251, 248, 0.6);
  font-size: var(--text-sm);
  line-height: var(--line-relaxed);
  margin-bottom: var(--space-8);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.result-screenshot-area {
  padding: var(--space-8);
  background: rgba(253, 251, 248, 0.02);
  border: 1px dashed rgba(216, 177, 110, 0.2);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-8);
}

.result-cta-section {
  padding-top: var(--space-8);
  border-top: 1px solid rgba(253, 251, 248, 0.06);
}

.result-cta-section h3 {
  color: var(--offwhite);
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.result-cta-section p {
  color: rgba(253, 251, 248, 0.6);
  font-size: var(--text-sm);
  line-height: var(--line-relaxed);
  margin-bottom: var(--space-6);
}

/* ============================================
   REGISTRATION PAGE
   ============================================ */

.reg-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Reserve space for the fixed navbar so the form never overlaps it */
  padding: calc(var(--nav-height) + var(--space-12)) var(--space-6) var(--space-12);
}

.reg-card {
  width: 100%;
  max-width: 560px;
  padding: var(--space-12);
  background: rgba(253, 251, 248, 0.03);
  border: 1px solid rgba(216, 177, 110, 0.12);
  border-radius: var(--radius-2xl);
}

.reg-card h1 {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--offwhite);
  margin-bottom: var(--space-2);
}

.reg-card .reg-subtitle {
  color: rgba(253, 251, 248, 0.6);
  font-size: var(--text-sm);
  margin-bottom: var(--space-10);
}

.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  color: rgba(253, 251, 248, 0.8);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-5);
  background: rgba(253, 251, 248, 0.04);
  border: 1.5px solid rgba(253, 251, 248, 0.1);
  border-radius: var(--radius-md);
  color: var(--offwhite);
  font-size: var(--text-base);
  transition: all var(--duration-fast) var(--ease-out);
  outline: none;
}

.form-input::placeholder {
  color: rgba(253, 251, 248, 0.3);
}

.form-input:focus {
  border-color: var(--gold-primary);
  background: rgba(253, 251, 248, 0.06);
  box-shadow: 0 0 0 3px rgba(216, 177, 110, 0.1);
}

.form-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.form-error {
  color: #F1948A;
  font-size: var(--text-xs);
  margin-top: var(--space-1);
  display: none;
}

.form-error.visible {
  display: block;
}

/* Choice Cards for "هل أنت؟" */
.choice-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.choice-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: rgba(253, 251, 248, 0.03);
  border: 1.5px solid rgba(253, 251, 248, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.choice-card:hover {
  background: rgba(253, 251, 248, 0.06);
  border-color: rgba(216, 177, 110, 0.2);
}

.choice-card.selected {
  background: rgba(216, 177, 110, 0.08);
  border-color: var(--gold-primary);
}

.choice-card input[type="radio"] {
  display: none;
}

.choice-card-indicator {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(253, 251, 248, 0.2);
  border-radius: var(--radius-full);
  transition: all var(--duration-fast);
  position: relative;
}

.choice-card.selected .choice-card-indicator {
  border-color: var(--gold-primary);
  background: var(--gold-primary);
}

.choice-card.selected .choice-card-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--burgundy-deep);
  border-radius: 50%;
}

.choice-card-text {
  color: rgba(253, 251, 248, 0.8);
  font-size: var(--text-sm);
  font-weight: 500;
}

/* --- Success Page --- */
.success-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Reserve space for the fixed navbar so the success card never overlaps it */
  padding: calc(var(--nav-height) + var(--space-12)) var(--space-6) var(--space-12);
  text-align: center;
}

.success-content {
  max-width: 500px;
  animation: fadeInUp var(--duration-slow) var(--ease-out);
}

.success-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 138, 86, 0.12);
  border: 2px solid rgba(45, 138, 86, 0.3);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-8);
  font-size: var(--text-4xl);
  animation: successPulse 2s ease-in-out infinite;
}

.success-content h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--offwhite);
  margin-bottom: var(--space-4);
}

.success-content p {
  color: rgba(253, 251, 248, 0.7);
  line-height: var(--line-relaxed);
  margin-bottom: var(--space-3);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes float-slow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -20px); }
}

@keyframes float-diagonal {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(15px, -25px); }
  50% { transform: translate(-10px, -15px); }
  75% { transform: translate(20px, -5px); }
}

@keyframes resultReveal {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes codeReveal {
  from {
    opacity: 0;
    transform: scale(0.5) rotateY(90deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
  }
}

@keyframes successPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 138, 86, 0.3); }
  50% { box-shadow: 0 0 0 15px rgba(45, 138, 86, 0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  html { scroll-behavior: auto; }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .journey-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .problem-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .test-features {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }

  .heading-1 { font-size: var(--text-4xl); }
  .heading-2 { font-size: var(--text-3xl); }
  .heading-3 { font-size: var(--text-xl); }
  .section-title { font-size: var(--text-2xl); }
  .section-m { padding: var(--space-16) 0; }

  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .hero-m {
    min-height: auto;
    padding: calc(var(--nav-height) + var(--space-16)) 0 var(--space-12);
  }

  .hero-subtitle { font-size: var(--text-base); }

  .problem-cards {
    grid-template-columns: 1fr;
  }

  .test-features {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .test-feature {
    display: flex;
  text-align: right;
  gap: var(--space-4);
  }

  .test-feature-icon {
  margin: 0;
    flex-shrink: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .result-code {
    width: 60px;
    height: 60px;
    font-size: var(--text-3xl);
  }

  .answer-option {
  padding: var(--space-3) var(--space-4);
    min-height: 52px;
  }

  .answer-option-number {
    width: 32px;
    height: 32px;
    font-size: var(--text-sm);
  }
}

/* Small Mobile */
@media (max-width: 400px) {
  .heading-1 { font-size: var(--text-3xl); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn-m { width: 100%; justify-content: center; }
  .result-codes { gap: var(--space-2); }
  .result-code { width: 52px; height: 52px; font-size: var(--text-2xl); }
  .reg-card { padding: var(--space-8); }
}

/* ============================================
   RESPONSIVE ENHANCEMENTS — wider forms & cards on mobile
   ============================================ */

/* Tablet hero: stack columns & show image first ONLY on mobile-sized screens */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
    text-align: center;
  }
  .hero-content {
    max-width: 100%;
    margin: 0 auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-image-wrap {
    order: -1;
    min-height: 280px;
  }
  .hero-image {
    max-height: 360px;
  }
}

/* Mobile: comfortable wide cards & forms */
@media (max-width: 768px) {
  /* Smaller logo on mobile to keep nav compact */
  .nav-logo-img {
    height: 38px;
    max-width: 130px;
  }

  /* Hide nav-extra (e.g. test progress) on very small screens
     to prevent nav cramping; the test card already shows progress */
  .nav-extra {
    display: none;
  }

  /* Wider, more comfortable cards & forms on mobile */
  .reg-card {
    max-width: 100%;
    padding: var(--space-10);
  }

  .reg-page {
    padding: calc(var(--nav-height) + var(--space-10)) var(--space-4) var(--space-10);
  }

  .success-page {
    padding: calc(var(--nav-height) + var(--space-10)) var(--space-4) var(--space-10);
  }

  .test-container {
    max-width: 100%;
    padding: calc(var(--nav-height) + var(--space-6)) var(--space-3) var(--space-8);
  }

  .result-container {
    max-width: 100%;
    padding: calc(var(--nav-height) + var(--space-10)) var(--space-4) var(--space-10);
  }

  .choice-card {
    padding: var(--space-4) var(--space-5);
  }

  .answer-option {
    padding: var(--space-4) var(--space-5) !important;
    min-height: 58px !important;
  }

  .answer-option-number {
    width: 36px;
    height: 36px;
    font-size: var(--text-base);
  }

  .answer-option-label {
    font-size: var(--text-base);
  }

  .form-input {
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-base);
  }

  .question-text {
    font-size: var(--text-lg);
    margin-bottom: var(--space-8);
  }
}

@media (max-width: 400px) {
  .nav-logo-img { height: 34px; max-width: 115px; }
  .reg-card { max-width: 100%; }
}

/* Focus styles for accessibility */
*:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 2px;
}
