/* ============================================================
   GEMS XL ACADEMY — Stage B+C full-fidelity layer
   Load THIRD:
   <link rel="stylesheet" href="academy-theme.css">
   <link rel="stylesheet" href="stage-a-theme.css">
   <link rel="stylesheet" href="stage-bc.css">

   Structural additions use the .fx- prefix; everything else
   restyles existing live class names/ids on top of Stage A.
   Tokens locked by client: page #E2E9EC, surface #ECF5F9,
   filler inputs #D1DBDF (flat, borderless), wash #45B5B34D,
   CTA #2F9B77 white text, coral/amber semantics,
   Saira interim (closest free match to F37 Incise — squarish
   geometric grotesque, flat terminals; was Schibsted Grotesk).
   NO emoji — inline SVG only, explicit width/height.
   ============================================================ */

/* ---------- 0. Token additions ---------- */
:root {
  --fx-filler: #D1DBDF;                 /* flat borderless input fill */
  --fx-hairline: rgba(18, 38, 43, .10); /* dividers */
  --fx-meta: #7b8e93;                   /* right-aligned gray meta labels */
  --fx-amber-bg: #f8e3cf;               /* not-passed card */
  --fx-amber-ink: #b4633a;
  --fx-radius: 8px;        /* squared per client ref (was 14px) */
  --fx-radius-field: 4px;   /* inputs & wallet cards: near-square */
  --fx-radius-cta: 6px;     /* primary buttons */
}

/* Font correction: Saira everywhere (squarish geometric grotesque,
   closest free stand-in for F37 Incise). */
body, button, input, select, textarea {
  font-family: "Saira", "F37 Incise", system-ui, sans-serif;
}
:root { --font-head: "Saira", "F37 Incise", system-ui, sans-serif; --font-body: "Saira", "F37 Incise", system-ui, sans-serif; }

/* ============================================================
   1. GLOBAL HEADER BAR (.fx-header) — onboarding + standalone pages
   ============================================================ */
.fx-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--fx-hairline);
}
.fx-logo { display: inline-flex; align-items: center; gap: 9px; color: var(--teal); text-decoration: none; }
.fx-logo svg { display: block; }
.fx-logo-word {
  font-family: var(--font-head); font-weight: 800;
  font-size: .92rem; letter-spacing: .12em; text-transform: uppercase;
}
.fx-header .fx-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* "Graduated" state pill (mobile app bar + header) */
.fx-pill-state {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(47, 155, 119, .13); color: var(--mint-dark);
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  border: 1px solid rgba(47, 155, 119, .25);
}

/* ============================================================
   2. ONBOARDING (auth card, f2-01 / f6-mobile-a)
   ============================================================ */
#authGate { display: block; min-height: 100vh; padding: 0; }
.fx-auth-wrap { max-width: 560px; margin: 0 auto; padding: 44px 20px 64px; }

.auth-card, .fx-auth-card {
  width: 100%; max-width: none;
  background: var(--panel);
  border: 1px solid var(--fx-hairline);
  border-radius: 10px;
  box-shadow: var(--shadow-lift);
  padding: 34px 34px 30px;
}

/* kicker + title */
.fx-kicker {
  display: block;
  color: var(--green); font-weight: 700;
  font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  margin: 0 0 8px;
}
.fx-auth-title { font-family: var(--font-head); font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; color: var(--teal); }
.fx-auth-sub { color: var(--muted); font-size: .95rem; margin: 0 0 26px; }

/* field label row: green ALL-CAPS left + gray meta right */
.fx-label-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 20px 0 8px;
}
.fx-label-row label, .fx-label {
  color: var(--green); font-weight: 700;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  margin: 0;
}
.fx-meta { color: var(--fx-meta); font-size: .74rem; font-weight: 500; letter-spacing: .02em; white-space: nowrap; line-height: 1; }

