/* جُمان — design tokens (or / bleu perle / crème — aligné marque logo) */
:root {
  --color-bg: #e4eaf2;
  --color-surface: #fffef9;
  --color-cream: #fff8e7;
  --color-pearl: #f5f0e6;
  --color-gold: #9a7209;
  --color-gold-bright: #c9a227;
  --color-gold-deep: #7a5a07;
  --color-blue: #3d6d94;
  --color-blue-soft: #5a87ad;
  --color-periwinkle: #b0c4de;
  --color-border: rgba(58, 90, 120, 0.18);
  --color-orange: #c58a1e;
  --color-orange-hover: #a87316;
  --color-text: #24303a;
  --color-muted: #4d5c68;
  --color-placeholder: #8a97a3;
  --shadow-card: 0 10px 36px rgba(36, 58, 88, 0.09);
  --shadow-soft: 0 4px 20px rgba(36, 48, 64, 0.07);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --font-ar: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --font-display: "El Messiri", "Cairo", serif;
  --font-en: "Inter", "Segoe UI", sans-serif;
  --header-max: 1120px;
  --content-max: 900px;
  --color-auth-bg: linear-gradient(165deg, #e8eef6 0%, #f2ebe0 48%, #e4eaf2 100%);
  --color-auth-border: rgba(180, 170, 150, 0.45);
  --color-btn-primary: #2f5f86;
  --color-btn-primary-hover: #264d6e;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-ar);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

/* Logo image — أحجام متعددة للصفحات */
.site-logo {
  display: block;
  object-fit: contain;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(36, 48, 64, 0.12));
}

.site-logo--hero {
  width: min(11rem, 42vw);
  max-height: 8rem;
  margin-inline: auto;
}

.site-logo--header {
  width: auto;
  height: 2.35rem;
  max-width: 7rem;
}

.site-logo--auth {
  width: min(6.5rem, 38vw);
  max-height: 5rem;
}

.site-logo--subnav {
  height: 2.5rem;
  width: auto;
  max-width: 6.5rem;
}

a.brand-btn--logo {
  width: auto;
  height: auto;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-md);
}

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

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-surface);
  color: var(--color-blue);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  z-index: 100;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--color-blue);
}

/* Header — physical left = menu, physical right = logo (independent of RTL text flow) */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid rgba(58, 134, 173, 0.22);
  padding-bottom: 0.25rem;
}

.header-bar {
  direction: ltr;
  max-width: var(--header-max);
  margin-inline: auto;
  padding: 0.75rem 1.25rem 0;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
}

.header-session {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 12rem;
}

