:root {
  --bg: #f3f7fd;
  --card: #ffffff;
  --text: #13213a;
  --muted: #65718a;
  --primary: #1c68d5;
  --primary-dark: #104b9d;
  --navy: #102a56;
  --accent: #f5aa20;
  --good: #12824b;
  --good-soft: #eaf8f0;
  --bad: #c73535;
  --bad-soft: #fff0f0;
  --border: #dce5f1;
  --shadow: 0 18px 46px rgba(29, 53, 87, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at 8% 0%, rgba(66, 139, 235, .18), transparent 28%),
    radial-gradient(circle at 92% 8%, rgba(245, 170, 32, .13), transparent 22%),
    var(--bg);
  color: var(--text);
}

button, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
#app { max-width: 1180px; margin: 0 auto; padding: 28px; }

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px;
  border-radius: 26px;
  background: linear-gradient(135deg, #0b2148 0%, #1554a7 55%, #1f76e3 100%);
  color: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  right: -80px;
  top: -110px;
  border: 42px solid rgba(255,255,255,.07);
}
.hero > * { position: relative; z-index: 1; }
.kicker, .eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 900;
  font-size: .76rem;
}
.kicker { opacity: .82; margin: 0 0 9px; }
.eyebrow { display: inline-block; color: var(--primary); margin-bottom: 7px; }
h1 { font-size: clamp(2.1rem, 5vw, 4.25rem); line-height: .98; margin: 0; letter-spacing: -.035em; }
h2 { letter-spacing: -.02em; }
.subtitle { margin: 14px 0 0; font-size: 1.08rem; line-height: 1.6; max-width: 720px; opacity: .92; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
main { margin-top: 22px; }

.panel {
  background: rgba(255,255,255,.95);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.start-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 26px; align-items: stretch; }
.intro-card {
  background: linear-gradient(155deg, #eef5ff, #f8fbff);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid #d6e5fb;
}
.intro-card h3 { margin-top: 0; }
.feature-list { padding-left: 22px; margin-bottom: 0; }
.feature-list li { margin: 12px 0; line-height: 1.5; }
label { display: block; margin: 18px 0 8px; font-weight: 850; }
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
  outline: none;
}
select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(28,104,213,.12); }

button {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .08s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); }
button:focus-visible { outline: 3px solid rgba(245,170,32,.55); outline-offset: 2px; }
button:disabled { cursor: default; }
.primary { background: var(--primary); color: #fff; }
.primary:hover:not(:disabled) { background: var(--primary-dark); }
.secondary { background: #e9f2ff; color: #104b9d; }
.ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.32); }
.wide { margin-top: 22px; width: 100%; }
.hidden { display: none !important; }

