:root {
  --navy: #0b1b3a;
  --navy-2: #13294f;
  --ink: #1b2437;
  --muted: #5b6577;
  --line: #e3e8f0;
  --bg: #f5f7fb;
  --white: #fff;
  --brand: #1f6bff;
  --brand-dark: #1553cc;
  --accent: #00c2a8;
  --high: #1e9e5a;
  --medium: #f0a020;
  --low: #e0533d;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 27, 58, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 12px; color: var(--navy); }
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 14px; }
a { color: var(--brand); }
.container { width: min(1120px, 92%); margin: 0 auto; }
.hidden { display: none !important; }
.mt-12 { margin-top: 12px; }
.mt-32 { margin-top: 32px; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Buttons & forms */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 14px 26px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-accent { background: var(--accent); color: #05302a; }
.btn-accent:hover { background: #00a890; }
.btn-ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); padding: 10px 20px; }
.btn-ghost:hover { background: rgba(31, 107, 255, 0.08); }
.btn-small { padding: 8px 14px; font-size: 0.875rem; border-radius: 8px; }
.btn-danger { background: var(--low); }
.btn-danger:hover { background: #c0402c; }
.btn-block { display: block; width: 100%; }

label { display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cfd6e4;
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .option:focus-within {
  outline: 3px solid rgba(31, 107, 255, 0.35);
  outline-offset: 1px;
}
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error { color: #b3261e; font-weight: 600; margin: 8px 0; min-height: 1.2em; }
.fineprint { font-size: 0.8rem; color: var(--muted); }

/* Landing */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 800; font-size: 1.3rem; letter-spacing: 0.04em; color: var(--navy); text-decoration: none; }
.brand span { color: var(--brand); }

.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #1a3a7a 100%); color: #fff; padding: 64px 0 72px; }
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.lead { font-size: 1.15rem; color: #cfd9ee; }
.checks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 32px; }
.checks li::before {
  content: '';
  position: absolute; left: 0; top: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2305302a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/14px no-repeat;
}
.form-card { background: #fff; color: var(--ink); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.form-card h2 { font-size: 1.35rem; margin-bottom: 4px; }

section.block { padding: 72px 0; }
section.alt { background: var(--bg); }
.section-head { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card .icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(31, 107, 255, 0.1); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; margin-bottom: 14px; }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; margin-bottom: 12px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.cta-band { background: var(--navy); color: #fff; text-align: center; padding: 64px 0; }
.cta-band h2 { color: #fff; }
.footer { padding: 28px 0; font-size: 0.85rem; color: var(--muted); text-align: center; }

/* Assessment */
.assess-wrap { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.assess-main { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.assess-card { width: min(720px, 100%); background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 36px; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); width: 0; transition: width 0.3s; }
.progress-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 24px; display: flex; justify-content: space-between; }
.question { font-size: 1.45rem; font-weight: 700; color: var(--navy); margin-bottom: 20px; }
.options { display: grid; gap: 10px; }
.option { display: flex; gap: 12px; align-items: center; border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.option:hover { border-color: var(--brand); background: rgba(31, 107, 255, 0.04); }
.option.selected { border-color: var(--brand); background: rgba(31, 107, 255, 0.08); }
.option input { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.assess-nav { display: flex; justify-content: space-between; margin-top: 24px; gap: 12px; }

/* Result */
.result-top { text-align: center; }
.score-ring { position: relative; width: 190px; height: 190px; margin: 8px auto 12px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; font-weight: 800; color: var(--navy); }
.score-ring .num small { font-size: 1rem; color: var(--muted); font-weight: 600; display: block; margin-top: -8px; }
.tier-pill { display: inline-block; padding: 4px 14px; border-radius: 99px; font-weight: 700; font-size: 0.85rem; color: #fff; }
.tier-high { background: var(--high); }
.tier-medium { background: var(--medium); }
.tier-low { background: var(--low); }
.pillar { margin: 14px 0; }
.pillar .top { display: flex; justify-content: space-between; font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: var(--brand); border-radius: 99px; }
.insights { background: var(--bg); border-radius: 12px; padding: 16px 20px; margin: 22px 0; }
.insights li { margin: 6px 0; }
.cta-box { text-align: center; border: 2px solid var(--brand); border-radius: 14px; padding: 24px; margin-top: 24px; }

/* Admin */
.login-box { width: min(380px, 92%); margin: 12vh auto; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 32px; }
.admin-body { background: var(--bg); min-height: 100vh; }
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .brand { color: #fff; display: block; padding: 4px 10px 18px; }
.sidebar button { text-align: left; background: transparent; border: 0; color: #c7d3ec; padding: 10px 12px; border-radius: 8px; font: inherit; cursor: pointer; }
.sidebar button:hover { background: rgba(255, 255, 255, 0.08); }
.sidebar button.active { background: var(--brand); color: #fff; font-weight: 700; }
.sidebar .spacer { flex: 1; }
.admin-main { padding: 28px; overflow-x: auto; }
.admin-main h1 { font-size: 1.6rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: #fff; border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); }
.kpi .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.kpi .value { font-size: 2rem; font-weight: 800; color: var(--navy); }
.kpi .sub { font-size: 0.8rem; color: var(--muted); }
.panels { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 20px; }
.panel h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.85rem; margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; padding: 9px 12px; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: #fafbfe; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f5f8ff; }
.hot { font-weight: 700; color: #c2410c; }
.score-badge { display: inline-block; min-width: 42px; text-align: center; padding: 3px 8px; border-radius: 99px; font-weight: 700; color: #fff; }
.drawer-bg { position: fixed; inset: 0; background: rgba(11, 27, 58, 0.45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: #fff; z-index: 41; overflow-y: auto; padding: 26px; box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2); }
.drawer h2 { font-size: 1.4rem; }
.qa { border-top: 1px solid var(--line); padding: 10px 0; font-size: 0.9rem; }
.qa .q { color: var(--muted); }
.qa .a { font-weight: 600; }
.flag { background: #fff4e5; border: 1px solid #ffd8a8; color: #8a4b00; padding: 8px 12px; border-radius: 8px; font-size: 0.85rem; margin: 6px 0; }
.dist-row { display: grid; grid-template-columns: 1fr 60px; gap: 10px; align-items: center; font-size: 0.85rem; margin: 6px 0; }
.dist-row .bar { height: 8px; margin-top: 3px; }
.code-editor { font-family: Consolas, Menlo, monospace; font-size: 0.82rem; min-height: 60vh; white-space: pre; }

@media (max-width: 860px) {
  .hero-grid, .grid-3, .panels { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 48px; }
  .row { grid-template-columns: 1fr; }
  .assess-card { padding: 22px; }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar .spacer { display: none; }
}
