/* CTRL+ALT+DEFEND - Security+ Practice Quiz.
   "Norch" dark futuristic skin. System fonts only (no third-party requests).
   Swap --accent to change the theme (e.g. brand lime #c6f84e). */

:root {
  --bg: #07070c;
  --surface: #111119;
  --surface-2: #181822;
  --surface-3: #20202c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f6;
  --muted: #9aa0b4;
  --accent: #4cc4ff;          /* electric cyan (Norch) - swap to brand lime if preferred */
  --accent-press: #2fb2f5;
  --accent-ink: #04121c;      /* text on accent buttons */
  --correct: #34d399;
  --wrong: #fb7185;
  --amber: #fbbf24;
  --radius: 16px;
  --maxw: 760px;
  --font: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Consolas", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(76, 196, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(126, 87, 255, 0.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom));
}
#app { max-width: var(--maxw); margin: 0 auto; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip-link:focus { left: 12px; top: 12px; }
.noscript { max-width: var(--maxw); margin: 48px auto; text-align: center; }
.noscript a { color: var(--accent); }

/* ---- Typography ---- */
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 6vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 4.5vw, 1.9rem); }
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; }
.lead { color: var(--muted); font-size: 1.06rem; }
.muted { color: var(--muted); }

/* ---- Layout ---- */
.screen { padding: clamp(26px, 7vh, 56px) 0 40px; animation: fade .3s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stack > * + * { margin-top: 16px; }
.center { text-align: center; }

/* ---- Buttons (pill) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; letter-spacing: -0.01em; cursor: pointer;
  text-decoration: none; transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent-press)); color: var(--accent-ink); box-shadow: 0 6px 24px rgba(76,196,255,.25); }
.btn-primary:hover { background: var(--accent-press); }
.btn-ghost { background: rgba(255,255,255,.03); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- Cards ---- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
}
.pill { display: inline-block; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 999px; padding: 6px 14px; font-size: .8rem; color: var(--muted); }
.badge { display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 800; padding: 6px 14px; border-radius: 999px; letter-spacing: .02em; }

/* ---- Intro "how it works" ---- */
.steps { display: grid; gap: 14px; margin-top: 24px; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.step .num { font-family: var(--mono); font-weight: 700; font-size: 1.9rem; color: var(--accent); line-height: 1; }
.step h3 { margin: 8px 0 4px; font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }
.dl { display: flex; gap: 10px 22px; flex-wrap: wrap; justify-content: center; color: var(--muted); font-size: .9rem; margin-top: 8px; }
.dl b { color: var(--text); }

/* ---- Quiz HUD ---- */
.hud { position: sticky; top: 0; z-index: 5; background: linear-gradient(180deg, var(--bg) 70%, transparent); padding: 12px 0 10px; }
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.hud-stats { display: flex; gap: 14px; font-family: var(--mono); }
.hud-stats b { color: var(--accent); }
.track { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; background: linear-gradient(90deg, var(--accent), #7e57ff); width: 0; transition: width .35s ease; }

/* ---- Question + options ---- */
.q-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.q-stem { font-size: 1.18rem; font-weight: 600; margin: 0 0 6px; }
.q-hint { color: var(--muted); font-size: .85rem; margin: 0 0 16px; }
.options { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 14px 16px; color: var(--text); font: inherit; cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.opt:hover:not(.locked) { border-color: var(--accent); }
.opt .mark {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--border-strong);
  display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: transparent; margin-top: 1px;
}
.opt[data-type="single"] .mark { border-radius: 999px; }
.opt.selected { border-color: var(--accent); background: rgba(76,196,255,.08); }
.opt.selected .mark { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.opt.locked { cursor: default; }
/* graded states */
.opt.correct { border-color: var(--correct); background: rgba(52,211,153,.12); }
.opt.correct .mark { border-color: var(--correct); background: var(--correct); color: #04120b; }
.opt.wrong { border-color: var(--wrong); background: rgba(251,113,133,.12); }
.opt.wrong .mark { border-color: var(--wrong); background: var(--wrong); color: #1a0509; }
.opt-key { font-family: var(--mono); color: var(--muted); margin-right: 2px; }

/* ---- Explanation reveal ---- */
.explain { margin-top: 14px; border-radius: 12px; padding: 14px 16px; border: 1px solid var(--border); background: var(--surface-2); animation: fade .25s ease both; }
.explain.right { border-color: rgba(52,211,153,.5); }
.explain.wrong { border-color: rgba(251,113,133,.5); }
.explain .verdict { font-weight: 800; margin: 0 0 6px; }
.explain.right .verdict { color: var(--correct); }
.explain.wrong .verdict { color: var(--wrong); }
.explain p { margin: 6px 0 0; font-size: .95rem; }
.explain .why-wrong { color: var(--muted); }

/* ---- Result ---- */
.score-hero { text-align: center; }
.score-num { font-family: var(--mono); font-size: clamp(3rem, 14vw, 5rem); font-weight: 800; line-height: 1; }
.score-num.pass { color: var(--correct); }
.score-num.fail { color: var(--amber); }
.result-stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.rev-item { border-left: 3px solid var(--border-strong); padding: 6px 0 6px 14px; }
.rev-item.right { border-color: var(--correct); }
.rev-item.wrong { border-color: var(--wrong); }
.rev-q { font-weight: 600; margin: 0 0 6px; }
.rev-line { margin: 2px 0; font-size: .9rem; }
.rev-line .lbl { color: var(--muted); }
.rev-your.wrong { color: var(--wrong); }
.rev-correct { color: var(--correct); }
.cta-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; margin-top: 28px; }
.foot { color: var(--muted); font-size: .8rem; text-align: center; margin-top: 28px; }

/* ---- Capture ---- */
.capture .field { display: block; text-align: left; }
.capture .field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.capture input[type="text"], .capture input[type="email"] {
  width: 100%; min-height: 48px; padding: 0 14px; font: inherit; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 12px;
}
.capture input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.capture .consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; text-align: left; font-size: .9rem; color: var(--muted); }
.capture .consent input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.capture .consent a { color: var(--accent); }
.capture-msg { min-height: 1.2em; margin: 0; font-size: .9rem; color: var(--amber); text-align: left; }

/* ---- Roadmap-style backlink (privacy page) ---- */
.backlink { display: inline-block; color: var(--accent); text-decoration: none; font-weight: 600; margin-bottom: 4px; }
.backlink:hover { text-decoration: underline; }

/* ---- Consent banner (used by analytics.js) ---- */
.consent-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px 20px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--surface-2); border-top: 1px solid var(--border-strong);
}
.consent-bar-text { margin: 0; color: var(--muted); font-size: .9rem; max-width: 620px; }
.consent-bar-text a { color: var(--accent); }
.consent-bar-btns { display: flex; gap: 10px; }
.consent-bar .btn { min-height: 42px; padding: 0 20px; }

@media (prefers-reduced-motion: reduce) { *, .screen, .explain { animation: none !important; transition: none !important; } }

/* ---- Print / download my result ---- */
@media print {
  body { background: #fff; color: #000; padding: 0; }
  .btn, .btn-row, .capture, .consent-bar, .hud, .skip-link { display: none !important; }
  .card, .cta-block, .step { background: #fff !important; border: 1px solid #bbb !important; }
  .eyebrow, .badge, .score-num, .rev-correct { color: #000 !important; }
  a { color: #000 !important; }
}
