:root {
  --navy: #172D57;
  --ink: #101F3D;
  --blue: #284383;
  --blue-light: #36579D;
  --orange: #F5B335;
  --orange-dark: #E98A00;
  --paper: #F7F8FB;
  --white: #FFFFFF;
  --muted: #66738A;
  --line: #DDE3ED;
  --success: #1E7256;
  --danger: #9F3A38;
  --shadow: 0 18px 55px rgba(16, 31, 61, 0.12);
}

* { box-sizing: border-box; }

body > .container-fluid {
  width: 100%;
  padding-right: 0;
  padding-left: 0;
}

html, body {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(23,45,87,.035) 1px, transparent 1px),
    linear-gradient(rgba(23,45,87,.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.site-header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 72px);
  background: var(--navy);
  border-bottom: 1px solid var(--ink);
  box-shadow: 0 8px 24px rgba(16,31,61,.18);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex; align-items: center; width: auto; height: auto;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--navy); position: relative;
  box-shadow: 5px 5px 0 var(--orange);
}
.brand-mark::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  right: 7px; top: 7px; background: var(--orange); border-radius: 50%;
}
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: .08em; color: var(--navy); }
.brand-sub { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; letter-spacing: .16em; color: var(--muted); }

.header-meta { display: flex; align-items: center; gap: 12px; }
.time-notice-host:empty { display: none; }
.timer-chip, .status-chip {
  min-width: 86px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--white); text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--navy); font-size: 13px; font-weight: 700;
}
.site-header .status-chip { border-color: rgba(255,255,255,.3); background: rgba(16,31,61,.5); color: var(--white); }

.main-stage { width: min(1120px, calc(100% - 34px)); margin: 0 auto; flex: 1; }

.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 84px);
  align-items: center; min-height: calc(100vh - 76px); padding: 64px 0 76px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue);
}
.eyebrow::before { content: ""; width: 24px; height: 3px; border-radius: 3px; background: var(--orange); }
.hero-title {
  max-width: 760px; margin: 18px 0 20px; color: var(--navy);
  font-family: Charter, "Iowan Old Style", Georgia, serif;
  font-size: clamp(48px, 7vw, 84px); font-weight: 700; letter-spacing: -.045em; line-height: .98;
}
.hero-copy { max-width: 620px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.7; }
.exam-facts { display: flex; flex-wrap: wrap; gap: 12px; margin: 34px 0; }
.fact { padding: 11px 15px; border-left: 3px solid var(--orange); background: rgba(255,255,255,.74); color: var(--navy); font-weight: 650; }

.card {
  background: rgba(255,255,255,.97); border: 1px solid rgba(40,67,131,.14);
  border-radius: 22px; box-shadow: var(--shadow);
}
.form-card { padding: clamp(24px, 4vw, 42px); }
.form-card h2, .admin-card h2 { margin: 0 0 7px; font-size: 24px; color: var(--navy); }
.form-note { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-group { margin-bottom: 16px; }
.control-label { color: var(--navy); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 7px; }
.form-control {
  min-height: 46px; border: 1px solid #CCD5E4; border-radius: 10px; box-shadow: none;
  color: var(--ink); background: #FCFDFE; padding: 10px 12px;
}
.form-control:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245,179,53,.2); }

.btn {
  min-height: 45px; border-radius: 10px; border: 0; padding: 11px 18px;
  font-weight: 800; letter-spacing: .01em; transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--orange); color: var(--ink); box-shadow: 0 7px 18px rgba(233,138,0,.2); }
.btn-primary:hover, .btn-primary:focus { background: var(--orange-dark); color: var(--white); }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-secondary:hover, .btn-secondary:focus { background: var(--blue-light); color: var(--white); }
.btn-ghost { background: transparent; color: var(--blue); border: 1px solid var(--line); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .42; transform: none; }
.admin-link { color: var(--blue); font-size: 13px; font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }
.admin-link:hover { color: var(--orange-dark); }

