:root {
  --blue: #183f8c;
  --blue-ink: #0f2a5f;
  --blue-soft: #e8eefb;
  --orange: #ef7d00;
  --orange-soft: #fff1df;
  --red: #c8372d;
  --red-soft: #fdecea;
  --green: #1f8a4c;
  --green-soft: #e6f5ec;
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1d2433;
  --muted: #5d6576;
  --line: #e2ddd2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 42, 95, .06), 0 6px 20px rgba(15, 42, 95, .06);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--blue-ink); }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -.02em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.wrap {
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: 20px;
}

main { padding-block: 28px 48px; outline: none; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}

.topbar-inner {
  max-width: 1140px;
  margin-inline: auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
}
.brand b { color: #ffc27a; }

.brand-flag {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  width: 28px;
  height: 20px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
}
.brand-flag i:nth-child(1) { background: #c8372d; }
.brand-flag i:nth-child(2) { background: #fff; }
.brand-flag i:nth-child(3) { background: #21468b; }

.nav { display: flex; gap: 4px; }
.nav a {
  color: #dfe7fb;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--blue); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 2px solid transparent;
  font: 600 1rem var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .1s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: #d96f00; }
.btn-ghost { background: var(--card); color: var(--blue); border-color: #c9d4ee; }
.btn-ghost:hover { border-color: var(--blue); }
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- home ---------- */

.banner {
  background: var(--orange-soft);
  border: 1px solid #f6c98f;
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 20px;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: center;
  padding-block: 12px 28px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: .6em;
}
.hero h1 span { color: var(--orange); white-space: nowrap; }
.lead { font-size: 1.12rem; color: #3a4357; max-width: 36em; }
.muted { color: var(--muted); }

.hero-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  transform: rotate(1.5deg);
}
.hero-collage img {
  border-radius: 12px;
  aspect-ratio: 762 / 506;
  object-fit: cover;
  box-shadow: var(--shadow);
  border: 4px solid #fff;
}
.hero-collage img:nth-child(2) { transform: translateY(18px); }
.hero-collage img:nth-child(4) { transform: translateY(18px); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-block: 28px;
}
.stat {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.stat b { font-size: 1.8rem; color: var(--blue); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .95rem; }

.section { margin-top: 36px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cards3 .num {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 10px;
}
.cards3 p { color: #3a4357; margin: 0; }

.tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.tips li {
  background: var(--card);
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  padding: 12px 16px;
}

/* ---------- practice list ---------- */

.page-head { margin-bottom: 22px; }
.page-head p { color: var(--muted); max-width: 40em; }

.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.scene-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.scene-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(15, 42, 95, .14); }
.scene-card img { aspect-ratio: 762 / 506; object-fit: cover; width: 100%; height: auto; }
.scene-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.scene-card h3 { margin: 0; }
.kind { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }

.badge {
  align-self: flex-start;
  margin-top: auto;
  font-size: .82rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eeece6;
  color: var(--muted);
}
.badge-good { background: var(--green-soft); color: var(--green); }
.badge-mid { background: var(--orange-soft); color: #a35400; }

/* ---------- scene layout ---------- */

.crumbs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: .95rem;
}
.crumbs a { text-decoration: none; font-weight: 600; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.scene-title { font-size: 1.6rem; }

.photo { margin: 0 0 14px; }
.photo img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  aspect-ratio: 762 / 506;
  object-fit: cover;
  box-shadow: var(--shadow);
}
.intro {
  font-weight: 600;
  color: var(--blue-ink);
  background: var(--blue-soft);
  border-radius: 10px;
  padding: 10px 14px;
}
.reading { display: grid; gap: 14px; }

.split-questions {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.qhead { font-weight: 700; color: var(--muted); font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- questions ---------- */

.q { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.q legend { font-weight: 600; font-size: 1.08rem; margin-bottom: 10px; padding: 0; }
.q-num {
  display: block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--orange);
  font-weight: 700;
  margin-bottom: 2px;
}
.opts { display: grid; gap: 8px; }

.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  transition: border-color .12s, background .12s;
}
.opt:hover { border-color: #b9c6e6; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.letter {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f0eee8;
  font-weight: 700;
  color: var(--muted);
}
.opt:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.opt:has(input:checked) .letter { background: var(--blue); color: #fff; }
.opt:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }
.opt:has(input:disabled) { cursor: default; }

.q .opt.is-correct { border-color: var(--green); background: var(--green-soft); }
.q .opt.is-correct .letter { background: var(--green); color: #fff; }
.opt.is-correct::after { content: "✓"; margin-left: auto; color: var(--green); font-weight: 700; }
.q .opt.is-wrong { border-color: var(--red); background: var(--red-soft); }
.q .opt.is-wrong .letter { background: var(--red); color: #fff; }
.opt.is-wrong::after { content: "✗"; margin-left: auto; color: var(--red); font-weight: 700; }

.why {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .96rem;
}
.q-good .why { background: var(--green-soft); }
.q-good .why strong { color: var(--green); }
.q-bad .why { background: var(--red-soft); }
.q-bad .why strong { color: var(--red); }

.check-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.feedback { margin: 0; font-weight: 700; }
.feedback.good { color: var(--green); }
.feedback.mid { color: #a35400; }

.words {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 16px;
}
.words summary { cursor: pointer; font-weight: 600; padding: 8px 0; color: var(--blue); }
.words summary span { font-weight: 400; color: var(--muted); font-size: .9rem; }
.words dl { margin: 4px 0 12px; display: grid; gap: 0; }
.words dl div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px dashed var(--line); }
.words dt { font-weight: 600; }
.words dd { margin: 0; color: var(--muted); text-align: right; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ---------- reading documents ---------- */

.doc {
  border-radius: 12px;
  padding: 18px 20px;
  font-size: 1.05rem;
  background: #fff;
  box-shadow: var(--shadow);
}
.doc h3 { font-size: 1.3rem; }
.doc h4 { margin-top: 14px; font-size: 1rem; }
.doc p:last-child, .doc ul:last-child, .doc ol:last-child { margin-bottom: 0; }
.doc ul, .doc ol { margin: 0 0 .8em; padding-left: 1.3em; }
.doc li { margin-bottom: 3px; }
.doc-kicker { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; opacity: .75; }
.doc-small { font-size: .93rem; opacity: .85; }
.doc .big { font-size: 1.3rem; font-weight: 700; }
.doc .warn { font-weight: 700; }
.doc dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 .9em; }
.doc dt { font-weight: 600; opacity: .7; }
.doc dd { margin: 0; font-weight: 600; }

.prices { list-style: none; padding: 0 !important; }
.prices li { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.prices i { flex: 1; border-bottom: 2px dotted currentColor; opacity: .35; min-width: 16px; }
.prices b { white-space: nowrap; }
.prices .hl { background: #ffe14d; color: #1d2433; margin-inline: -8px; padding: 2px 8px; border-radius: 6px; }

/* folder / advertisement */
.doc-ad { background: #fff7d6; border: 3px solid #f6c400; }
.doc-ad h3 { color: #c8372d; font-size: 1.6rem; letter-spacing: .02em; }

/* sale sign */
.doc-sale { background: var(--red); color: #fff; text-align: center; }
.doc-sale h3 { color: #fff; font-size: 2rem; letter-spacing: .1em; }
.doc-sale .big { background: #fff; color: var(--red); border-radius: 8px; padding: 6px 10px; }

/* departure board */
.doc-board { background: #13254d; color: #fff; padding: 12px; overflow-x: auto; }
.doc-board table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.doc-board th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #9fb3e0; padding: 6px 10px; }
.doc-board td { padding: 9px 10px; border-top: 1px solid rgba(255, 255, 255, .12); font-weight: 600; }
.doc-board td:first-child { color: #ffd34d; }
.doc-board td:last-child { text-align: center; background: rgba(255, 255, 255, .1); }

/* text messages */
.doc-sms { background: #e9eef3; display: grid; gap: 8px; justify-items: start; }
.sms-from { font-weight: 700; font-size: .9rem; color: var(--muted); margin: 0; }
.bubble {
  background: #fff;
  border-radius: 4px 16px 16px 16px;
  padding: 10px 14px;
  max-width: 92%;
  margin: 0;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .06);
}

/* appointment card / letter */
.doc-card { border-left: 6px solid var(--blue); }
.doc-card h3 { color: var(--blue); }
.doc-letter { border-top: 6px solid var(--blue); font-family: Georgia, "Times New Roman", serif; }

/* blue signs */
.doc-sign { background: var(--blue); color: #fff; }
.doc-sign h3 { color: #fff; border-bottom: 2px solid rgba(255, 255, 255, .3); padding-bottom: 8px; }
.doc-sign .warn { background: #fff; color: var(--red); border-radius: 8px; padding: 8px 12px; }
.doc-sign-green { background: #23663f; }

/* menu */
.doc-menu { background: #fbf8f1; border: 1px solid #d9cfba; font-family: Georgia, "Times New Roman", serif; }
.doc-menu h3, .doc-menu h4 { color: #5b3a1a; }

/* email */
.doc-email .mail-head {
  background: #f3f5f9;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: .95rem;
}
.doc-email .mail-head p { margin: 0; }
.doc-email .mail-head span { display: inline-block; min-width: 92px; color: var(--muted); }

/* recipe */
.doc-recipe {
  background: #fffdf6 repeating-linear-gradient(#fffdf6 0 31px, #e9e2cf 31px 32px);
  border-left: 4px solid #e6a1a1;
}
.doc-recipe h3 { color: #8a3b12; }

/* pharmacy label */
.doc-label { border: 2px solid #2a8a3e; position: relative; padding-left: 28px; }
.doc-label::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 10px; background: #2a8a3e; border-radius: 10px 0 0 10px; }
.doc-label h3 { color: #1f6b30; }
.doc-label .warn { color: var(--red); }

/* information notice */
.doc-notice { border-top: 6px solid var(--orange); }
.doc-notice .hlbox { background: var(--orange-soft); border-radius: 8px; padding: 10px 14px; }

/* chalkboard */
.doc-chalk { background: #2c3330; color: #f4f1e8; font-family: "Segoe Print", "Comic Sans MS", var(--font); }
.doc-chalk h3 { color: #fff; }
.doc-chalk .big { color: #ffd34d; }

/* ---------- exam ---------- */

.exam-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.exam-option ul { list-style: none; padding: 0; margin: 0 0 18px; color: #3a4357; }
.exam-option li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.rules ul { margin: 0; padding-left: 1.2em; color: #3a4357; }
.rules li { margin-bottom: 4px; }

.table-wrap { overflow-x: auto; }
.history { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.history th, .history td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.history th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.history tr.pass td:last-child { color: var(--green); font-weight: 700; }
.history tr.fail td:last-child { color: var(--red); font-weight: 700; }

.exam-bar {
  position: sticky;
  top: 58px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 16px;
  margin-bottom: 14px;
}
.exam-bar-info { display: flex; flex-direction: column; }
.exam-bar-info span { color: var(--muted); font-size: .92rem; }
.timer {
  font: 700 1.5rem var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 4px 14px;
  border-radius: 10px;
}
.timer.low { color: #fff; background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .75; } }

.dots { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 6px; }
.dots button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: #fff;
  font: 600 .95rem var(--font);
  color: var(--muted);
  cursor: pointer;
}
.dots button.done { background: var(--blue-soft); border-color: #b9c6e6; color: var(--blue); }
.dots button.current { border-color: var(--orange); color: var(--ink); box-shadow: 0 0 0 2px var(--orange-soft); }

.submit-early { text-align: center; margin: 14px 0 0; font-size: .95rem; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 25, 50, .45);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-card { background: #fff; border-radius: var(--radius); padding: 24px; max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }

/* ---------- result ---------- */

.result-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.ring {
  --c: var(--green);
  width: 160px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #ece9e1 0);
  display: grid;
  place-items: center;
}
.fail .ring { --c: var(--orange); }
.ring span {
  width: 76%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--blue-ink);
}

.review-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); }
.toggle input { width: 18px; height: 18px; accent-color: var(--blue); }

.review { margin-bottom: 16px; }
.review header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.review header h3 { margin: 0; }
.review header .badge { margin: 0; }
.review-text { margin-bottom: 16px; }
.review-text summary { cursor: pointer; color: var(--blue); font-weight: 600; margin-bottom: 10px; }
.review-text .photo { max-width: 420px; }
.review .more { font-weight: 600; text-decoration: none; }
.only-wrong .review.all-ok { display: none; }

/* ---------- footer ---------- */

.footer { color: var(--muted); font-size: .88rem; padding-block: 24px 40px; border-top: 1px solid var(--line); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-collage { transform: none; max-width: 520px; }
  .split { grid-template-columns: 1fr; }
  .cards3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar-inner { padding: 8px 12px; flex-wrap: nowrap; gap: 8px; }
  .brand { font-size: .95rem; gap: 8px; }
  .nav { gap: 0; }
  .nav a { padding: 6px 9px; font-size: .95rem; }
  .wrap { padding-inline: 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: span 2; }
  .exam-options { grid-template-columns: 1fr; }
  .result-head { grid-template-columns: 1fr; justify-items: start; padding: 22px; }
  .ring { width: 130px; }
  .split-questions { padding: 18px 16px; }
  .exam-bar { top: 54px; }
  .pager .btn { padding-inline: 14px; }
}