/* flat borderless filler inputs (overrides stage-a input styling) */
.fx-auth-card input[type="text"],
.fx-auth-card input[type="email"],
.fx-auth-card input[type="password"],
.auth-card input,
.fx-input {
  width: 100%;
  background: var(--fx-filler);
  border: 1px solid transparent;
  border-radius: var(--fx-radius-field);
  padding: 12px 15px;
  font-size: .92rem; color: var(--teal);
  box-shadow: none;
}
.fx-auth-card input:focus, .fx-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 155, 119, .16);
  background: #d9e3e7;
}
.fx-auth-card ::placeholder, .fx-input::placeholder { color: #71868c; }

/* wallet connect buttons — flat cards with real SVG marks */
.fx-wallet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fx-wallet-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px;
  background: var(--fx-filler);
  border: 1px solid transparent;
  border-radius: var(--fx-radius-field);
  font: inherit; font-weight: 700; font-size: .92rem; color: var(--teal);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.fx-wallet-btn:hover { border-color: var(--green); background: #d9e3e7; }
.fx-wallet-btn[aria-pressed="true"], .fx-wallet-btn.fx-on {
  border-color: var(--green);
  background: rgba(47, 155, 119, .12);
}
.fx-wallet-btn svg { display: block; flex: 0 0 auto; }
.fx-wallet-or { text-align: center; color: var(--fx-meta); font-size: .78rem; margin: 10px 0; }

/* primary CTA with arrow */
.fx-cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  background: var(--green); color: #fff;
  border: 0; border-radius: var(--fx-radius-cta);
  padding: 14px 22px;
  font: inherit; font-weight: 700; font-size: 1rem;
  cursor: pointer; margin-top: 26px;
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.fx-cta:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 8px 18px -10px rgba(47,155,119,.7); }
.fx-cta svg { display: block; }
.fx-cta[disabled] { opacity: .55; cursor: default; transform: none; box-shadow: none; }

/* validation error state */
.fx-input.fx-err, .fx-auth-card input.fx-err { box-shadow: inset 0 0 0 1.5px var(--coral); }
.fx-field-err {
  display: flex; align-items: center; gap: 7px;
  color: #b71f22; font-size: .8rem; margin: 7px 0 0;
}
.fx-field-err svg { flex: 0 0 auto; }

.fx-auth-foot { text-align: center; color: var(--fx-meta); font-size: .8rem; margin-top: 18px; }
.fx-auth-foot a { color: var(--mint-dark); }

/* ============================================================
   3. DESKTOP SYLLABUS SIDEBAR (restyle of live aside/.nav-item)
   ============================================================ */
aside { padding-top: 18px; }
aside .brand { display: flex; align-items: center; gap: 9px; }
.nav-item { border-radius: 7px; padding: 9px 12px; }
.nav-item .num {
  width: 24px; height: 24px; flex: 0 0 24px;
  border: 1.5px solid var(--fx-meta); color: var(--fx-meta);
  border-radius: 50%; font-size: .72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-item.active .num { border-color: var(--green); color: var(--green); }
.nav-item.done .num { background: var(--green); border-color: var(--green); color: #fff; }
.nav-item.done .num::before { content: none; } /* check injected as svg in markup */
.fx-nav-divider { border: 0; border-top: 1px solid var(--fx-hairline); margin: 10px 14px; }

/* quiz entry row in sidebar */
.fx-nav-quiz .num { border-style: dashed; }
.fx-nav-quiz.unlocked .num { border-style: solid; border-color: var(--green); color: var(--green); }

/* pager + logout bottom block */
.side-progress { font-size: .78rem; }
.fx-side-logout {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 14px 16px; padding: 9px 12px;
  color: var(--muted); font-size: .85rem; font-weight: 600;
  background: none; border: 0; border-radius: 10px; cursor: pointer;
}
.fx-side-logout:hover { background: rgba(18,38,43,.05); color: var(--teal); }

/* ============================================================
   4. ACADEMY CONTENT COLUMN
   ============================================================ */
/* wash header band on content pages */
.fx-page-head {
  background: linear-gradient(180deg, rgba(111,222,197,.30) 0%, rgba(111,222,197,0) 100%);
  border-radius: 10px 10px 0 0;
  padding: 30px 34px 18px;
  margin: 0 0 6px;
}
.fx-page-head .fx-kicker { margin-bottom: 6px; }
.fx-page-head h1 { margin: 0 0 6px; }

/* "Mark complete & continue" footer */
.fx-page-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 30px; padding-top: 20px;
  border-top: 1px solid var(--fx-hairline);
}
.fx-page-foot .fx-prev {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); color: var(--teal);
  border: 1px solid var(--fx-hairline); border-radius: 999px;
  padding: 11px 18px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
}
.fx-page-foot .fx-prev:hover { border-color: var(--green); }
.fx-mark-complete {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--green); color: #fff;
  border: 0; border-radius: 999px;
  padding: 13px 22px; font: inherit; font-weight: 700; font-size: .95rem;
  cursor: pointer; margin-left: auto;
  transition: transform .15s, filter .15s;
}
.fx-mark-complete:hover { transform: translateY(-1px); filter: brightness(1.05); }
.fx-mark-complete svg { display: block; }

/* info-card grids (reuses .mini) */
.mini { border-radius: var(--fx-radius); }

/* callout row */
.fx-callout {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(232, 143, 53, .10);
  border: 1px solid rgba(232, 143, 53, .35);
  color: #8a5417; border-radius: 8px;
  padding: 14px 16px; font-size: .9rem;
}
.fx-callout svg { flex: 0 0 auto; margin-top: 1px; }

