/* ==========================================================================
   header.css — Slim fixed top bar + slide-down glass nav panel
   ========================================================================== */

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --sh-h:           84px;                        /* top bar height */
  --sh-bg:          #0F172A;                     /* bar background */
  --sh-border:      rgba(255, 255, 255, 0.08);   /* bar bottom border */
  --sh-text:        rgba(241, 245, 249, 0.90);   /* default text */
  --sh-muted:       rgba(148, 163, 184, 0.80);   /* phone / secondary */
  --sh-accent:      #f59e0b;                     /* orange CTA */
  --sh-zindex:      1000;

  --np-bg:          rgba(10, 20, 40, 0.45);      /* glass panel bg */
  --np-blur:        16px;                        /* backdrop blur */
  --np-border:      rgba(255, 255, 255, 0.10);   /* panel bottom border */
  --np-zindex:      999;

  --ns-bg:          rgba(8, 20, 44, 0.98);       /* submenu bg */
  --ns-border:      rgba(255, 255, 255, 0.12);
  --ns-radius:      14px;

  --nb-zindex:      998;                         /* backdrop z-index */

  --t-spring:       0.28s cubic-bezier(0.22, 1, 0.36, 1);
  --t-ease:         0.22s ease;
}

/* ── Body offset so content isn't hidden under fixed bar ─────────────────── */
body { padding-top: var(--sh-h); }

/* ── Scroll lock when panel is open ──────────────────────────────────────── */
body.menu-open { overflow: hidden; }

/* ── Hero sections: compensate bar height ────────────────────────────────── */
.dh-hero,
.pl-hero,
.video-hero {
  min-height: calc(100vh - var(--sh-h));
}

/* ══════════════════════════════════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════════════════════════════════ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--sh-h);
  z-index: var(--sh-zindex);
  background: var(--sh-bg);
  display: flex;
  align-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sh-border);
  overflow: visible !important;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 22px;
  position: relative;
}

/* Right column (RTL start): utilities — phone + portal */
.site-header__utils {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  margin-inline-end: 8px;
}

/* Logo — straddles the bottom edge of the header bar.
   These properties can be overridden at runtime via CSS custom properties
   that are injected by `apps.core.context_processors.global_settings` from
   the HeaderLayoutSettings model. Defaults preserve the historical look. */
.site-header__brand {
  position: absolute;
  bottom: var(--logo-bottom, 0);
  top: var(--logo-top, auto);
  left: var(--logo-left, 20px);
  right: var(--logo-right, auto);
  transform: translateY(var(--logo-offset-y, 50%)) translateX(var(--logo-center-x, 0));
  z-index: 100;
  background: var(--logo-bg, transparent);
  border-radius: var(--logo-bg-radius, 0);
  padding: var(--logo-bg-padding, 0);
}

.site-header__desktop-nav {
  display: none;
  flex: 1;
  padding-left: var(--nav-left-padding, 110px);
  margin-inline: 18px 10px;
  min-width: 0;
  align-self: stretch;
}

.site-header__brand-text {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

/* Logo image — fixed square so circle is symmetric */
.site-header__logo-img {
  height: var(--logo-size-desktop, 120px);
  width: var(--logo-size-desktop, 120px);
  max-width: none !important;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
  filter: var(--logo-drop-shadow, drop-shadow(0 3px 10px rgba(0, 0, 0, 0.40)));
}

.site-header__brand:hover .site-header__logo-img {
  transform: scale(1.04);
}

/* Always render logo with its original colors (orange/navy). */
.site-logo {
  filter: none !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  -webkit-filter: none !important;
}

/* Placement landing pages: improve logo contrast on dark hero backgrounds */
.site-header--exam-logo-contrast {
  background: #0F172A !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header--exam-logo-contrast .exam-logo-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  padding: 6px 16px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.site-header--exam-logo-contrast .exam-logo {
  /* Same size as all other site pages (HeaderLayoutSettings vars) */
  height: var(--logo-size-desktop, 120px);
  width: var(--logo-size-desktop, 120px);
  max-height: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4)) !important;
  -webkit-filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4)) !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
}

/* Left column (RTL end): toggle */
.site-header__toggle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end; /* RTL: visual left */
}