.dashboard {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.metric {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(31,47,84,.05);
  min-width: 0;
}
.metric span { display: block; color: var(--muted); font-size: .78rem; font-weight: 800; }
.metric strong { font-size: 1.22rem; display: block; margin-top: 4px; overflow-wrap: anywhere; }
.score-metric { background: linear-gradient(145deg, #102a56, #174f9b); color: #fff; border-color: transparent; }
.score-metric span { color: rgba(255,255,255,.72); }

.progress-wrap { margin: 20px 0; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; font-weight: 850; color: var(--muted); margin-bottom: 8px; }
.progress-bar { height: 12px; background: #dce6f3; border-radius: 999px; overflow: hidden; }
#progressFill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--primary)); transition: width .3s ease; }

.scenario-card h2 { margin: 13px 0 12px; font-size: clamp(1.6rem, 3vw, 2.15rem); }
.scenario-text { font-size: 1.04rem; line-height: 1.7; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-flex; padding: 7px 11px; border-radius: 999px; background: #e7f1ff; color: #0f4da8; font-weight: 850; font-size: .8rem; }
.tag.muted { background: #f0f2f6; color: var(--muted); }
.tag.challenge { background: #fff5d8; color: #8a5a00; }
.choose-note { margin: 20px 0 0; padding: 11px 13px; border-radius: 12px; background: #f6f8fb; color: var(--muted); font-size: .92rem; }
.options { display: grid; gap: 12px; margin-top: 14px; }
.option-btn {
  text-align: left;
  background: #fff;
  color: var(--text);
  border: 2px solid var(--border);
  padding: 17px;
  box-shadow: 0 7px 18px rgba(31,47,84,.045);
}
.option-btn:hover:not(:disabled) { border-color: var(--primary); background: #f8fbff; }
.option-btn:disabled { opacity: 1; }
.option-btn.correct { border-color: var(--good); background: var(--good-soft); }
.option-btn.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option-btn.dimmed { opacity: .58; }
.option-title { display: block; font-weight: 900; margin-bottom: 5px; font-size: 1rem; }
.option-impact { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.option-state { display: inline-flex; margin-top: 9px; font-size: .82rem; font-weight: 900; }
.option-btn.correct .option-state { color: var(--good); }
.option-btn.wrong .option-state { color: var(--bad); }

.feedback { margin-top: 16px; border-left: 7px solid var(--primary); }
.feedback.good { border-left-color: var(--good); }
.feedback.bad { border-left-color: var(--bad); }
.feedback-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.feedback-heading h3 { margin: 3px 0 0; }
.feedback-badge { margin: 0; color: var(--muted); font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.round-score { min-width: 64px; text-align: center; border-radius: 14px; padding: 10px; font-weight: 950; font-size: 1.1rem; background: #f1f5fa; }
.feedback.good .round-score { background: var(--good-soft); color: var(--good); }
.feedback.bad .round-score { background: var(--bad-soft); color: var(--bad); }
.feedback #feedbackText { line-height: 1.65; }
.exam-tip { display: grid; gap: 5px; margin: 18px 0; padding: 15px; border-radius: 15px; background: #fff8e8; border: 1px solid #ffe1a4; line-height: 1.5; }
.exam-tip strong { color: #805100; }

.result-hero { text-align: center; padding: 4px 0 16px; }
.result-hero h2 { margin: 6px 0 18px; font-size: clamp(2rem, 4vw, 3.1rem); }
.score-ring {
  width: 180px;
  height: 180px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-content: center;
  background: radial-gradient(circle at center, #fff 54%, transparent 55%), conic-gradient(var(--primary) 0deg 270deg, #e3eaf3 270deg 360deg);
  box-shadow: inset 0 0 0 1px #e3eaf3, 0 14px 30px rgba(31,47,84,.08);
}
.score-ring strong { font-size: 2.35rem; line-height: 1; }
.score-ring span { margin-top: 8px; color: var(--muted); font-size: .82rem; font-weight: 800; }
.result-message { max-width: 720px; margin: 18px auto 0; line-height: 1.6; color: var(--muted); }

.report { display: grid; gap: 14px; margin: 18px 0; }
.report-card { border: 1px solid var(--border); border-radius: 18px; padding: 19px; background: #f8fbff; }
.report-card h3 { margin-top: 0; }
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.report-stat { font-size: 1.35rem; margin-top: 5px; display: block; }
.review-list { margin: 0; padding-left: 22px; }
.review-list li { margin: 10px 0; line-height: 1.5; }
.review-list .correct-text { color: var(--good); }
.review-list .wrong-text { color: var(--bad); }
.final-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

.modal { position: fixed; inset: 0; background: rgba(8,15,30,.58); display: grid; place-items: center; padding: 20px; z-index: 20; }
.modal-content { max-width: 680px; width: 100%; background: #fff; border-radius: 24px; padding: 28px; box-shadow: var(--shadow); position: relative; max-height: 90vh; overflow-y: auto; }
.modal-content p { line-height: 1.6; }
.close { position: absolute; top: 12px; right: 12px; border-radius: 50%; width: 38px; height: 38px; padding: 0; background: #eef2f7; color: var(--text); font-size: 1.3rem; }

@media (max-width: 1000px) {
  .dashboard { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 850px) {
  #app { padding: 14px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 24px; }
  .start-grid { grid-template-columns: 1fr; }
  .dashboard { grid-template-columns: repeat(2, 1fr); }
  .report-grid { grid-template-columns: 1fr; }
  .panel { padding: 21px; }
  .final-actions { flex-direction: column; align-items: stretch; }
}
@media (max-width: 520px) {
  .dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-metric { grid-column: 1 / -1; }
  .progress-label { font-size: .88rem; }
  .feedback-heading { align-items: flex-start; }
  .score-ring { width: 155px; height: 155px; }
  .score-ring strong { font-size: 2rem; }
}