.header-user-name {
  font-family: var(--font-ar);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-logout {
  font-family: var(--font-ar);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-blue);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.header-logout:hover {
  background: rgba(58, 134, 173, 0.08);
  border-color: var(--color-blue-soft);
}

.header-spacer {
  min-height: 1px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.icon-btn:hover {
  background: rgba(58, 134, 173, 0.08);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

a.icon-btn {
  color: inherit;
  text-decoration: none;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 22px;
}

.hamburger::before,
.hamburger::after {
  content: "";
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.hamburger::before {
  box-shadow: 0 7px 0 currentColor;
}

.logo-mark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 3rem;
  height: 3rem;
  padding: 4px;
  border-radius: 10px;
  background: linear-gradient(145deg, #f0f5f8 0%, #e2ecf2 100%);
  color: var(--color-gold-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.logo-mark--small {
  width: 2.65rem;
  height: 2.65rem;
}

.logo-shell {
  width: 1.15rem;
  height: 1.15rem;
  opacity: 0.9;
}

.logo-mark-text {
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-gold-deep);
}

.hero {
  direction: rtl;
  text-align: center;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 1.25rem 1.25rem 1.75rem;
}

.hero-title {
  margin: 0 0 0.35rem;
  font-size: clamp(2.25rem, 6vw, 3.15rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-gold);
  line-height: 1.15;
}

.hero-lead {
  margin: 0 0 0.25rem;
  font-size: clamp(0.95rem, 2.5vw, 1.08rem);
  font-weight: 600;
  color: var(--color-blue);
  line-height: 1.55;
}

.hero-sub {
  margin: 0;
  font-size: clamp(0.82rem, 2vw, 0.92rem);
  font-weight: 500;
  color: var(--color-blue-soft);
  line-height: 1.6;
}

/* Main card */
.main {
  padding: 1.25rem 1rem 4rem;
}

.main-card {
  max-width: 920px;
  margin-inline: auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(184, 212, 229, 0.65);
  box-shadow: var(--shadow-card);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.search-hint {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.7;
  text-align: right;
}

.search-wrap {
  margin-bottom: 1.35rem;
}

.search-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-family: var(--font-ar);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 2px rgba(58, 134, 173, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input::placeholder {
  color: var(--color-placeholder);
  opacity: 1;
}

.search-input:hover {
  border-color: var(--color-blue-soft);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(58, 134, 173, 0.2);
}

.filters {
  margin-bottom: 1rem;
}

.filters-heading {
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.filters-icon {
  display: inline-flex;
  color: var(--color-orange);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.95rem;
  font-family: var(--font-ar);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-blue);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease, transform 0.15s ease;
  text-align: center;
  user-select: none;
}

button.chip {
  appearance: none;
  margin: 0;
}

button.chip:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

.chip.chip--active {
  background: var(--color-orange);
  border-color: var(--color-orange);
  color: #fff;
  box-shadow: 0 4px 14px rgba(224, 112, 32, 0.28);
}

.chip.chip--active:hover {
  background: var(--color-orange-hover);
  border-color: var(--color-orange-hover);
  color: #fff;
}

.chip:hover {
  border-color: var(--color-blue-soft);
  color: var(--color-blue);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.chip-input:focus-visible + .chip {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

.chip-input:checked + .chip {
  background: var(--color-orange);
  border-color: var(--color-orange);
  color: #fff;
  box-shadow: 0 4px 14px rgba(224, 112, 32, 0.28);
}

.chip-input:checked + .chip:hover {
  background: var(--color-orange-hover);
  border-color: var(--color-orange-hover);
  color: #fff;
}

.term-def {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(184, 212, 229, 0.5);
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--color-text);
  text-align: right;
}

.term-def p {
  margin: 0;
}

.empty-results {
  grid-column: 1 / -1;
  max-width: 420px;
  margin: 2rem auto;
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid rgba(184, 212, 229, 0.65);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.empty-results-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--color-placeholder);
}

.empty-results-icon svg {
  width: 48px;
  height: 48px;
}

.empty-results-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-muted);
}

.empty-results-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-placeholder);
}

.empty-results-hint code {
  font-family: ui-monospace, monospace;
  font-size: 0.82em;
  background: rgba(38, 90, 122, 0.08);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}

.term-count {
  margin: 1.1rem 0 1.35rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-orange);
}

.term-count-num {
  font-variant-numeric: tabular-nums;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.term-card {
  background: var(--color-surface);
  border: 1px solid rgba(184, 212, 229, 0.85);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.15rem;
  box-shadow: 0 2px 10px rgba(58, 134, 173, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.term-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(58, 134, 173, 0.12);
  border-color: var(--color-blue-soft);
}

.term-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.term-book {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff6d8 0%, #f5e6b8 100%);
  color: var(--color-gold-deep);
}

.term-ar {
  margin: 0;
  flex: 1;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-gold);
  text-align: right;
}

.term-en {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-en);
  font-size: 0.88rem;
  font-weight: 500;
  font-style: italic;
  color: var(--color-blue);
  text-align: right;
  direction: ltr;
  justify-content: flex-end;
}

.lang-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 6px;
  background: rgba(58, 134, 173, 0.12);
  font-style: normal;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--color-blue);
}

/* Floating help — physical bottom-right (bouton ou lien) */
.fab-help {
  position: fixed;
  bottom: 1.35rem;
  right: 1.35rem;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(184, 212, 229, 0.9);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-muted);
  font-family: var(--font-ar);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.fab-help:hover {
  color: var(--color-blue);
  box-shadow: 0 6px 22px rgba(58, 134, 173, 0.18);
  transform: scale(1.06);
}

