
:root {
  --bg: #07111f;
  --panel: rgba(255,255,255,.075);
  --panel-2: rgba(255,255,255,.11);
  --stroke: rgba(255,255,255,.14);
  --text: #eef6ff;
  --muted: #aab8cb;
  --accent: #37d399;
  --accent-2: #59b8ff;
  --danger: #ff6b6b;
  --warning: #ffd166;
  --shadow: 0 24px 80px rgba(0,0,0,.35);
  --radius: 22px;
  --radius-sm: 14px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at 15% 8%, rgba(55,211,153,.16), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(89,184,255,.15), transparent 33%),
    linear-gradient(145deg, #06101d 0%, #0b1728 45%, #111827 100%);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 24px 0 44px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06101d; font-weight: 900; box-shadow: var(--shadow); }
.brand h1 { margin: 0; font-size: clamp(22px, 3vw, 34px); line-height: 1.1; }
.brand p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.card { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.hero { padding: clamp(18px, 4vw, 34px); display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.hero h2 { margin: 0 0 12px; font-size: clamp(26px, 4vw, 48px); line-height: 1.12; }
.hero .lead { color: var(--muted); font-size: 17px; line-height: 1.9; margin: 0 0 18px; }
.badges { display: flex; flex-wrap: wrap; gap: 9px; }
.badge { border: 1px solid var(--stroke); background: rgba(255,255,255,.08); color: var(--text); padding: 8px 11px; border-radius: 999px; font-size: 13px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 18px; border-radius: 18px; background: rgba(255,255,255,.08); border: 1px solid var(--stroke); }
.stat strong { display: block; font-size: 28px; margin-bottom: 3px; }
.stat span { color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; margin-top: 16px; }
.panel { padding: 20px; }
.panel h3 { margin: 0 0 14px; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-size: 14px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--stroke); color: var(--text); background: rgba(0,0,0,.22);
  padding: 12px 13px; border-radius: 14px; outline: none;
}
.textarea { min-height: 190px; resize: vertical; direction: ltr; text-align: left; }
.checks { display: grid; gap: 10px; margin-top: 13px; }
.check { display: flex; gap: 10px; align-items: center; color: var(--text); padding: 11px; border: 1px solid var(--stroke); border-radius: 14px; background: rgba(255,255,255,.05); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn { border: 0; border-radius: 14px; padding: 12px 16px; background: rgba(255,255,255,.1); color: var(--text); border: 1px solid var(--stroke); font-weight: 700; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06101d; border: 0; }
.btn.danger { background: rgba(255,107,107,.12); border-color: rgba(255,107,107,.35); color: #ffd7d7; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.notice { border: 1px solid rgba(255,209,102,.4); background: rgba(255,209,102,.11); color: #fff5d5; padding: 13px; border-radius: 16px; line-height: 1.75; margin-top: 14px; }
.small { color: var(--muted); font-size: 13px; line-height: 1.65; }
.exam-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.sidebar { padding: 16px; position: sticky; top: 16px; height: fit-content; }
.timer { padding: 16px; border-radius: 18px; background: rgba(0,0,0,.22); border: 1px solid var(--stroke); text-align: center; }
.timer strong { display: block; font-size: 34px; letter-spacing: 1px; direction: ltr; }
.timer span { color: var(--muted); font-size: 13px; }
.progress-wrap { margin: 14px 0; }
.progress-line { height: 10px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; border: 1px solid var(--stroke); }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0%; transition: width .25s ease; }
.qnav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.qbtn { height: 38px; border-radius: 12px; border: 1px solid var(--stroke); background: rgba(255,255,255,.07); color: var(--text); font-weight: 700; }
.qbtn.current { outline: 2px solid var(--accent-2); }
.qbtn.answered { background: rgba(55,211,153,.18); border-color: rgba(55,211,153,.5); }
.qbtn.marked { box-shadow: inset 0 -4px 0 var(--warning); }
.question-card { padding: clamp(18px, 3vw, 30px); min-height: 520px; display: flex; flex-direction: column; }
.question-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.question-text { font-size: clamp(20px, 2.5vw, 28px); line-height: 1.8; margin: 6px 0 20px; }
.choices { display: grid; gap: 12px; }
.choice { text-align: right; width: 100%; border: 1px solid var(--stroke); background: rgba(255,255,255,.07); color: var(--text); padding: 16px; border-radius: 16px; display: flex; gap: 12px; align-items: flex-start; line-height: 1.7; }
.choice:hover { background: rgba(255,255,255,.11); }
.choice .letter { width: 30px; min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.12); font-weight: 900; }
.choice.selected { border-color: var(--accent-2); background: rgba(89,184,255,.13); }
.choice.correct { border-color: rgba(55,211,153,.75); background: rgba(55,211,153,.18); }
.choice.wrong { border-color: rgba(255,107,107,.75); background: rgba(255,107,107,.14); }
.explain { margin-top: 16px; padding: 15px; border-radius: 16px; border: 1px solid rgba(55,211,153,.35); background: rgba(55,211,153,.09); line-height: 1.85; }
.explain strong { display: block; margin-bottom: 5px; }
.question-actions { margin-top: auto; padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.result-hero { padding: 26px; display: grid; grid-template-columns: 1fr .7fr; gap: 16px; }
.score { display: grid; place-items: center; min-height: 220px; border-radius: 22px; background: rgba(255,255,255,.08); border: 1px solid var(--stroke); }
.score strong { font-size: clamp(54px, 8vw, 88px); line-height: 1; }
.score span { color: var(--muted); }
.table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 16px; }
.table th, .table td { border-bottom: 1px solid var(--stroke); padding: 12px; text-align: right; }
.table th { color: var(--muted); font-size: 13px; font-weight: 700; }
.review-list { display: grid; gap: 12px; margin-top: 14px; }
.review-item { padding: 14px; border: 1px solid var(--stroke); border-radius: 16px; background: rgba(255,255,255,.06); line-height: 1.75; }
.review-item .ok { color: var(--accent); font-weight: 800; }
.review-item .bad { color: var(--danger); font-weight: 800; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: grid; place-items: center; padding: 18px; z-index: 10; }
.modal { width: min(900px, 100%); max-height: 92vh; overflow: auto; padding: 20px; }
.hidden { display: none !important; }
@media (max-width: 850px) {
  .hero, .grid.two, .exam-layout, .result-hero { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .qnav { grid-template-columns: repeat(6, 1fr); }
}