/* ── Phone link ─────────────────────────────────────────────────────────── */
.site-header__phone {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--sh-muted);
  font-size: 0.76rem;
  text-decoration: none;
  direction: ltr;
  white-space: nowrap;
  transition: color var(--t-ease);
}

.site-header__phone:hover { color: var(--sh-text); }

.site-header__learn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid rgba(251, 146, 60, 0.9);
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 8px 18px -12px rgba(249, 115, 22, 0.7);
  transition: transform var(--t-ease), filter var(--t-ease), box-shadow var(--t-ease);
}

.site-header__learn-btn:hover {
  color: #fff;
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.site-header__learn-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px -16px rgba(249, 115, 22, 0.8);
}

/* ── Portal button ───────────────────────────────────────────────────── */
.site-header__portal {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 4px;
  padding: 5px 10px;
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  color: rgba(241, 245, 249, 0.82);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.22s ease, border-color 0.22s ease,
              color 0.22s ease, transform 0.22s ease;
}

.site-header__portal:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.75);
  color: #ffffff;
  transform: translateY(-1px);
}

.site-header__portal:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(255, 122, 0, 0.30);
}

.site-header__auth-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: 4px;
}

.site-header__auth-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 5px 11px;
  font-family: Vazirmatn, IRANSans, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.20s ease, background 0.20s ease,
              border-color 0.20s ease, color 0.20s ease, box-shadow 0.20s ease;
}

/* ── خروج (logout ghost) ──────────────────────────────────────────────────── */
.site-header__auth-pill--ghost {
  color: rgba(241, 245, 249, 0.85);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.22);
}
.site-header__auth-pill--ghost:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

/* ── ورود ─────────────────────────────────────────────────────────────────── */
.site-header__auth-pill--login {
  color: rgba(241, 245, 249, 0.95);
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.45);
}
.site-header__auth-pill--login:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.70);
  transform: translateY(-1px);
}

/* ── عضویت ───────────────────────────────────────────────────────────────── */
.site-header__auth-pill--membership {
  color: #0f172a;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-color: rgba(255, 255, 255, 0.70);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}
.site-header__auth-pill--membership:hover {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border-color: #fff;
  color: #0f172a;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

/* ── solid variant (kept for any other usage) ─────────────────────────────── */
.site-header__auth-pill--solid {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  color: #fff;
  box-shadow: 0 4px 18px -8px rgba(249, 115, 22, 0.7);
}
.site-header__auth-pill--solid:hover {
  border-color: #fb923c;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px -10px rgba(249, 115, 22, 0.85);
}

/* ══════════════════════════════════════════════════════════════════════════
   Desktop Mega Menu
   ══════════════════════════════════════════════════════════════════════════ */

.mega-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
}

.mega-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.mega-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(241, 245, 249, 0.93);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--t-ease), background-color var(--t-ease);
}

.mega-nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
}

.mega-nav-link__caret {
  display: inline-flex;
  opacity: 0.72;
  transition: transform var(--t-ease);
}

.mega-nav-item.has-mega:hover > .mega-nav-link .mega-nav-link__caret,
.mega-nav-item.has-mega:focus-within > .mega-nav-link .mega-nav-link__caret {
  transform: rotate(180deg);
}

.mega-menu-panel {
  position: fixed;
  inset-inline: 0;
  top: var(--sh-h);
  z-index: 1202;
  padding: 10px 18px 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.mega-nav-item.has-mega:hover > .mega-menu-panel,
.mega-nav-item.has-mega:focus-within > .mega-menu-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0s;
}

.mega-menu-panel__inner {
  max-width: 1240px;
  margin: 0 auto;
  background: rgba(8, 10, 22, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  box-shadow: 0 28px 60px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255,255,255,0.04) inset;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  padding: 22px 24px;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.mega-menu-grid.has-feature {
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(220px, 260px);
}

.mega-menu-column {
  min-width: 0;
}

.mega-menu-column__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
}

.mega-menu-column__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(165, 180, 252, 0.3);
  font-size: 0.9rem;
}

.mega-menu-column__head h4 {
  margin: 0;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.mega-menu-column__head p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.73rem;
}

.mega-menu-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.mega-menu-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: 10px;
  padding: 8px 9px;
  text-decoration: none;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color var(--t-ease), background-color var(--t-ease), transform var(--t-ease);
}

.mega-menu-link:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.mega-menu-link__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
}

.mega-menu-link__icon--dot {
  position: relative;
}

