/* ==========================================================================
   xaviate — Design System
   Aviation-training LMS. Instrument-panel precision meets flight-path motion.
   ========================================================================== */

:root {
  /* Palette */
  --navy-950: #0a1628;
  --navy-900: #0e1e38;
  --navy-800: #142a4d;
  --navy-700: #1c3763;
  --sky-500: #2e7de1;
  --sky-400: #4f95f0;
  --sky-100: #e3edfc;
  --amber-400: #ffb020;
  --amber-300: #ffc85c;
  --slate-600: #5b6b82;
  --slate-400: #8a97ab;
  --slate-200: #d7dee7;
  --off-white: #f6f8fb;
  --white: #ffffff;
  --green-500: #1faa59;
  --red-500: #e5484d;

  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --shadow-card: 0 4px 24px rgba(10, 22, 40, 0.08);
  --shadow-lift: 0 12px 36px rgba(10, 22, 40, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--navy-950);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display-font {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  color: var(--navy-950);
}

.text-mono { font-family: var(--font-mono); }

a { color: var(--sky-500); text-decoration: none; }
a:hover { color: var(--navy-800); }

/* Focus visibility — accessibility floor */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--amber-400);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Buttons ---------- */
.btn-sky {
  background: var(--sky-500);
  color: var(--white);
  border: none;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-sky:hover { background: var(--navy-800); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-lift); }

.btn-amber {
  background: var(--amber-400);
  color: var(--navy-950);
  border: none;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-amber:hover { background: var(--amber-300); color: var(--navy-950); transform: translateY(-1px); box-shadow: var(--shadow-lift); }

.btn-outline-navy {
  background: transparent;
  color: var(--navy-900);
  border: 1.5px solid var(--navy-900);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.35rem;
}
.btn-outline-navy:hover { background: var(--navy-900); color: var(--white); }

.btn-ghost-light {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.4);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.35rem;
}
.btn-ghost-light:hover { background: rgba(255,255,255,0.12); color: var(--white); border-color: var(--white); }

/* ---------- Navbar ---------- */
.xv-navbar {
  background: var(--navy-950);
  padding: 0.9rem 0;
}
.xv-navbar .navbar-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--white);
  letter-spacing: -0.02em;
}
.xv-navbar .navbar-brand .dot { color: var(--amber-400); }

/* Logo chip — keeps the full-colour logo (incl. its dark wordmark) legible
   when placed on the navy navbar/footer/auth-visual backgrounds. */
.brand-logo-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  padding: 0.3rem 0.8rem;
  line-height: 0;
}
.brand-logo-chip img { height: 40px; width: auto; display: block; }
.brand-logo-chip.lg img { height: 56px; }
.brand-logo-chip.sm img { height: 32px; }
.xv-navbar .nav-link {
  color: var(--slate-200);
  font-weight: 500;
  padding: 0.5rem 1rem !important;
}
.xv-navbar .nav-link:hover, .xv-navbar .nav-link.active { color: var(--white); }
.xv-navbar .nav-link.active { position: relative; }
.xv-navbar .nav-link.active::after {
  content: "";
  position: absolute;
  left: 1rem; right: 1rem; bottom: 0.1rem;
  height: 2px;
  background: var(--amber-400);
}

/* ---------- Hero: flight-path signature ---------- */
.hero-flight {
  background: radial-gradient(ellipse at top right, var(--navy-800) 0%, var(--navy-950) 55%);
  color: var(--white);
  position: relative;
  overflow: hidden;
  padding: 5.5rem 0 6rem;
}
.flight-path-svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; pointer-events: none; }
.flight-path-svg path {
  fill: none;
  stroke: var(--sky-400);
  stroke-width: 1.5;
  stroke-dasharray: 6 8;
  animation: dash-move 18s linear infinite;
}
@keyframes dash-move { to { stroke-dashoffset: -280; } }
.flight-node { fill: var(--amber-400); }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-400);
}
.hero-flight h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); line-height: 1.08; }
.hero-flight .lead { color: var(--slate-200); font-size: 1.15rem; max-width: 42ch; }

.trust-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--slate-400);
  border-left: 2px solid var(--navy-700);
  padding-left: 0.75rem;
}