.fab-help:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .main-card {
    border-radius: var(--radius-md);
    padding: 1rem;
  }

  .filter-chips {
    justify-content: center;
  }

  .filters-heading {
    justify-content: center;
  }

  .search-hint {
    text-align: center;
  }

  .chip {
    font-size: 0.78rem;
    padding: 0.45rem 0.75rem;
  }

  .fab-help {
    bottom: 1rem;
    right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* —— Welcome page —— */
.page-welcome {
  background: linear-gradient(
    180deg,
    #f7f2e8 0%,
    var(--color-pearl) 32%,
    var(--color-bg) 58%,
    rgba(176, 196, 222, 0.35) 100%
  );
  min-height: 100vh;
}

.welcome-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(58, 134, 173, 0.15);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

.welcome-header-inner {
  direction: ltr;
  max-width: var(--header-max);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.welcome-header-spacer {
  flex: 1;
}

.welcome-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.welcome-nav-link {
  font-family: var(--font-ar);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-blue);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  transition: background 0.2s ease, color 0.2s ease;
}

.welcome-nav-link:hover {
  background: rgba(58, 134, 173, 0.1);
  color: var(--color-blue);
}

.welcome-nav-link--cta {
  background: linear-gradient(165deg, var(--color-gold-bright) 0%, var(--color-gold-deep) 100%);
  color: #fff !important;
  border: 1px solid var(--color-gold-deep);
}

.welcome-nav-link--cta:hover {
  background: linear-gradient(165deg, #d4b03a 0%, #8a6606 100%);
  border-color: #6b5005;
}

.welcome-main {
  max-width: 560px;
  margin-inline: auto;
  padding: 2rem 1.25rem 5rem;
  text-align: center;
}

.welcome-main--landing {
  max-width: 52rem;
  text-align: center;
}

.welcome-lead-wide {
  max-width: 36rem;
  margin-inline: auto;
  color: var(--color-muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.landing-section {
  margin-top: 3rem;
  text-align: start;
}

.landing-section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 1.25rem;
  text-align: center;
}

.landing-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .landing-features {
    grid-template-columns: repeat(3, 1fr);
  }
}

.landing-card {
  background: var(--color-surface);
  border: 1px solid rgba(58, 134, 173, 0.18);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  text-align: start;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.landing-card:hover {
  box-shadow: var(--shadow-card);
  border-color: rgba(58, 134, 173, 0.28);
}

.landing-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(58, 134, 173, 0.12);
  color: var(--color-blue);
  margin-bottom: 0.75rem;
}

.landing-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

.landing-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-muted);
  line-height: 1.6;
}

.landing-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 28rem;
  margin-inline: auto;
}

.landing-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--color-surface);
  border: 1px solid rgba(58, 134, 173, 0.15);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  text-align: start;
  box-shadow: var(--shadow-soft);
}

.landing-step-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--color-orange);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-step-body strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.landing-step-body span {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.landing-cta {
  margin-top: 3rem;
  padding: 1.75rem 1.5rem;
  background: linear-gradient(
    135deg,
    rgba(201, 162, 39, 0.12) 0%,
    rgba(61, 109, 148, 0.1) 55%,
    rgba(176, 196, 222, 0.2) 100%
  );
  border: 1px solid rgba(61, 109, 148, 0.18);
  border-radius: var(--radius-lg);
  text-align: center;
}

.landing-cta p {
  margin: 0 0 1rem;
  font-weight: 600;
  color: var(--color-text);
  font-size: 1.05rem;
}

.landing-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
  max-width: 280px;
  margin-inline: auto;
}

.welcome-nav-link--muted {
  color: var(--color-muted);
  font-weight: 500;
}

.welcome-nav-link--muted:hover {
  color: var(--color-blue);
}

#welcome-nav-logout {
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  font-family: var(--font-ar);
}

.welcome-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.logo-mark--hero {
  width: 5rem;
  height: 5rem;
  border-radius: 16px;
}

.logo-shell--hero {
  width: 2rem;
  height: 2rem;
}

.logo-mark-text--hero {
  font-size: 0.72rem;
}

.welcome-hero .hero-title {
  margin-top: 0.5rem;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 2rem 0 2.5rem;
  max-width: 320px;
  margin-inline: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ar);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease, transform 0.15s ease;
}