.mega-menu-link__icon--dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #a5b4fc);
  transition: transform 0.18s ease, background 0.18s ease;
  display: block;
}

.mega-menu-link:hover .mega-menu-link__icon--dot::before {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  transform: scale(1.4);
}

.mega-menu-link__content {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.mega-menu-link__title {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  font-weight: 600;
}

.mega-menu-link:hover .mega-menu-link__title {
  color: #ffffff;
}

.mega-menu-link__desc {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 7px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 999px;
  color: rgba(199, 210, 254, 0.9);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.6;
  white-space: nowrap;
}

.mega-menu-link__badge {
  align-self: center;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  padding: 2px 7px;
  font-size: 0.67rem;
  font-weight: 700;
  white-space: nowrap;
}

.mega-menu-feature {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.mega-menu-feature h4 {
  margin: 0;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
}

.mega-menu-feature p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  line-height: 1.7;
}

.mega-menu-feature__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 10px;
  text-decoration: none;
  background: #0f172a;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  transition: background-color var(--t-ease), transform var(--t-ease);
}

.mega-menu-feature__cta:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════════════════
   Membership Modal
   ══════════════════════════════════════════════════════════════════════════ */

body.membership-modal-open {
  overflow: hidden;
}

.membership-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1120;
  background: rgba(15, 23, 42, 0.56);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}

.membership-modal {
  position: fixed;
  inset: 0;
  z-index: 1125;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}

body.membership-modal-open .membership-modal,
body.membership-modal-open .membership-modal-backdrop {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.22s ease, visibility 0s linear 0s;
}

.membership-modal__dialog {
  position: relative;
  width: min(720px, calc(100vw - 32px));
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 28px 70px -38px rgba(15, 23, 42, 0.42);
  padding: 28px 26px 22px;
  transform: translateY(10px) scale(0.985);
  transition: transform 0.24s ease;
}

body.membership-modal-open .membership-modal__dialog {
  transform: translateY(0) scale(1);
}

.membership-modal__close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #334155;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--t-ease), background-color var(--t-ease);
}

.membership-modal__close:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.membership-modal__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #dbe3ef;
  color: #0f172a;
  background: #f8fafc;
  padding: 5px 11px;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.membership-modal__head {
  margin-top: 12px;
}

.membership-modal__head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 800;
}

.membership-modal__head p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.9;
}

.membership-modal__form {
  margin-top: 20px;
}

.membership-modal__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.membership-modal__field {
  display: grid;
  gap: 7px;
}

.membership-modal__field--full {
  grid-column: 1 / -1;
}

.membership-modal__field label {
  color: #1e293b;
  font-size: 0.84rem;
  font-weight: 700;
}

.membership-modal__field input,
.membership-modal__field select {
  width: 100%;
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid #d8e0eb;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.92rem;
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--t-ease), box-shadow var(--t-ease), background-color var(--t-ease);
}

.membership-modal__field input::placeholder {
  color: #94a3b8;
}

.membership-modal__field input:focus,
.membership-modal__field select:focus {
  border-color: #fb923c;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.17);
}

.membership-modal__select-wrap {
  position: relative;
}

.membership-modal__select-wrap::after {
  content: "";
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-left: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: translateY(-65%) rotate(-45deg);
  pointer-events: none;
}

.membership-modal__field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-inline-end: 14px;
  padding-inline-start: 34px;
  cursor: pointer;
}

.membership-modal__submit {
  margin-top: 16px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 13px;
  background: #ff7a00;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color var(--t-ease), transform var(--t-ease), box-shadow var(--t-ease);
  box-shadow: 0 16px 28px -18px rgba(255, 122, 0, 0.72);
}

.membership-modal__submit:hover {
  background: #f97316;
  transform: translateY(-1px);
}

.membership-modal__submit:active {
  transform: translateY(0);
}

.membership-modal__note {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 0.79rem;
  line-height: 1.8;
}