/* ---------- Stats strip ---------- */
.stat-figure {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 2.1rem;
  color: var(--navy-950);
}
.stat-label { color: var(--slate-600); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Cards ---------- */
.xv-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.xv-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.course-card .thumb {
  height: 150px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(135deg, var(--sky-500), var(--navy-800));
  position: relative;
  overflow: hidden;
}
.course-card .thumb .level-chip {
  position: absolute; top: 0.75rem; left: 0.75rem;
  background: rgba(10,22,40,0.55);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.course-card .price { font-family: var(--font-mono); font-weight: 600; color: var(--navy-950); }
.course-card .rating { color: var(--amber-400); font-size: 0.85rem; }

/* ---------- Section headers ---------- */
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sky-500);
}
.section-title { font-size: clamp(1.6rem, 3vw, 2.3rem); }

/* ---------- How it works: flight path steps ---------- */
.path-steps { position: relative; }
.path-steps::before {
  content: "";
  position: absolute;
  top: 28px; left: 6%; right: 6%;
  height: 2px;
  background-image: linear-gradient(90deg, var(--slate-200) 60%, transparent 0%);
  background-size: 14px 2px;
  background-repeat: repeat-x;
}
.path-step-marker {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--navy-950);
  color: var(--amber-400);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  position: relative; z-index: 1;
  margin: 0 auto 1rem;
}

/* ---------- Footer ---------- */
.xv-footer { background: var(--navy-950); color: var(--slate-400); }
.xv-footer h6 { color: var(--white); font-family: var(--font-display); font-size: 0.95rem; }
.xv-footer a { color: var(--slate-400); }
.xv-footer a:hover { color: var(--amber-400); }
.xv-footer .brand { color: var(--white); font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }

/* ---------- Auth pages ---------- */
.auth-shell { min-height: 100vh; display: flex; }
.auth-visual {
  background: radial-gradient(ellipse at bottom left, var(--navy-800) 0%, var(--navy-950) 60%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.auth-form-col { display: flex; align-items: center; justify-content: center; background: var(--white); }
.auth-card { width: 100%; max-width: 420px; padding: 2rem 0; }
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  padding: 0.65rem 0.9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--sky-500);
  box-shadow: 0 0 0 3px var(--sky-100);
}
.form-label { font-weight: 600; font-size: 0.88rem; color: var(--navy-900); }
.divider-or { display: flex; align-items: center; gap: 0.75rem; color: var(--slate-400); font-size: 0.8rem; margin: 1.25rem 0; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--slate-200); }
.btn-google {
  width: 100%; background: var(--white); border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm); padding: 0.6rem 1rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
}
.btn-google:hover { background: var(--off-white); }
.alert-inline { font-size: 0.88rem; border-radius: var(--radius-sm); }

/* ---------- Dashboard shell ---------- */
.dash-shell { display: flex; min-height: 100vh; }
.dash-sidebar {
  width: 250px; flex-shrink: 0;
  background: var(--navy-950); color: var(--slate-200);
  padding: 1.25rem 0.9rem;
}
.dash-sidebar .brand { color: var(--white); font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; padding: 0 0.5rem 1.25rem; display: block; }
.dash-sidebar .nav-link {
  color: var(--slate-200); border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem; font-size: 0.92rem; font-weight: 500;
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.15rem;
}
.dash-sidebar .nav-link:hover { background: var(--navy-800); color: var(--white); }
.dash-sidebar .nav-link.active { background: var(--sky-500); color: var(--white); }
.dash-sidebar .nav-section-label {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--slate-400); padding: 1rem 0.75rem 0.35rem;
}
.dash-main { flex: 1; min-width: 0; }
.dash-topbar {
  background: var(--white); border-bottom: 1px solid var(--slate-200);
  padding: 0.85rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
}
.dash-content { padding: 1.75rem; }

.progress-thin { height: 6px; border-radius: 100px; background: var(--slate-200); }
.progress-thin .progress-bar { background: var(--sky-500); border-radius: 100px; }

.badge-role {
  font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 0.25rem 0.55rem; border-radius: 100px;
}
.badge-role.student { background: var(--sky-100); color: var(--sky-500); }
.badge-role.instructor { background: #fff1d6; color: #a5680c; }
.badge-role.admin { background: #fde3e3; color: var(--red-500); }

/* Utility */
.text-slate { color: var(--slate-600); }
.bg-navy-950 { background: var(--navy-950); }
.rounded-lg { border-radius: var(--radius-lg); }
.loading-spinner-overlay {
  position: fixed; inset: 0; background: rgba(246,248,251,0.85);
  display: flex; align-items: center; justify-content: center; z-index: 2000;
}

/* ---- Mobile dashboard navigation (hamburger opens sidebar as overlay) ---- */
@media (max-width: 991.98px) {
  .dash-sidebar.mobile-open {
    display: block !important;
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 264px; z-index: 1050; overflow-y: auto;
    box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  .shell-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1040;
    border: 0; padding: 0; margin: 0;
  }
}