.btn--large {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.btn--primary {
  background: linear-gradient(165deg, var(--color-gold-bright) 0%, var(--color-gold-deep) 100%);
  color: #fff;
  border-color: var(--color-gold-deep);
  box-shadow: 0 4px 18px rgba(122, 90, 7, 0.28);
}

.btn--primary:hover {
  background: linear-gradient(165deg, #d4b03a 0%, #8a6606 100%);
  border-color: #6b5005;
  color: #fff;
  transform: translateY(-1px);
}

.btn--secondary {
  background: var(--color-btn-primary);
  color: #fff;
  border-color: var(--color-btn-primary);
}

.btn--secondary:hover {
  background: var(--color-btn-primary-hover);
  border-color: var(--color-btn-primary-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn--outline {
  background: var(--color-surface);
  color: var(--color-blue);
  border-color: var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-blue);
  background: rgba(58, 134, 173, 0.06);
  color: var(--color-blue);
}

.welcome-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.welcome-links a {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.welcome-links a:hover {
  color: var(--color-blue);
}

/* —— Auth (login / signup) —— */
.page-auth {
  background: var(--color-auth-bg);
  min-height: 100vh;
  margin: 0;
}

.auth-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
}

.auth-logo-link {
  text-decoration: none;
  margin-bottom: 1.75rem;
  transition: transform 0.2s ease;
}

.auth-logo-link:hover {
  transform: scale(1.03);
}

.auth-logo-link:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 4px;
  border-radius: 12px;
}

.logo-mark--auth {
  width: 4.5rem;
  height: 4.5rem;
}

.logo-shell--auth {
  width: 1.75rem;
  height: 1.75rem;
}

.logo-mark-text--auth {
  font-size: 0.65rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border: 1px solid var(--color-auth-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem 2rem;
  box-shadow: var(--shadow-soft);
}

.auth-heading {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: right;
}

.auth-intro {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  color: var(--color-muted);
  text-align: right;
  line-height: 1.55;
}

.auth-intro--compact {
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.auth-demo-divider {
  margin: 1.35rem 0 0.9rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  position: relative;
}

.auth-demo-divider span {
  position: relative;
  padding: 0 0.75rem;
  background: var(--color-surface);
  z-index: 1;
}

.auth-demo-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--color-auth-border);
  z-index: 0;
}

.auth-demo-btn {
  margin-top: 0;
}

.auth-form {
  text-align: right;
}

.form-field {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-ar);
  font-size: 1rem;
  color: var(--color-text);
  background: #fff;
  border: 1px solid #c5cdd3;
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:hover {
  border-color: #9eb0bd;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(58, 134, 173, 0.15);
}

select.form-input {
  cursor: pointer;
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.form-input--password {
  padding-inline-start: 2.75rem;
}

.password-toggle {
  position: absolute;
  inset-inline-start: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-blue);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.password-toggle:hover {
  background: rgba(58, 134, 173, 0.1);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 1px;
}

.form-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.35rem;
}

.form-row-actions--stack {
  justify-content: stretch;
  margin-top: 1.5rem;
}

.form-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}

.form-check--block {
  display: flex;
  align-items: flex-start;
  text-align: right;
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.form-check--block input {
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.form-check a {
  color: var(--color-blue);
  font-weight: 600;
}

.btn--submit {
  padding: 0.65rem 1.75rem;
  font-size: 0.95rem;
  background: var(--color-btn-primary);
  color: #fff;
  border: 1px solid var(--color-btn-primary);
}

.btn--submit:hover {
  background: var(--color-btn-primary-hover);
  border-color: var(--color-btn-primary-hover);
  color: #fff;
}

.btn--block {
  width: 100%;
}

.auth-footer {
  margin: 1.5rem 0 0;
  font-size: 0.9rem;
  color: #6a737d;
  text-align: center;
}

.auth-footer a {
  color: #4a5560;
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  color: var(--color-blue);
  text-decoration: underline;
}

.auth-footer-sep {
  margin: 0 0.5rem;
  color: #bcc4cc;
}

.auth-back {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  text-align: center;
}

.auth-back a {
  color: var(--color-muted);
  text-decoration: none;
}

.auth-back a:hover {
  color: var(--color-blue);
}

/* —— Pages secondaires (aide, légal, contact, …) —— */
.page-secondary {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, var(--color-pearl) 0%, var(--color-bg) 55%);
}

.subpage-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--color-border);
  background: rgba(255, 254, 249, 0.92);
  backdrop-filter: blur(10px);
}