.membership-modal__success {
  margin: 8px 0 0;
  color: #15803d;
  font-size: 0.79rem;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════════════════
   Header Auth Modal
   ══════════════════════════════════════════════════════════════════════════ */

body.auth-modal-open {
  overflow: hidden;
}

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1105;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

body.auth-modal-open .auth-modal,
body.auth-modal-open .auth-modal-backdrop {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0s linear 0s;
}

.auth-modal__dialog {
  position: relative;
  width: min(460px, 95vw);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 24px 80px -36px rgba(15, 23, 42, 0.78);
  padding: 22px 22px 18px;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.22s ease;
}

.auth-modal__dialog--dual {
  width: min(720px, 94vw);
  padding: 1.75rem 1.6rem 1.5rem;
  border: 1px solid #e8eef5;
  border-radius: 22px;
  box-shadow: 0 22px 56px -28px rgba(15, 23, 42, 0.42);
  background: #fff;
}

body.auth-modal-open .auth-modal__dialog {
  transform: translateY(0) scale(1);
}

.auth-modal__close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.auth-modal__close:hover {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.auth-modal__close:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}

.auth-modal__dialog--dual .auth-modal__head {
  text-align: center;
  padding-inline: 2.5rem;
  margin-bottom: 0.25rem;
}

.auth-modal__head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.4vw, 1.4rem);
  color: #0f172a;
  font-weight: 800;
}

.auth-modal__head p {
  margin: 0.45rem 0 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.6;
}

.auth-chooser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.35rem;
  align-items: stretch;
}

.auth-chooser__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  width: 100%;
  min-height: 220px;
  text-align: center;
  padding: 1.35rem 1.15rem 1.2rem;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fafbfc;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-chooser__card:hover {
  border-color: #fdba74;
  background: #fffaf5;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -22px rgba(249, 115, 22, 0.55);
}

.auth-chooser__card:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}

.auth-chooser__icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff7ed;
  color: #ea580c;
  flex: 0 0 auto;
}

.auth-chooser__icon--staff {
  background: #f1f5f9;
  color: #334155;
}

.auth-chooser__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1 1 auto;
  width: 100%;
}

.auth-chooser__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.4;
}

.auth-chooser__desc {
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.65;
  max-width: 22ch;
  margin-inline: auto;
}

.auth-chooser__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  pointer-events: none;
}

