/* IELTS Path — plain CSS design system */
:root {
  --ink: #14213d;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f7f8fb;
  --surface: #fff;
  --brand-50: #eef4ff;
  --brand-100: #dbe7ff;
  --brand-500: #3461d1;
  --brand-600: #2449b0;
  --brand-700: #1c3a8c;
  --accent: #f5a524;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --warn: #d97706;
  --radius: 14px;
  --font-sans: "Be Vietnam Pro", system-ui, sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
::selection { background: #fde68a; }
[hidden] { display: none !important; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 440px; margin: 0 auto; padding: 64px 16px; }
.page { padding-top: 40px; padding-bottom: 64px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.xs { font-size: 12px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.title { font-size: 30px; font-weight: 700; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.row { display: flex; align-items: center; gap: 8px; }
.spacer { margin-left: auto; }

/* Buttons, cards, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 16px; font: 600 14px var(--font-sans); cursor: pointer; transition: background .15s, opacity .15s; color: var(--ink); background: transparent; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-700); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-outline { border: 1px solid #cbd5e1; background: #fff; }
.btn-outline:hover { background: #f8fafc; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-sm { padding: 6px 12px; }
.btn:focus-visible, .input:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.card-pad { padding: 24px; }
.input { width: 100%; border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 12px; font: 14px var(--font-sans); background: #fff; color: var(--ink); }
.input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); outline: none; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.alert { border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: var(--bad-bg); color: #b91c1c; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 4px solid var(--brand-100); border-top-color: var(--brand-600); animation: spin 1s linear infinite; margin: 96px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Navbar */
.nav { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.nav .container { height: 56px; display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-right: 12px; }
.logo-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--brand-600); color: #fff; font-size: 12px; }
.nav-user { font-size: 14px; color: var(--muted); }
@media (max-width: 640px) { .nav-user { display: none; } }

/* Landing */
.hero { background: linear-gradient(to bottom, var(--brand-50), transparent); text-align: center; padding: 80px 0; }
.pill { display: inline-block; border-radius: 999px; background: #fff; padding: 4px 12px; font-size: 12px; font-weight: 600; color: var(--brand-700); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.hero h1 { font-size: clamp(32px, 5vw, 48px); max-width: 760px; margin: 20px auto 0; }
.hero h1 span { color: var(--brand-600); }
.hero p { max-width: 640px; margin: 20px auto 0; font-size: 18px; color: var(--muted); }
.hero .row { justify-content: center; margin-top: 32px; }
.tip-num { font-size: 30px; font-weight: 700; color: var(--accent); }

/* Stats & tables */
.stat-value { font-size: 30px; font-weight: 700; margin-top: 4px; }
.big-band { font-size: 64px; font-weight: 700; color: var(--brand-700); line-height: 1; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); background: #f8fafc; padding: 12px 20px; }
.table td { padding: 12px 20px; border-top: 1px solid #f1f5f9; }
.link { color: var(--brand-600); font-weight: 500; }
.link:hover { text-decoration: underline; }
.badge { display: inline-block; border-radius: 6px; padding: 0 6px; font-size: 12px; font-weight: 700; line-height: 20px; color: #fff; background: var(--brand-600); }
.skill-tag { font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px; background: var(--brand-50); color: var(--brand-700); }

/* Exam layout */
.exam { display: flex; flex-direction: column; height: calc(100dvh - 57px); }
.exam-bar { display: flex; align-items: center; gap: 16px; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px; }
.exam-bar h1 { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font: 600 14px ui-monospace, Consolas, monospace; background: #f1f5f9; border-radius: 8px; padding: 4px 10px; font-variant-numeric: tabular-nums; }
.timer.urgent { background: var(--bad-bg); color: #b91c1c; }
.exam-panes { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .exam-panes { grid-template-columns: 1fr; } .hint { display: none; } }
.pane { min-height: 0; overflow-y: auto; }
.pane-left { background: #fff; border-right: 1px solid var(--line); }
.pane-inner { max-width: 680px; margin: 0 auto; padding: 24px; }
.passage-kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600); }
.passage-title { font: 700 24px var(--font-serif); margin-top: 4px; }
.passage-sub { font: italic 16px var(--font-serif); color: var(--muted); margin-top: 4px; }
.passage-body { margin-top: 20px; font: 17px/1.7 var(--font-serif); }
.passage-body p { display: flex; gap: 12px; margin-bottom: 16px; }
.para-label { font: 700 16px var(--font-sans); color: var(--brand-700); }
mark.hl { background: #fde68a; color: inherit; border-radius: 2px; cursor: pointer; }
.qgroup { margin-bottom: 32px; }
.qgroup-instr { font-size: 14px; font-weight: 500; color: #334155; margin-bottom: 16px; }
.q { margin-bottom: 20px; scroll-margin-top: 96px; }
.q-prompt { display: flex; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.choices { padding-left: 32px; display: grid; gap: 6px; }
.choices.inline { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: 14px; cursor: pointer; background: #fff; }
.choice:hover { background: #f8fafc; }
.choice.selected { border-color: var(--brand-500); background: var(--brand-50); }
.choice input { margin-top: 3px; accent-color: var(--brand-600); }
.option-box { border: 1px solid var(--line); background: #f8fafc; border-radius: 10px; padding: 12px; font-size: 14px; margin-bottom: 12px; }
.option-box b { display: inline-block; min-width: 40px; }
.match-row { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; scroll-margin-top: 96px; }
.match-row span.prompt { flex: 1; }
.select { border: 1px solid #cbd5e1; border-radius: 6px; padding: 4px 8px; font: 14px var(--font-sans); background: #fff; }
.gap-text { white-space: pre-line; border: 1px solid var(--line); background: #f8fafc; border-radius: 10px; padding: 16px; font-size: 14px; line-height: 2.4; }
.gap { display: inline-flex; align-items: baseline; gap: 4px; margin: 0 4px; scroll-margin-top: 96px; }
.gap input { width: 150px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 2px 8px; font: 14px var(--font-sans); }
.gap input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.sentence-list { list-style: none; padding: 0; margin: 0; font-size: 14px; line-height: 2.4; }
.navigator { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; overflow-x: auto; background: #fff; border-top: 1px solid var(--line); padding: 8px 16px; }
.nav-part { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.part-btn { border: 0; border-radius: 6px; padding: 4px 10px; font: 600 14px var(--font-sans); background: transparent; cursor: pointer; color: var(--ink); margin-right: 4px; }
.part-btn.active { background: var(--ink); color: #fff; }
.qnum { width: 28px; height: 28px; border-radius: 5px; border: 1px solid #cbd5e1; background: #fff; font: 600 12px var(--font-sans); color: var(--muted); cursor: pointer; }
.qnum.done { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
dialog { border: 0; border-radius: var(--radius); padding: 24px; width: min(380px, 92vw); box-shadow: 0 20px 50px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(0, 0, 0, .4); }

/* Results */
.result-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; padding: 32px; }
.review { border-left: 4px solid var(--bad); padding: 16px; font-size: 14px; margin-bottom: 8px; }
.review.ok { border-left-color: var(--ok); }
.review .badge { background: var(--bad); }
.review.ok .badge { background: var(--ok); }
.text-ok { color: var(--ok); } .text-bad { color: var(--bad); } .text-warn { color: var(--warn); }
.empty { text-align: center; padding: 40px; }

/* Premium & pricing */
.btn-accent { background: var(--accent); color: #1f1300; }
.btn-accent:hover:not(:disabled) { background: #e09410; }
.tag { display: inline-block; white-space: nowrap; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.tag-free { background: var(--ok-bg); color: var(--ok); }
.tag-premium { background: #fff4dc; color: #92400e; }
@media (max-width: 720px) { .nav-hide-sm { display: none; } }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.plan { position: relative; display: flex; flex-direction: column; padding: 28px; }
.plan.best { border: 2px solid var(--brand-600); box-shadow: 0 12px 30px rgba(36, 73, 176, .12); }
.plan .ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand-600); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; white-space: nowrap; }
.price { font-size: 34px; font-weight: 700; margin-top: 8px; }
.features { list-style: none; padding: 0; margin: 16px 0 0; font-size: 14px; display: grid; gap: 8px; }
.features li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: 8px; }
.features li.no { color: var(--muted); }
.features li.no::before { content: "–"; color: #94a3b8; }
.checkout { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start; }
@media (max-width: 720px) { .checkout { grid-template-columns: 1fr; } }
.qr { width: 100%; max-width: 280px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.kv { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px 12px; align-items: center; font-size: 14px; }
.kv b { font-size: 16px; word-break: break-all; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin-top: 8px; color: var(--muted); font-size: 14px; }

/* Writing */
.prompt-box { white-space: pre-line; font: 16px/1.7 var(--font-serif); }
.data-table { border-collapse: collapse; margin-top: 16px; font-size: 14px; }
.data-table caption { text-align: left; font-weight: 600; margin-bottom: 8px; }
.data-table th, .data-table td { border: 1px solid var(--line); padding: 6px 14px; text-align: right; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th { background: #f8fafc; }
.essay-input { width: 100%; min-height: 420px; resize: vertical; border: 1px solid #cbd5e1; border-radius: 12px; padding: 16px; font: 17px/1.7 var(--font-serif); background: #fff; color: var(--ink); }
.essay-input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.write-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .write-layout { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 72px; }
.criteria { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.criterion .crit-band { font-size: 32px; font-weight: 700; color: var(--brand-700); }
.criterion h3 { font-size: 15px; }
.correction { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.correction del { color: var(--bad); }
.correction ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.essay-view { white-space: pre-line; font: 17px/1.8 var(--font-serif); }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .55); display: grid; place-items: center; }
.overlay .card { padding: 32px; max-width: 420px; text-align: center; }