.subpage-header-inner {
  direction: rtl;
  max-width: var(--header-max);
  margin-inline: auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.subpage-back {
  font-family: var(--font-ar);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-blue);
  text-decoration: none;
  flex-shrink: 0;
}

.subpage-back:hover {
  text-decoration: underline;
}

.subpage-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.subpage-main {
  max-width: 720px;
  margin-inline: auto;
  padding: 1.5rem 1.15rem 4rem;
}

.subpage-title {
  margin: 0 0 0.75rem;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--color-gold);
  text-align: right;
}

.subpage-lead {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--color-muted);
  text-align: right;
  line-height: 1.65;
}

.subpage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 1rem;
}

.legal-content {
  text-align: right;
}

.legal-content h2 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-blue);
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--color-text);
  line-height: 1.7;
}

.legal-content ul {
  margin: 0 0 0.75rem;
  padding-inline-start: 1.25rem;
  font-size: 0.92rem;
  color: var(--color-text);
  line-height: 1.65;
}

.form-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(58, 109, 148, 0.1);
  color: var(--color-blue);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: right;
  display: none;
}

.form-status.is-visible {
  display: block;
}

/* —— مكوّنات واجهة (قوائم، بطاقات، شريط أدوات) —— */
.mock-info-strip {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 254, 249, 0.9);
  padding: 1rem 1.1rem;
  margin-top: 0.5rem;
}

.mock-kv-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(61, 109, 148, 0.1);
  font-size: 0.92rem;
  text-align: right;
}

.mock-kv-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.mock-kv-label {
  font-weight: 600;
  color: var(--color-muted);
}

.mock-kv-value {
  color: var(--color-text);
  font-weight: 500;
}

.mock-success-panel {
  margin-top: 0.5rem;
  padding: 1.25rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: linear-gradient(165deg, rgba(255, 248, 231, 0.95) 0%, rgba(255, 254, 249, 0.98) 100%);
  text-align: right;
}

.mock-success-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-gold-deep);
}

.mock-success-text {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--color-text);
  line-height: 1.65;
}

.mock-kv {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-muted);
}

.mock-kv .mock-kv-label {
  margin-inline-end: 0.35rem;
}

.mock-forgot-actions {
  margin-top: 1.25rem;
}

.mock-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
  font-size: 0.88rem;
  color: var(--color-muted);
}

.mock-toolbar-label {
  font-weight: 600;
  color: var(--color-text);
}

.mock-pill {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-blue);
}

.mock-pill--on {
  background: rgba(61, 109, 148, 0.12);
  border-color: rgba(61, 109, 148, 0.35);
}

.mock-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mock-chat-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.mock-chat-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(201, 162, 39, 0.35) 0%, rgba(61, 109, 148, 0.2) 100%);
  color: var(--color-gold-deep);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mock-chat-body {
  flex: 1;
  min-width: 0;
  text-align: right;
}

.mock-chat-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.mock-chat-author {
  font-weight: 700;
  color: var(--color-text);
  font-size: 0.95rem;
}

.mock-chat-time {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.mock-chat-preview {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.55;
}

.mock-chat-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-blue);
}

.mock-composer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  align-items: stretch;
}

.mock-composer-input {
  flex: 1 1 12rem;
  opacity: 0.85;
}

.mock-composer-btn {
  flex: 0 0 auto;
}

.mock-chat-footer-actions {
  margin-top: 1.5rem;
}

.mock-form-spaced {
  margin-top: 1.5rem;
}

/* ═══ Welcome page v2 — refonte landing ═══ */

