/* ============================================================
   global.css — design tokens, resets, base elements
   FlexGrow Learning Centre
   Palette: burgundy maroon + brass gold, on a warm paper ground —
   an academic/business-crest pairing rather than a generic SaaS
   look. System font stack only (no external font requests) so
   the app renders instantly and identically offline.
   ============================================================ */

:root {
  /* --- Brand palette --- */
  --maroon-950: #2b0810;
  --maroon-900: #3d0c17;
  --maroon-800: #551020;
  --maroon-700: #6d1a2e;   /* primary brand */
  --maroon-600: #832238;
  --maroon-500: #9c3049;
  --maroon-100: #f3e2e6;
  --gold-700: #8a6316;
  --gold-600: #ab7d24;
  --gold-500: #c69c4e;    /* accent */
  --gold-300: #e6cf9c;
  --gold-100: #f7ecd8;

  --paper: #faf6f1;        /* page background */
  --paper-alt: #f2e9de;    /* alternating section bg */
  --surface: #ffffff;
  --ink-900: #271017;
  --ink-700: #4a2530;
  --ink-500: #705a61;
  --line: #e3d5ca;
  --line-strong: #cdb9ab;

  --success: #2f7d5a;
  --success-bg: #e7f2ec;
  --danger: #a3271f;
  --danger-bg: #fbe9e7;
  --warning: #97640c;
  --warning-bg: #fbf0dc;
  --info: #2a5a78;
  --info-bg: #e8f1f6;

  /* Single, easy-to-read typeface family everywhere. Hierarchy comes from
     size, weight, and spacing (not from mixing typefaces). */
  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --radius-sm: 3px;
  --radius-md: 6px;
  --shadow-card: 0 1px 2px rgba(43, 8, 16, 0.06);
  --shadow-pop: 0 12px 32px rgba(43, 8, 16, 0.22);

  --container: 1180px;
  --header-h: 68px;
}

* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink-900);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
#app { flex: 1 0 auto; }

img, svg { max-width: 100%; display: block; }
a { color: var(--maroon-700); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--maroon-900);
  line-height: 1.15;
  margin: 0 0 0.5em;
}
/* Weight and size carry the hierarchy since we only use one typeface. */
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.15rem); font-weight: 800; letter-spacing: -0.005em; }
h3 { font-size: 1.28rem; font-weight: 700; }
h4 { font-size: 1.02rem; font-weight: 700; }
strong, b { font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; }
p.lede { font-size: 1.1rem; color: var(--ink-700); }

ul, ol { padding-left: 1.25em; }
hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 56px 0; }
.section-alt { background: var(--paper-alt); }
.section-head { margin-bottom: 28px; }
.section-head p { margin-top: 4px; }

.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;
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold-600);
  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 {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--maroon-700); color: #fff; }
.btn-primary:hover { background: var(--maroon-800); }
.btn-gold { background: var(--gold-500); color: var(--maroon-950); }
.btn-gold:hover { background: var(--gold-600); }
.btn-outline { background: transparent; border-color: var(--maroon-700); color: var(--maroon-700); }
.btn-outline:hover { background: var(--maroon-100); }
.btn-ghost { background: transparent; color: var(--maroon-800); border-color: transparent; }
.btn-ghost:hover { background: var(--paper-alt); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #832019; }
.btn-sm { padding: 7px 14px; min-height: 34px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- Forms --- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--ink-700); }
.field .hint { font-size: 0.8rem; color: var(--ink-500); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="url"], input[type="tel"], select, textarea {
  width: 100%; padding: 11px 12px; min-height: 44px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink-900); font-size: 0.95rem; font-family: inherit;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--maroon-600); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; min-height: auto; }

/* --- Badges & status --- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: .01em;
  padding: 3px 9px; border-radius: 100px; border: 1px solid transparent;
}
.badge-gold { background: var(--gold-100); color: var(--gold-700); border-color: var(--gold-300); }
.badge-maroon { background: var(--maroon-100); color: var(--maroon-700); border-color: var(--maroon-500); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--paper-alt); color: var(--ink-700); border-color: var(--line); }

.progress { height: 8px; border-radius: 100px; background: var(--paper-alt); overflow: hidden; border: 1px solid var(--line); }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--maroon-600), var(--gold-500)); transition: width .6s cubic-bezier(.22,1,.36,1); }

.divider-rule { border: none; border-top: 1px solid var(--line); margin: 20px 0; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-500); }
.empty-state .icon-lg { margin-bottom: 12px; opacity: .7; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; min-width: 560px; background: #fff; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
th { background: var(--paper-alt); color: var(--maroon-900); font-family: var(--font-display); font-weight: 600; }
tr:last-child td { border-bottom: none; }

.toast-stack { position: fixed; top: 84px; right: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.toast { background: var(--maroon-950); color: #fff; padding: 12px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-pop); font-size: 0.9rem; border-left: 4px solid var(--gold-500); animation: toast-in .18s ease; }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-success { border-left-color: var(--success); }
@keyframes toast-in { from { opacity:0; transform: translateY(-6px);} to {opacity:1; transform:none;} }

.skip-link {
  position: absolute; left: 8px; top: -48px; background: var(--maroon-900); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-sm); z-index: 2000; transition: top .15s ease;
}
.skip-link:focus { top: 8px; }