/* ============================================================
   5. MOBILE (restyle of §13 .mnav- shell)
   ============================================================ */
@media (max-width: 768px) {
  .mnav-appbar {
    background: linear-gradient(180deg, rgba(111,222,197,.28) 0%, rgba(111,222,197,.06) 100%), var(--panel);
    border-bottom: 1px solid var(--fx-hairline);
  }
  .mnav-tabs { background: transparent; border: 0; }
  .mnav-tab { border-radius: 999px; background: var(--fx-filler); border: 1px solid transparent; }
  .mnav-tab.mnav-on, .mnav-tab[aria-selected="true"] { background: var(--green); color: #fff; }
  .mnav-tab.done .mnav-num { background: #fff0; }
  .mnav-bottom { border-top: 1px solid var(--fx-hairline); }
  .mnav-bitem { color: var(--fx-meta); gap: 4px; padding: 7px 2px; }
  .mnav-bitem.mnav-on, .mnav-bitem[aria-current="page"] { color: var(--mint-dark); }
}

/* bottom sheet (QR share / logout) */
.fx-sheet-veil {
  position: fixed; inset: 0; background: rgba(18, 38, 43, .45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 60;
}
.fx-sheet {
  width: 100%; max-width: 560px;
  background: var(--panel);
  border-radius: 12px 12px 0 0;
  padding: 14px 22px 28px;
  box-shadow: 0 -8px 30px rgba(18,38,43,.18);
}
@media (min-width: 641px) {
  .fx-sheet-veil { align-items: center; padding: 20px; }
  .fx-sheet { border-radius: 10px; }
}
.fx-sheet-grab { width: 44px; height: 4px; border-radius: 2px; background: var(--fx-filler); margin: 0 auto 16px; }
.fx-sheet h3 { margin: 0 0 4px; font-size: 1.1rem; }
.fx-sheet .fx-sheet-sub { color: var(--muted); font-size: .88rem; margin: 0 0 18px; }

/* ============================================================
   6. QUIZ
   ============================================================ */
.fx-quiz-progress { color: var(--fx-meta); font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 10px; }
.fx-quiz-bar { height: 5px; border-radius: 3px; background: var(--fx-filler); overflow: hidden; margin: 0 0 24px; }
.fx-quiz-bar > span { display: block; height: 100%; background: var(--green); border-radius: 3px; }

#qOpts .opt, .fx-opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  background: var(--panel) !important;
  border: 1px solid var(--fx-hairline) !important;
  border-radius: 6px !important;
  padding: 15px 16px;
  font: inherit; font-size: .95rem; color: var(--teal);
  text-align: left; cursor: pointer;
  transition: border-color .12s, background .12s;
}
#qOpts .opt:hover, .fx-opt:hover { border-color: var(--green) !important; }
#qOpts .opt.sel, .fx-opt[aria-checked="true"], .fx-opt.sel {
  border-color: var(--green) !important;
  background: rgba(47, 155, 119, .10) !important;
  box-shadow: inset 0 0 0 1px var(--green);
}
.fx-opt-dot {
  width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%;
  border: 2px solid var(--fx-meta); display: inline-flex; align-items: center; justify-content: center;
}
.fx-opt.sel .fx-opt-dot, .fx-opt[aria-checked="true"] .fx-opt-dot { border-color: var(--green); }
.fx-opt.sel .fx-opt-dot::after, .fx-opt[aria-checked="true"] .fx-opt-dot::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green);
}

/* score hero */
.fx-score { font-family: var(--font-head); font-weight: 800; font-size: 3rem; letter-spacing: -0.03em; margin: 0; color: var(--teal); }
.fx-score small { font-size: 1.4rem; color: var(--fx-meta); font-weight: 700; }

/* not-passed card (amber) */
.fx-quiz-fail {
  background: var(--fx-amber-bg);
  border: 1px solid rgba(180, 99, 58, .35);
  color: var(--fx-amber-ink);
  border-radius: var(--fx-radius);
  padding: 18px 20px;
}
.fx-quiz-fail .fx-score { color: var(--fx-amber-ink); }

/* passed card (green tint) */
.fx-quiz-pass {
  background: rgba(47, 155, 119, .10);
  border: 1px solid rgba(47, 155, 119, .3);
  border-radius: var(--fx-radius);
  padding: 18px 20px;
}
.fx-quiz-pass .fx-score { color: var(--mint-dark); }

/* review-your-misses list */
.fx-miss-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.fx-miss {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--panel); border: 1px solid var(--fx-hairline);
  border-radius: 8px; padding: 13px 16px; font-size: .9rem; color: var(--teal);
}
.fx-miss a {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  color: var(--mint-dark); font-weight: 700; font-size: .84rem; text-decoration: none;
  white-space: nowrap;
}
.fx-miss a:hover { text-decoration: underline; }