.page-welcome.page-welcome--v2 {
  position: relative;
  overflow-x: clip;
  background: radial-gradient(120% 80% at 100% 0%, rgba(201, 162, 39, 0.18) 0%, transparent 55%),
    radial-gradient(90% 60% at 0% 100%, rgba(61, 109, 148, 0.2) 0%, transparent 50%),
    linear-gradient(168deg, #1a2836 0%, #243a4d 38%, #2d4a62 72%, #1e3040 100%);
  color: #e8eef4;
  min-height: 100vh;
}

.page-welcome.page-welcome--v2 .fab-help {
  border-color: rgba(255, 254, 249, 0.25);
  background: rgba(255, 254, 249, 0.12);
  color: #f5f0e6;
  backdrop-filter: blur(6px);
}

.page-welcome.page-welcome--v2 .fab-help:hover {
  color: #fff;
  background: rgba(201, 162, 39, 0.35);
}

.welcome-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.welcome-atmosphere__blob {
  position: absolute;
  border-radius: 42% 58% 48% 52% / 38% 42% 58% 62%;
  filter: blur(48px);
  opacity: 0.45;
  animation: welcomeBlobDrift 22s ease-in-out infinite alternate;
}

.welcome-atmosphere__blob--1 {
  width: min(52vw, 28rem);
  height: min(52vw, 28rem);
  top: -8%;
  inset-inline-end: -5%;
  background: radial-gradient(circle at 30% 30%, rgba(201, 162, 39, 0.55), transparent 70%);
}

.welcome-atmosphere__blob--2 {
  width: min(60vw, 32rem);
  height: min(45vw, 24rem);
  bottom: -12%;
  inset-inline-start: -15%;
  background: radial-gradient(circle at 70% 60%, rgba(90, 135, 173, 0.45), transparent 65%);
  animation-delay: -8s;
}

.welcome-atmosphere__grid {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 20%, transparent 70%);
}

@keyframes welcomeBlobDrift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-2rem, 1.5rem) scale(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-atmosphere__blob {
    animation: none;
  }

  .welcome-orbit__ring {
    animation: none !important;
  }
}

.welcome-topbar {
  position: relative;
  z-index: 2;
  padding: 0.65rem 1.15rem;
  border-bottom: 1px solid rgba(255, 254, 249, 0.08);
  background: rgba(10, 18, 26, 0.35);
  backdrop-filter: blur(14px);
}

.welcome-topbar__inner {
  direction: ltr;
  max-width: 72rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.welcome-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: #fff8e7;
}