.exam-layout { padding: 48px 0 64px; }
.progress-panel { margin-bottom: 18px; }
.progress-copy { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.progress-count { color: var(--navy); font-size: 15px; font-weight: 850; }
.progress-label { color: var(--muted); font-size: 12px; }
.progress-track { height: 7px; background: #E5EAF2; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--orange); border-radius: inherit; transition: width .35s ease; }

.question-card { padding: clamp(25px, 5vw, 54px); min-height: 480px; animation: card-in .3s ease both; }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.question-instruction { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 12px; }
.question-kicker { padding: 6px 9px; border-radius: 999px; background: rgba(245,179,53,.17); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--orange-dark); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.question-instruction-copy { color: var(--muted); font-size: 12px; line-height: 1.45; }
.selection-count { color: var(--blue); font-size: 11px; font-weight: 800; white-space: nowrap; }
.question-title { max-width: 860px; margin: 16px 0 25px; color: var(--navy); font-size: clamp(23px, 3vw, 34px); line-height: 1.28; letter-spacing: -.025em; }
.answer-list { display: grid; gap: 12px; }
.answer-option { display: grid; grid-template-columns: 26px 1fr; gap: 14px; align-items: start; margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: #FCFDFE; cursor: pointer; color: var(--ink); font-weight: 520; line-height: 1.48; transition: border .18s ease, background .18s ease, transform .18s ease; }
.answer-option:hover { border-color: var(--blue-light); transform: translateX(2px); }
.answer-option:has(input:checked) { border-color: var(--navy); background: rgba(23,45,87,.055); box-shadow: inset 4px 0 0 var(--orange); }
.risk-answer { appearance: none; width: 22px; height: 22px; margin: 1px 0 0; border: 2px solid #A9B5C8; border-radius: 5px; background: white; display: grid; place-items: center; }
.risk-answer::after { content: "✓"; color: var(--ink); font-size: 15px; font-weight: 900; transform: scale(0); transition: transform .12s ease; }
.risk-answer:checked { background: var(--orange); border-color: var(--orange); }
.risk-answer:checked::after { transform: scale(1); }
.option-letter { color: var(--blue); font-weight: 800; margin-right: 4px; }

.question-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.question-map { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 22px; }
.progress-dot { width: 10px; height: 10px; border: 0; border-radius: 50%; padding: 0; background: #CDD5E1; cursor: pointer; transition: all .18s ease; }
.progress-dot.answered { background: var(--blue); }
.progress-dot.current { width: 26px; border-radius: 999px; background: var(--orange); }

.result-wrap { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 52px 0; }
.result-card { width: min(780px, 100%); padding: clamp(34px, 6vw, 68px); text-align: center; }
.result-seal { width: 82px; height: 82px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 26px; background: var(--navy); color: var(--orange); font-size: 38px; box-shadow: 8px 8px 0 rgba(245,179,53,.35); }
.result-card h1 { margin: 0; color: var(--navy); font-family: Charter, Georgia, serif; font-size: clamp(43px, 7vw, 70px); letter-spacing: -.035em; }
.score-big { margin: 22px 0 5px; color: var(--blue); font-size: 30px; font-weight: 850; }
.result-sub { color: var(--muted); font-size: 16px; }
.score-method { margin: 6px 0 0; color: var(--blue); font-size: 13px; font-weight: 750; }
.result-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.failed .result-seal { background: var(--ink); color: #FFF; box-shadow: 8px 8px 0 rgba(159,58,56,.25); }
.retry-note { max-width: 600px; margin: 28px auto 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--ink); line-height: 1.65; }
.retry-note a { color: var(--blue); font-weight: 800; }
.verification-card { width: min(720px, 100%); padding: clamp(34px, 6vw, 64px); text-align: center; }
.verification-card h1 { margin: 8px 0 28px; color: var(--navy); font-size: clamp(36px, 6vw, 58px); }
.verification-data { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0; margin: 0 auto; max-width: 560px; text-align: left; border-top: 1px solid var(--line); }
.verification-data dt, .verification-data dd { margin: 0; padding: 14px 10px; border-bottom: 1px solid var(--line); }
.verification-data dt { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.verification-data dd { color: var(--navy); font-weight: 750; }
.verification-card.invalid .result-seal { background: var(--ink); color: var(--white); box-shadow: none; }

.admin-wrap { padding: 46px 0 74px; }
.admin-login { min-height: calc(100vh - 160px); display: grid; place-items: center; }
.admin-login .card { width: min(430px, 100%); padding: 38px; }
.admin-grid { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.admin-card { padding: 26px; }
.admin-stat { padding: 18px; background: var(--navy); color: white; border-radius: 14px; margin-bottom: 16px; }
.admin-stat strong { display: block; font-size: 30px; color: var(--orange); }
.editor-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.admin-option-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: center; padding: 12px 14px 0; border: 1px solid var(--line); border-radius: 12px; background: #FAFBFD; margin-bottom: 10px; }
.admin-option-row .form-group { margin-bottom: 12px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.results-table { overflow-x: auto; margin-top: 20px; }
.table { color: var(--ink); }
.table > thead > tr > th { color: var(--navy); border-bottom: 2px solid var(--orange); }

.site-footer { padding: 22px 0 28px; text-align: center; color: var(--muted); font-size: 12px; }
.site-footer .action-button { border: 0; background: transparent; color: var(--blue); text-decoration: underline; padding: 0; }
.help-block { color: var(--muted); font-size: 12px; }
.shiny-notification { border-radius: 12px; border: 0; box-shadow: var(--shadow); }
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }

@media (max-width: 820px) {
  .hero-grid, .admin-grid { grid-template-columns: 1fr; }
  .hero-grid { min-height: auto; padding-top: 46px; }
  .hero-title { font-size: 52px; }
  .site-header { height: 76px; padding: 0 18px; }
  .brand-sub { display: none; }
  .main-stage { width: min(100% - 24px, 720px); }
  .header-meta .status-chip { display: none; }
}

@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .hero-title { font-size: 43px; }
  .hero-copy { font-size: 16px; }
  .question-card { border-radius: 16px; padding: 24px 18px; }
  .question-title { font-size: 23px; }
  .question-instruction { grid-template-columns: 1fr auto; }
  .question-instruction-copy { grid-column: 1 / -1; grid-row: 2; }
  .question-footer { flex-direction: column-reverse; }
  .question-footer .btn { width: 100%; }
  .admin-option-row { grid-template-columns: 1fr; }
  .editor-heading { display: block; }
  .verification-data { grid-template-columns: 1fr; }
  .verification-data dt { padding-bottom: 3px; border-bottom: 0; }
  .verification-data dd { padding-top: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Focused certification layout */
body::before { display: none; }
.risknet-logo { display: block; width: auto; height: 54px; max-width: min(300px, 48vw); object-fit: contain; }
.certified-by {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  min-height: 74px; padding: 14px 24px; color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  border-top: 1px solid var(--line); background: var(--white);
}
.certified-by img { width: min(310px, 62vw); height: 48px; object-fit: contain; }
.intro-wrap { width: min(860px, 100%); margin: 0 auto; padding: 52px 0 62px; }
.intro-card { padding: clamp(28px, 5vw, 52px); }
.intro-card h1 { margin: 14px 0 16px; color: var(--navy); font-size: clamp(30px, 5vw, 46px); line-height: 1.12; letter-spacing: -.03em; }
.training-code { color: var(--orange-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 850; letter-spacing: .08em; }
.intro-lead { max-width: 720px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.exam-rules { display: grid; grid-template-columns: repeat(3, 1fr); margin: 28px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.rule { padding: 17px 18px; border-right: 1px solid var(--line); background: #FBFCFE; }
.rule:last-child { border-right: 0; }
.rule strong, .rule span { display: block; }
.rule strong { color: var(--navy); font-size: 17px; }
.rule span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.rules-list { margin: 0 0 26px; padding-left: 22px; color: var(--ink); line-height: 1.6; }
.rules-list li { margin: 8px 0; padding-left: 5px; }
.rules-list li::marker { color: var(--orange-dark); }
.identity-card { margin: 26px 0 18px; padding: 18px 20px; border-left: 4px solid var(--orange); background: rgba(23,45,87,.045); border-radius: 0 10px 10px 0; }
.identity-label { color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.identity-name { margin-top: 6px; color: var(--navy); font-size: 20px; font-weight: 800; }
.identity-email { color: var(--muted); font-size: 13px; }
.access-note { padding: 17px 18px; border-radius: 10px; background: #F1F4F8; color: var(--muted); line-height: 1.55; }
.access-note strong, .access-note span { display: block; }
.access-note strong { color: var(--navy); margin-bottom: 4px; }
.admin-entry-link { display: inline-flex; margin-top: 18px; color: var(--blue); font-size: 13px; font-weight: 800; text-decoration: none; }
.admin-entry-link:hover, .admin-entry-link:focus { color: var(--orange-dark); }
.exam-shell { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 22px; align-items: start; padding: 40px 0 56px; }
.exam-shell .exam-layout { padding: 0; }
.question-index-card { position: sticky; top: 98px; padding: 16px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.question-index-title { margin: 2px 7px 11px; color: var(--navy); font-size: 12px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.question-index-list { display: grid; gap: 4px; max-height: 544px; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; }
.question-index-item { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 34px; padding: 6px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.question-index-item:hover { background: #F2F5F9; color: var(--navy); }
.question-index-item.current { background: var(--navy); color: var(--white); }
.question-index-item .index-state { color: #A9B2C1; font-size: 14px; font-weight: 850; }
.question-index-item.answered .index-state { color: var(--orange-dark); }
.question-index-item.current .index-state { color: var(--orange); }
.timer-chip.btn { min-width: 116px; min-height: 48px; border: 1px solid rgba(255,255,255,.32); box-shadow: none; background: var(--ink); color: var(--white); padding: 11px 18px; font-size: 16px; letter-spacing: .04em; }
.timer-chip.btn:hover, .timer-chip.btn:focus { border-color: var(--orange); background: var(--blue); color: var(--white); transform: none; }
.time-notice {
  display: inline-flex; align-items: center; min-height: 48px; padding: 10px 18px;
  border: 1px solid rgba(245,179,53,.75); border-radius: 999px;
  background: var(--orange); color: var(--ink); box-shadow: 0 8px 22px rgba(16,31,61,.22);
  font-size: 13px; font-weight: 850; letter-spacing: .02em; white-space: nowrap;
  opacity: 0; transform: translateY(-5px); transition: opacity .2s ease, transform .2s ease;
}
.time-notice.visible { opacity: 1; transform: translateY(0); }
.time-notice.leaving { opacity: 0; transform: translateY(-5px); }
.timer-detail-value { color: var(--navy); font-size: 38px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 820px) {
  .exam-shell { grid-template-columns: 1fr; padding-top: 24px; }
  .question-index-card { position: static; padding: 10px; }
  .question-index-title { display: none; }
  .question-index-list { grid-auto-flow: column; grid-auto-columns: 44px; grid-template-rows: 1fr; overflow-x: auto; overflow-y: hidden; max-height: none; }
  .question-index-item { min-width: 42px; justify-content: center; gap: 5px; }
  .question-index-item .index-state { display: none; }
}

@media (max-width: 520px) {
  .exam-rules { grid-template-columns: 1fr; }
  .rule { border-right: 0; border-bottom: 1px solid var(--line); }
  .rule:last-child { border-bottom: 0; }
  .risknet-logo { height: 44px; max-width: 54vw; }
  .time-notice { position: fixed; top: 82px; right: 17px; min-height: 42px; padding: 8px 14px; }
}
