/* ==========================================================================
   Victory School — Login System
   Palette: Ink Navy #0F2A44, Field Green #234B3E, Victory Gold #C9A227,
            Parchment #F6F1E4, Ink #1C1B18, Crimson (errors) #8C2F30
   Type: "Fraunces" (display, institutional serif) + "Inter" (body/UI)
         + "IBM Plex Mono" (admission/staff numbers, meta labels)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --navy: #0F2A44;
  --navy-deep: #0A1E33;
  --green: #234B3E;
  --gold: #C9A227;
  --gold-soft: #E4C765;
  --parchment: #F6F1E4;
  --ink: #1C1B18;
  --ink-soft: #55524A;
  --crimson: #8C2F30;
  --line: rgba(28, 27, 24, 0.12);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --radius: 14px;
  --shadow-card: 0 20px 45px -25px rgba(10, 30, 51, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--parchment);
}

a { color: var(--green); }

/* ---------- Top-left nav menu (every public page) ---------- */

.nav-toggle {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 40;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 51, 0.35);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  width: min(280px, 84vw);
  background: var(--navy);
  color: var(--parchment);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
}

.nav-drawer.open { transform: translateX(0); }

.nav-drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(246, 241, 228, 0.16);
}

.nav-logo { display: block; }

.nav-drawer-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  flex: 1;
}

.nav-close {
  background: none;
  border: none;
  color: var(--parchment);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

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

.nav-links li + li { margin-top: 2px; }

.nav-links a {
  display: block;
  padding: 11px 10px;
  border-radius: 8px;
  color: rgba(246, 241, 228, 0.85);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
}

.nav-links a:hover {
  background: rgba(246, 241, 228, 0.08);
  color: var(--parchment);
}

/* ---------- Auth pages (sign in / sign up): simple centered card ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px 40px;
}

.logo-mark {
  width: 56px;
  height: auto;
  margin-bottom: 12px;
}

.school-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 28px;
  text-align: center;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 32px 28px;
}

.auth-card h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--navy);
}

.auth-card p.sub {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ---------- Public info pages (courses / about / faq) ---------- */

.info-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 20px 60px;
}

.info-card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 32px 32px 24px;
  font-size: 14.5px;
  line-height: 1.65;
}

.info-card h3 {
  font-family: var(--font-display);
  color: var(--navy);
  margin: 22px 0 6px;
  font-size: 17px;
}

.info-card h3:first-child { margin-top: 0; }

.info-card ul { padding-left: 20px; margin: 8px 0; }

/* ---------- Shared form controls ---------- */

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--ink);
}

.field .hint { font-size: 12px; color: var(--ink-soft); font-weight: 400; }

.input-wrap { position: relative; }

.input-wrap input,
.input-wrap select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 44px 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrap select { padding-right: 13px; }

.input-wrap input:focus,
.input-wrap select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 75, 62, 0.15);
}

.input-wrap input.invalid { border-color: var(--crimson); }

.toggle-visibility {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  padding: 6px 8px;
  border-radius: 6px;
}

.toggle-visibility:hover { color: var(--navy); background: rgba(15, 42, 68, 0.06); }

.field-error {
  min-height: 16px;
  font-size: 12.5px;
  color: var(--crimson);
  margin-top: 6px;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--parchment);
  background: var(--navy);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover { background: var(--navy-deep); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 13px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.alert-error {
  background: rgba(140, 47, 48, 0.09);
  border: 1px solid rgba(140, 47, 48, 0.25);
  color: var(--crimson);
}

.alert-success {
  background: rgba(35, 75, 62, 0.09);
  border: 1px solid rgba(35, 75, 62, 0.25);
  color: var(--green);
}

.form-foot {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}

.form-foot a { font-weight: 600; text-decoration: none; }
.form-foot a:hover { text-decoration: underline; }

/* ---------- Dashboards (shared shell) ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--navy);
  color: var(--parchment);
}

.topbar .brand-name { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; color: var(--gold-soft); }

.topbar .who {
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar .badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(201, 162, 39, 0.18);
  color: var(--gold-soft);
  padding: 4px 10px;
  border-radius: 999px;
}

.logout-link {
  color: rgba(246, 241, 228, 0.75);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid rgba(246, 241, 228, 0.25);
  padding: 7px 14px;
  border-radius: 8px;
}

.logout-link:hover { color: var(--parchment); border-color: rgba(246, 241, 228, 0.5); }

.dash-body { max-width: 960px; margin: 0 auto; padding: 48px 32px; }

.dash-body h1 { font-family: var(--font-display); font-size: 30px; color: var(--navy); margin: 0 0 6px; }

.dash-body .sub { color: var(--ink-soft); margin: 0 0 32px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-card .label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.stat-card .value {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--navy);
  margin-top: 6px;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .auth-card, .info-card { padding: 26px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-drawer, .nav-backdrop { transition: none; }
}