.welcome-topbar__logo {
  width: 2.65rem;
  height: 2.65rem;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.welcome-topbar__wordmark {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.welcome-topbar__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}

.welcome-pill {
  font-family: var(--font-ar);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.42rem 0.95rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  color: #dbe6ee;
}

.welcome-pill--ghost {
  border-color: rgba(255, 254, 249, 0.14);
  background: rgba(255, 254, 249, 0.04);
}

.welcome-pill--ghost:hover {
  background: rgba(255, 254, 249, 0.1);
  color: #fff;
}

.welcome-pill--gold {
  background: linear-gradient(165deg, #d4b03a 0%, #8a6606 100%);
  color: #fff !important;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.welcome-pill--gold:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.welcome-pill--btn {
  cursor: pointer;
  font: inherit;
}

.welcome-main.welcome-main--v2 {
  position: relative;
  z-index: 1;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 0 4rem;
  text-align: initial;
}

.welcome-hero {
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(1.75rem, 4vw, 3.5rem) clamp(1rem, 3vw, 2rem) 2rem;
}

.welcome-hero__layout {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: center;
}

@media (min-width: 900px) {
  .welcome-hero__layout {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.welcome-hero__copy {
  text-align: right;
}

.welcome-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(201, 162, 39, 0.95);
}

.welcome-display {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 10vw, 5.25rem);
  font-weight: 700;
  line-height: 1.05;
  background: linear-gradient(135deg, #fff8e7 0%, #e8c86a 45%, #c9a227 78%, #f0e4c4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.35));
}

.welcome-lede {
  margin: 0 0 1.5rem;
  max-width: 32rem;
  margin-inline-start: auto;
  font-size: clamp(0.95rem, 2.2vw, 1.08rem);
  line-height: 1.75;
  color: rgba(220, 230, 238, 0.88);
}

.welcome-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-bottom: 1.25rem;
}

.welcome-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ar);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.72rem 1.35rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  border: 2px solid transparent;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.welcome-btn--lg {
  padding: 0.85rem 1.65rem;
  font-size: 1rem;
}

.welcome-btn--gold {
  background: linear-gradient(165deg, #e4c15a 0%, #9a7209 100%);
  color: #1a1a12;
  border-color: rgba(255, 248, 220, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.welcome-btn--gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(201, 162, 39, 0.35);
}

.welcome-btn__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 45%,
    transparent 55%
  );
  transform: translateX(-120%);
  animation: welcomeShine 4.5s ease-in-out infinite;
}

@keyframes welcomeShine {
  0%,
  70% {
    transform: translateX(-120%);
  }
  85% {
    transform: translateX(120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-btn__shine {
    display: none;
  }
}

.welcome-btn--blue {
  background: rgba(61, 109, 148, 0.85);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

.welcome-btn--blue:hover {
  background: rgba(90, 135, 173, 0.95);
  transform: translateY(-1px);
}

.welcome-btn--line {
  background: transparent;
  color: #f0ebe0;
  border-color: rgba(255, 254, 249, 0.28);
}

.welcome-btn--line:hover {
  border-color: rgba(201, 162, 39, 0.55);
  color: #fff8e7;
}

.welcome-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.welcome-tags li {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.32rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 254, 249, 0.06);
  border: 1px solid rgba(255, 254, 249, 0.1);
  color: rgba(220, 230, 238, 0.85);
}

.welcome-hero__stage {
  position: relative;
  min-height: clamp(14rem, 38vw, 22rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-orbit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-orbit__ring {
  position: absolute;
  width: min(78%, 20rem);
  height: min(78%, 20rem);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 50%;
  animation: welcomeSpin 28s linear infinite;
}

.welcome-orbit__ring--delay {
  width: min(92%, 24rem);
  height: min(92%, 24rem);
  border-color: rgba(90, 135, 173, 0.2);
  animation-duration: 38s;
  animation-direction: reverse;
}

@keyframes welcomeSpin {
  to {
    transform: rotate(360deg);
  }
}

.welcome-hero__logo-card {
  position: relative;
  z-index: 1;
  padding: 1.25rem 1.5rem;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 254, 249, 0.14) 0%, rgba(255, 254, 249, 0.04) 100%);
  border: 1px solid rgba(255, 254, 249, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.welcome-hero__logo {
  display: block;
  width: min(12rem, 52vw);
  height: auto;
  margin-inline: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

.welcome-hero__float {
  position: absolute;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(26, 40, 54, 0.75);
  border: 1px solid rgba(255, 254, 249, 0.12);
  color: #e8eef4;
  box-shadow: var(--shadow-soft);
}

.welcome-hero__float--1 {
  top: 8%;
  inset-inline-start: 4%;
}

.welcome-hero__float--2 {
  bottom: 18%;
  inset-inline-end: 0;
}

.welcome-hero__float--3 {
  top: 38%;
  inset-inline-end: 8%;
}

.welcome-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  padding: 1.15rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(10, 18, 26, 0.45);
  border: 1px solid rgba(255, 254, 249, 0.08);
  backdrop-filter: blur(10px);
}

.welcome-metric {
  flex: 1 1 8rem;
  text-align: center;
  padding: 0.35rem 0.5rem;
}

.welcome-metric__value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: #f0d78c;
  line-height: 1.2;
}

.welcome-metric__label {
  font-size: 0.78rem;
  color: rgba(200, 214, 224, 0.75);
}

.welcome-bento {
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem);
}

.welcome-bento__head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.welcome-section-title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  color: #fff8e7;
}

.welcome-section-title--center {
  text-align: center;
}

.welcome-section-sub {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(200, 214, 224, 0.75);
}

.welcome-bento__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .welcome-bento__grid {
    grid-template-columns: 1.25fr 1fr;
    grid-template-rows: auto auto;
  }

  .welcome-tile--wide {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .welcome-tile--accent {
    grid-column: 2;
    grid-row: 1;
  }

  .welcome-bento__grid > .welcome-tile:not(.welcome-tile--wide):not(.welcome-tile--accent) {
    grid-column: 2;
    grid-row: 2;
  }
}

.welcome-tile {
  position: relative;
  padding: 1.35rem 1.4rem;
  border-radius: 20px;
  text-align: right;
  background: rgba(255, 254, 249, 0.06);
  border: 1px solid rgba(255, 254, 249, 0.1);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-tile:hover {
  border-color: rgba(201, 162, 39, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

.welcome-tile--wide {
  background: linear-gradient(155deg, rgba(61, 109, 148, 0.35) 0%, rgba(255, 254, 249, 0.05) 100%);
}

.welcome-tile--accent {
  background: linear-gradient(165deg, rgba(201, 162, 39, 0.22) 0%, rgba(26, 40, 54, 0.5) 100%);
  border-color: rgba(201, 162, 39, 0.35);
}

.welcome-tile__index {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(201, 162, 39, 0.9);
  margin-bottom: 0.5rem;
}

.welcome-tile__title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff8e7;
}

.welcome-tile__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: rgba(220, 230, 238, 0.82);
}

.welcome-tile__art {
  margin-top: 1rem;
  color: rgba(255, 254, 249, 0.35);
  display: flex;
  justify-content: flex-end;
}

.welcome-path {
  max-width: 56rem;
  margin-inline: auto;
  padding: 0 clamp(1rem, 3vw, 2rem) 2.5rem;
}

.welcome-path__track {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.welcome-path__track::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  inset-inline-end: 1.15rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.5), rgba(90, 135, 173, 0.35));
  border-radius: 2px;
}

.welcome-path__step {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding: 0.65rem 0;
}

.welcome-path__dot {
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.5rem;
  margin-inline-end: 0.85rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #e4c15a, #5a87ad);
  box-shadow: 0 0 0 4px rgba(26, 40, 54, 0.9);
  z-index: 1;
}

.welcome-path__card {
  background: rgba(255, 254, 249, 0.05);
  border: 1px solid rgba(255, 254, 249, 0.1);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  text-align: right;
}

.welcome-path__card strong {
  display: block;
  font-size: 0.95rem;
  color: #f0d78c;
  margin-bottom: 0.25rem;
}

.welcome-path__card span {
  font-size: 0.86rem;
  color: rgba(200, 214, 224, 0.8);
  line-height: 1.55;
}

@media (min-width: 720px) {
  .welcome-path__track {
    flex-direction: row;
    gap: 1rem;
  }

  .welcome-path__track::before {
    display: none;
  }

  .welcome-path__step {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .welcome-path__dot {
    margin: 0 auto 0.5rem;
  }

  .welcome-path__card {
    text-align: center;
    flex: 1;
  }
}

.welcome-pullquote {
  max-width: 44rem;
  margin: 2rem auto 0;
  padding: 0 clamp(1rem, 3vw, 2rem);
  text-align: center;
}

.welcome-pullquote blockquote {
  margin: 0 auto;
  max-width: 36rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 600;
  line-height: 1.65;
  color: rgba(240, 215, 140, 0.92);
  border-inline-start: 3px solid rgba(201, 162, 39, 0.55);
  padding-inline-start: 1.25rem;
  text-align: right;
}

.welcome-pullquote__cap {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: rgba(200, 214, 224, 0.55);
}

.welcome-closer {
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 3vw, 2rem) 0;
}

.welcome-closer__panel {
  position: relative;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.2) 0%, rgba(61, 109, 148, 0.25) 50%, rgba(26, 40, 54, 0.8) 100%);
  border: 1px solid rgba(255, 254, 249, 0.14);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.welcome-closer__panel::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 248, 220, 0.08), transparent 45%);
  pointer-events: none;
}

.welcome-closer__title {
  position: relative;
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  color: #fff8e7;
}

.welcome-closer__lead {
  position: relative;
  margin: 0 0 1.25rem;
  color: rgba(220, 230, 238, 0.82);
  font-size: 0.95rem;
}

.welcome-closer__row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.welcome-foot {
  max-width: 72rem;
  margin: 2.5rem auto 0;
  padding: 1.5rem clamp(1rem, 3vw, 2rem) 0;
  border-top: 1px solid rgba(255, 254, 249, 0.08);
  text-align: center;
}

.welcome-foot__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.welcome-foot__nav a {
  font-family: var(--font-ar);
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(200, 214, 224, 0.85);
  text-decoration: none;
  transition: color 0.2s ease;
}

.welcome-foot__nav a:hover {
  color: #f0d78c;
}

.welcome-foot__note {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(160, 178, 192, 0.55);
}

.page-welcome.page-welcome--v2 .skip-link {
  background: rgba(26, 40, 54, 0.92);
  color: #f0d78c;
}