.auth-chooser__card--staff .auth-chooser__cta {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

.auth-chooser__card:hover .auth-chooser__cta {
  filter: brightness(1.04);
}

@media (max-width: 640px) {
  .auth-modal__dialog--dual {
    width: min(100%, 94vw);
    padding: 1.35rem 1rem 1.15rem;
    border-radius: 18px;
  }

  .auth-chooser {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .auth-chooser__card {
    min-height: 0;
    padding: 1.15rem 1rem 1.05rem;
  }

  .auth-chooser__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .auth-modal__close {
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
  }
}

.auth-modal__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.75rem 0 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-modal__back:hover {
  color: #ea580c;
}

.auth-modal__otp-hint {
  margin: 0 0 0.35rem;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.6;
}

.auth-modal__otp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.auth-modal__link-btn {
  border: 0;
  background: transparent;
  color: #ea580c;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.auth-modal__link-btn:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.auth-modal__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin: 0.15rem 0 0.35rem;
}

.auth-modal__remember {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-modal__remember input {
  width: 16px;
  height: 16px;
  accent-color: #f97316;
}

.auth-modal__forgot {
  color: #ea580c;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-modal__forgot:hover {
  text-decoration: underline;
}

.auth-modal__tabs {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-modal__tab {
  border: 1px solid #d6dfeb;
  background: #ffffff;
  color: #334155;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}

.auth-modal__tab.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.auth-modal__flash {
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #991b1b;
  padding: 9px 10px;
  font-size: 0.82rem;
}

.auth-modal__panel {
  margin-top: 14px;
}

.auth-modal__form {
  display: grid;
  gap: 8px;
}

.auth-modal__form label {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-modal__form input {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  outline: none;
}

.auth-modal__form input:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-modal__form input.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.auth-modal__field-error {
  min-height: 16px;
  color: #b91c1c;
  font-size: 0.74rem;
}

.auth-modal__submit {
  margin-top: 2px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  padding: 12px;
  min-height: 46px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
}

.auth-modal__submit:hover {
  filter: brightness(1.03);
}

.auth-modal__dialog--dual .auth-modal__form input {
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 0 12px;
}

.auth-modal__dialog--dual .auth-modal__form input:focus {
  border-color: #fdba74;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}

.auth-modal__divider {
  margin: 10px 0;
  text-align: center;
  position: relative;
}

.auth-modal__divider span {
  background: #f8fafc;
  color: #64748b;
  padding: 0 8px;
  font-size: 0.78rem;
  position: relative;
  z-index: 1;
}

.auth-modal__divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid #e2e8f0;
}

.auth-modal__socials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-modal__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d6dfeb;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  padding: 10px 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.auth-modal__social--google:hover {
  border-color: #60a5fa;
  background: #eff6ff;
}

.auth-modal__social--apple:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

/* ── Hamburger toggle button ────────────────────────────────────────────── */
.nav-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: var(--sh-text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-ease), border-color var(--t-ease);
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
}

.nav-toggle__label { user-select: none; }

/* Hamburger icon — 3 lines → X */
.nav-toggle__ham {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 16px;
  flex-shrink: 0;
}

.nav-toggle__ham span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transform-origin: center;
  transition: transform var(--t-ease), opacity var(--t-ease);
}

/* Animate to X when panel is open */
body.menu-open .nav-toggle .nav-toggle__ham span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
body.menu-open .nav-toggle .nav-toggle__ham span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
body.menu-open .nav-toggle .nav-toggle__ham span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ══════════════════════════════════════════════════════════════════════════
   NAV PANEL — slides down from below the top bar
   ══════════════════════════════════════════════════════════════════════════ */

.nav-panel {
  position: fixed;
  top: var(--sh-h);
  left: 0;
  right: 0;
  max-height: calc(100vh - var(--sh-h));
  overflow-y: auto;
  z-index: var(--np-zindex);
  background: var(--np-bg);
  backdrop-filter: blur(var(--np-blur));
  -webkit-backdrop-filter: blur(var(--np-blur));
  border-bottom: 1px solid var(--np-border);
  padding: 12px 0 20px;

  /* Closed state */
  transform: translateY(-16px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0s linear 0.2s;
}

body.menu-open .nav-panel {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0s linear 0s;
}

.nav-panel__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Nav list ────────────────────────────────────────────────────────────── */

.nav-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Top-level nav item ─────────────────────────────────────────────────── */

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  color: var(--sh-text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 10px;
  white-space: nowrap;
  transition: background var(--t-ease), color var(--t-ease);
}

.nav-link:hover,
.nav-item--has-children:hover > .nav-link,
.nav-item--sub-open > .nav-link {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.nav-link__icon {
  font-size: 1rem;
  line-height: 1;
}

.nav-link__caret {
  display: inline-flex;
  align-items: center;
  opacity: 0.65;
  transition: transform var(--t-ease);
}

.nav-item--sub-open > .nav-link .nav-link__caret,
.nav-item--has-children:hover > .nav-link .nav-link__caret {
  transform: rotate(180deg);
}

/* ══════════════════════════════════════════════════════════════════════════
   SUBMENU — desktop: absolute dropdown on hover
              mobile:  accordion on click
   ══════════════════════════════════════════════════════════════════════════ */

.nav-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Desktop submenu ───────────────────────────────────────────────────── */
@media (min-width: 641px) {
  .nav-submenu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0; /* RTL: open to the left of the parent item */
    min-width: 190px;
    background: var(--ns-bg);
    border: 1px solid var(--ns-border);
    border-radius: var(--ns-radius);
    padding: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
    transition:
      opacity 0.18s ease,
      transform 0.18s ease,
      visibility 0s linear 0.18s;
    z-index: 10;
  }

  /* Show on hover or JS-added class */
  .nav-item--has-children:hover > .nav-submenu,
  .nav-item--sub-open > .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition:
      opacity 0.18s ease,
      transform 0.18s ease,
      visibility 0s linear 0s;
  }
}

/* ── Mobile submenu (accordion) ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-submenu {
    overflow: hidden;
    max-height: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0 6px;
    margin-top: 2px;
    transition: max-height 0.3s ease, padding 0.25s ease;
  }

  .nav-item--sub-open > .nav-submenu {
    max-height: 1200px;
    padding: 6px 6px;
  }

  /* Caret rotates on open */
  .nav-link__caret {
    transition: transform 0.22s ease;
  }
  .nav-item--sub-open > .nav-link .nav-link__caret {
    transform: rotate(180deg);
  }
}

/* ── Submenu link ───────────────────────────────────────────────────────── */

.nav-sub-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  color: rgba(241, 245, 249, 0.82);
  font-size: 0.88rem;
  text-decoration: none;
  border-radius: 8px;
  transition: background var(--t-ease), color var(--t-ease);
  white-space: nowrap;
}

.nav-sub-link:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.nav-sub-badge {
  display: inline-block;
  padding: 1px 7px;
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  font-size: 0.72rem;
  border-radius: 999px;
  margin-inline-start: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════
   BACKDROP
   ══════════════════════════════════════════════════════════════════════════ */

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--nb-zindex);
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0s linear 0.2s;
}

body.menu-open .nav-backdrop {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition:
    opacity 0.2s ease,
    visibility 0s linear 0s;
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — mobile adjustments
   ══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 1025px) {
  .site-header__desktop-nav {
    display: flex;
    align-items: stretch;
  }
  .site-header__toggle { display: none; }
  .nav-panel,
  .nav-backdrop { display: none !important; }
  body.menu-open { overflow: auto; }
}

@media (max-width: 1260px) {
  .mega-menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .mega-menu-grid.has-feature {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(210px, 240px);
  }
}

@media (max-width: 1140px) {
  .mega-menu-panel__inner {
    padding: 18px 18px;
  }
  .mega-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .mega-menu-grid.has-feature {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mega-menu-feature {
    grid-column: 1 / -1;
  }
}

/* Tablet / narrow desktop: compact further */
@media (max-width: 1100px) {
  .site-header__phone span { display: none; }
  .site-header__learn-btn { font-size: 0.72rem; padding: 6px 10px; }
  .site-header__auth-pill { font-size: 0.72rem; padding: 6px 10px; }
  .site-header__portal { font-size: 0.72rem; padding: 6px 10px; }
  .site-header__utils { gap: 8px; }
  .site-header__auth-actions { gap: 6px; }
  .site-header__inner { gap: 18px; }
  .mega-nav-list { gap: 8px; }
  .mega-nav-link { font-size: 0.8rem; padding: 8px 10px; }
}

/* Below 860px: hide portal button to save space */
@media (max-width: 860px) {
  .site-header__portal--learner { display: none; }
}

@media (max-width: 768px) {
  :root { --sh-h: 64px; }
  .site-header__desktop-nav { display: none; }
  .site-header__toggle { display: flex; }
  /* Keep logo in document flow on mobile so header stays one aligned row.
     Absolute desktop logo positioning is restored above 768 via base rules. */
  .site-header__brand {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
  }
  .site-header__logo-img,
  .site-header--exam-logo-contrast .exam-logo {
    height: var(--logo-size-mobile, 44px);
    width: var(--logo-size-mobile, 44px);
    max-width: none !important;
    max-height: none;
  }
  .site-header__inner {
    padding: 0 12px;
    gap: 8px;
  }
  .site-header--exam-logo-contrast .exam-logo-wrapper { padding: 2px 6px; }
  .membership-modal__dialog {
    width: min(96vw, 560px);
    padding: 22px 16px 18px;
    border-radius: 18px;
  }
  .membership-modal__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .membership-modal__field--full {
    grid-column: auto;
  }
  .membership-modal__field input,
  .membership-modal__field select {
    font-size: 16px;
  }
}

/* Mobile: stack nav list vertically */
@media (max-width: 640px) {
  .site-header__phone { display: none; }
  .site-header__utils { gap: 4px; }
  .site-header__auth-actions { gap: 3px; }

  .nav-panel { padding: 8px 0 16px; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav-link {
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 10px;
    justify-content: space-between;
  }

  .nav-sub-link { padding: 10px 18px; font-size: 0.92rem; }

  .auth-modal__dialog {
    width: min(96vw, 420px);
    padding: 18px 16px 16px;
  }
  .auth-modal__socials {
    grid-template-columns: 1fr;
  }
  .membership-modal {
    padding: 14px;
  }
  .membership-modal__badge {
    font-size: 0.66rem;
  }
  .membership-modal__head h2 {
    font-size: 1.2rem;
  }
  .membership-modal__head p {
    font-size: 0.82rem;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .site-header__learn-btn { font-size: 0.62rem; padding: 4px 7px; }
  .site-header__portal { font-size: 0.62rem; padding: 4px 7px; }
  .site-header__auth-pill { padding: 4px 7px; font-size: 0.62rem; }
  .nav-toggle__label { display: none; }
  .nav-toggle { padding: 6px 8px; }
}
