/* =====================================================================
   HYBRID ACADEMY — SHARED STYLES
   Design tokens: deep indigo (trust/institution), warm gold (school
   pride accent), leaf green (paid/healthy), clay red (overdue/low).
   ===================================================================== */

:root {
  --color-ink: #14213D;         /* primary — deep indigo */
  --color-ink-light: #1F2E52;
  --color-gold: #D9A441;        /* accent — warm gold */
  --color-gold-dark: #B9832A;
  --color-green: #2F8F5B;       /* healthy / paid */
  --color-green-bg: #E7F5EC;
  --color-amber: #C67F17;       /* near threshold / partial */
  --color-amber-bg: #FBF0DC;
  --color-red: #B23A2E;         /* overdue / out of stock */
  --color-red-bg: #FBE9E7;
  --color-bg: #FFFFFF;
  --color-bg-soft: #F6F7FB;
  --color-border: #E3E6EE;
  --color-text: #1C2230;
  --color-text-muted: #5A6072;

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --radius: 10px;
  --shadow-card: 0 1px 2px rgba(20, 33, 61, 0.06), 0 8px 24px rgba(20, 33, 61, 0.06);
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--color-ink);
  margin: 0 0 0.5em;
  line-height: 1.15;
}

p { margin: 0 0 1em; color: var(--color-text-muted); }

a { color: inherit; }

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

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 72px 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 14px;
}
.eyebrow-dark { color: var(--color-gold-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-large { padding: 14px 28px; font-size: 1rem; }
.btn-small { padding: 9px 18px; font-size: 0.9rem; }
.btn-primary { background: var(--color-gold); color: var(--color-ink); }
.btn-primary:hover { background: var(--color-gold-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--color-ink); border-color: var(--color-ink); }
.btn-ghost:hover { background: var(--color-ink); color: #fff; }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.12); }
.btn-full { width: 100%; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-logo { height: 32px; width: 32px; object-fit: contain; border-radius: 6px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-ink);
  font-size: 1rem;
  line-height: 1.2;
}
.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-weight: 500;
  font-size: 0.94rem;
}
.site-nav a { text-decoration: none; color: var(--color-text); }
.site-nav a:hover { color: var(--color-ink); }
.nav-link-login { color: var(--color-text-muted) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--color-ink); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--color-ink) 0%, var(--color-ink-light) 100%);
  color: #fff;
}
.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 96px 24px 80px;
  text-align: center;
}
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.9rem); }
.hero-lead { color: rgba(255,255,255,0.82); font-size: 1.05rem; max-width: 600px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Problem ---------- */
.problem { background: var(--color-ink); color: #fff; }
.problem h2 { color: #fff; max-width: 680px; }
.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.problem-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 22px;
}
.problem-card h3 { color: var(--color-gold); font-size: 1rem; margin-bottom: 8px; }
.problem-card p { color: rgba(255,255,255,0.75); margin: 0; font-size: 0.94rem; }

/* ---------- Features ---------- */
.features { background: var(--color-bg-soft); }
.features h2, .how-it-works h2, .dashboard-preview h2 { max-width: 560px; }
.features-grid, .steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.feature-card, .step-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.feature-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-gold);
  color: var(--color-ink);
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
}
.feature-card h3, .step-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p, .step-card p { font-size: 0.94rem; margin: 0; }

/* ---------- How it works ---------- */
.step-card { position: relative; padding-top: 34px; }
.step-index {
  position: absolute; top: -14px; left: 24px;
  background: var(--color-ink);
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
}

/* ---------- Dashboard preview ---------- */
.preview-lead { max-width: 560px; }
.preview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 32px 0;
}
.preview-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.preview-card-label { font-size: 0.82rem; color: var(--color-text-muted); margin-bottom: 8px; }
.preview-card-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--color-ink); margin: 0; }
.preview-card-sub { font-family: var(--font-body); font-size: 0.85rem; font-weight: 500; color: var(--color-text-muted); }

.preview-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.preview-table-wrap {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}
.preview-table-wrap h3 { font-size: 1rem; margin-bottom: 12px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.preview-table th, .preview-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--color-border); white-space: nowrap; }
.preview-table th { color: var(--color-text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.status-green { background: var(--color-green-bg); color: var(--color-green); }
.status-amber { background: var(--color-amber-bg); color: var(--color-amber); }
.status-red { background: var(--color-red-bg); color: var(--color-red); }

/* ---------- CTA ---------- */
.cta { background: var(--color-ink-light); color: #fff; }
.cta-inner { text-align: center; }
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,0.8); margin-bottom: 28px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-ink); color: rgba(255,255,255,0.7); }
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
}
.footer-nav { display: flex; gap: 18px; }
.footer-nav a { text-decoration: none; color: rgba(255,255,255,0.7); }
.footer-nav a:hover { color: #fff; }

/* ---------- Auth pages (login / register) ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-soft);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 36px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-brand img { height: 30px; width: 30px; border-radius: 6px; }
.auth-brand span { font-family: var(--font-display); font-weight: 700; color: var(--color-ink); }
.auth-card h1 { font-size: 1.4rem; margin-bottom: 6px; }
.auth-sub { margin-bottom: 24px; font-size: 0.94rem; }

.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-size: 0.86rem; font-weight: 600; color: var(--color-ink); margin-bottom: 6px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  color: var(--color-text);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--color-ink);
  box-shadow: 0 0 0 3px rgba(20,33,61,0.1);
}

.form-message { padding: 10px 14px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 16px; display: none; }
.form-message.show { display: block; }
.form-message.success { background: var(--color-green-bg); color: var(--color-green); }
.form-message.error { background: var(--color-red-bg); color: var(--color-red); }

.auth-note { margin-top: 14px; text-align: center; font-size: 0.82rem; color: var(--color-text-muted); }

.forgot-password-link { text-align: right; margin: -8px 0 18px; font-size: 0.85rem; }
.forgot-password-link a { color: var(--color-ink); font-weight: 600; text-decoration: none; }
.forgot-password-link a:hover { text-decoration: underline; }

.auth-footer-link { margin-top: 20px; text-align: center; font-size: 0.9rem; }
.auth-footer-link a { color: var(--color-ink); font-weight: 600; text-decoration: none; }
.auth-footer-link a:hover { text-decoration: underline; }

/* ---------- Connection test page ---------- */
.test-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--color-bg-soft); }
.test-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 40px; text-align: center; max-width: 420px; }
.test-message { font-weight: 600; }
.test-message.test-success { color: var(--color-green); }
.test-message.test-error { color: var(--color-red); }

/* =====================================================================
   RESPONSIVE — mobile-first adjustments for phones/tablets, since
   bursars and store-keepers will often use a phone, not a laptop.
   ===================================================================== */
@media (max-width: 780px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    padding: 16px 24px;
    gap: 14px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav .btn { width: 100%; }

  .hero-inner { padding: 64px 20px 56px; }
  .section-inner { padding: 56px 20px; }
  .hero-actions, .cta .hero-actions { flex-direction: column; }
  .hero-actions .btn, .cta .btn { width: 100%; }

  .footer-inner { flex-direction: column; text-align: center; }
}