/* quiz footer buttons */
.fx-quiz-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ============================================================
   7. GRADUATE TOOLS — Leader Code
   ============================================================ */
/* big saved code */
.fx-code-big {
  font-family: var(--font-head);
  font-size: 2.3rem; font-weight: 800; letter-spacing: .08em;
  color: var(--teal); margin: 4px 0 2px;
}
/* referral link row */
.fx-link-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--fx-filler); border-radius: 8px;
  padding: 10px 10px 10px 16px; margin-top: 14px;
}
.fx-link-row code {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .88rem; color: var(--teal); background: none;
}
.fx-btn-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px;
  background: var(--green); color: #fff;
  border: 0; border-radius: 999px; padding: 9px 15px;
  font: inherit; font-weight: 700; font-size: .82rem; cursor: pointer;
  white-space: nowrap;
}
.fx-btn-sm.ghost { background: var(--panel); color: var(--teal); border: 1px solid var(--fx-hairline); }
.fx-btn-sm.ghost:hover { border-color: var(--green); }
.fx-btn-sm svg { display: block; }

/* 3 explainer cards */
.fx-explain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
@media (max-width: 640px) { .fx-explain-grid { grid-template-columns: 1fr; } }
.fx-explain {
  background: var(--panel); border: 1px solid var(--fx-hairline); border-radius: var(--fx-radius);
  padding: 16px;
}
.fx-explain svg { display: block; margin-bottom: 10px; }
.fx-explain b { display: block; font-size: .88rem; color: var(--teal); margin-bottom: 4px; }
.fx-explain p { margin: 0; font-size: .82rem; color: var(--muted); line-height: 1.45; }

/* QR modal body */
.fx-qr-box {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--fx-hairline); border-radius: var(--fx-radius);
  padding: 22px; margin: 0 auto 16px; width: fit-content;
}

/* numbered instruction steps (reuses .lct-steps idea, flat look) */
.fx-steps { list-style: none; counter-reset: fxs; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.fx-steps li {
  counter-increment: fxs;
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--fx-hairline);
  border-radius: 8px; padding: 14px 16px; font-size: .9rem;
}
.fx-steps li::before {
  content: counter(fxs);
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 50%; background: rgba(47,155,119,.13); color: var(--mint-dark);
  font-weight: 800; font-size: .8rem;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ============================================================
   8. SECONDARY PAGES (content creation / library / leaderboard / guides)
   ============================================================ */
/* chips: flat filler, selected = green */
.pt-chip, .c3-seg-btn, .fx-chip {
  background: var(--fx-filler); border: 1px solid transparent;
  border-radius: 999px; padding: 8px 15px;
  font: inherit; font-size: .85rem; font-weight: 600; color: var(--teal); cursor: pointer;
}
.pt-chip.on, .c3-seg-btn[aria-pressed="true"], .fx-chip.on, .fx-chip[aria-pressed="true"] {
  background: var(--green); color: #fff; border-color: var(--green);
}

/* list rows (library, guides, leaderboard) */
.lib4-row, .fx-row {
  display: flex; align-items: center; gap: 13px;
  background: var(--panel); border: 1px solid var(--fx-hairline);
  border-radius: 8px; padding: 13px 15px;
}
.fx-row .fx-row-main { flex: 1 1 auto; min-width: 0; }
.fx-row b { display: block; font-size: .9rem; color: var(--teal); }
.fx-row small { color: var(--muted); font-size: .78rem; }
.fx-row-icon {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px;
  background: rgba(47,155,119,.12); color: var(--mint-dark);
  display: inline-flex; align-items: center; justify-content: center;
}

/* leaderboard rank rows */
.fx-rank { display: flex; align-items: center; gap: 12px; }
.fx-rank-num { width: 30px; flex: 0 0 30px; font-weight: 800; color: var(--fx-meta); font-size: .9rem; }
.fx-rank-amt { margin-left: auto; font-weight: 800; color: var(--mint-dark); font-size: .92rem; white-space: nowrap; }
.fx-rank.me { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }

/* banner strip ("Real actions — XP coming soon") */
.fx-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(111,222,197,.14); border: 1px solid rgba(111,222,197,.3);
  color: var(--teal); border-radius: 8px; padding: 11px 15px;
  font-size: .85rem; font-weight: 600;
}

/* video guide rows */
.fx-vid-thumb {
  width: 84px; height: 52px; flex: 0 0 84px; border-radius: 9px;
  background: var(--fx-filler);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--mint-dark);
}

/* section heading pattern for secondary pages */
.fx-sec-h {
  color: var(--green); font-weight: 700; font-size: .72rem;
  letter-spacing: .14em; text-transform: uppercase; margin: 26px 0 10px;
}
