:root {
  /* dark theme (default) */
  --bg: #0d0f1a;
  --bg-panel: #161927;
  --bg-panel-2: #1e2235;
  --border: #2b2f45;
  --text: #edeef5;
  --text-dim: #9b9fb8;
  --accent: #8b7cf6;
  --accent-rgb: 139, 124, 246;
  --accent-dark: #6f5eeb;
  --accent-contrast: #ffffff;
  --good: #34d399;
  --good-rgb: 52, 211, 153;
  --bad: #fb7185;
  --bad-rgb: 251, 113, 133;
  --warn: #fbbf24;
  --warn-rgb: 251, 191, 36;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f7fb;
  --bg-panel: #ffffff;
  --bg-panel-2: #f0eff8;
  --border: #e2e0ef;
  --text: #1c1b29;
  --text-dim: #64607e;
  --accent: #6d5bd0;
  --accent-rgb: 109, 91, 208;
  --accent-dark: #5847b8;
  --accent-contrast: #ffffff;
  --good: #059669;
  --good-rgb: 5, 150, 105;
  --bad: #e11d48;
  --bad-rgb: 225, 29, 72;
  --warn: #b45309;
  --warn-rgb: 180, 83, 9;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f7fb;
    --bg-panel: #ffffff;
    --bg-panel-2: #f0eff8;
    --border: #e2e0ef;
    --text: #1c1b29;
    --text-dim: #64607e;
    --accent: #6d5bd0;
    --accent-rgb: 109, 91, 208;
    --accent-dark: #5847b8;
    --accent-contrast: #ffffff;
    --good: #059669;
    --good-rgb: 5, 150, 105;
    --bad: #e11d48;
    --bad-rgb: 225, 29, 72;
    --warn: #b45309;
    --warn-rgb: 180, 83, 9;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.15s, color 0.15s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 28px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.topbar .brand {
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
header.topbar .brand:hover { text-decoration: none; opacity: 0.85; }

header.topbar .site-nav {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

header.topbar .site-nav a {
  color: var(--text-dim);
  font-weight: 500;
  padding: 6px 4px;
}

header.topbar .site-nav a.active,
header.topbar .site-nav a:hover {
  color: var(--text);
}

/* Desktop: center the section links, keep the auth box on the far right.
   The two auto margins split the free space so the links sit in the middle. */
header.topbar .site-nav > a:first-of-type { margin-left: auto; }
.nav-user { margin-left: auto; }

/* Hamburger — hidden on desktop, shown on narrow screens. */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  padding: 6px 10px;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 720px) {
  header.topbar { flex-wrap: wrap; row-gap: 0; }
  .brand { margin-right: auto; }
  .nav-toggle { display: inline-flex; order: 3; }
  #theme-toggle-btn { order: 2; }
  header.topbar .brand { order: 1; }
  header.topbar .site-nav {
    order: 4;
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-top: 10px;
  }
  header.topbar.nav-open .site-nav { display: flex; }
  header.topbar .site-nav a {
    padding: 11px 8px;
    border-radius: 8px;
  }
  header.topbar .site-nav a.active,
  header.topbar .site-nav a:hover { background: var(--bg-panel-2); }
  header.topbar .site-nav > a:first-of-type { margin-left: 0; }
  .nav-user {
    margin-left: 0;
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 480px) {
  .container { padding: 18px 14px 64px; }
  .hero { padding: 24px 0 12px; }
  .hero h1 { font-size: 26px; }
  header.topbar { padding: 12px 14px; }
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dim);
}

.theme-toggle {
  padding: 7px 10px;
  font-size: 16px;
  line-height: 1;
}

button, .btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-panel-2);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius);
  transition: background 0.15s, border-color 0.15s;
}

button:hover, .btn:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* Rounded (pill) action buttons for a softer look. */
.btn-primary, .btn-outline, .lock-btn { border-radius: 999px; }

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

/* clickable card-as-link (e.g. the full-test CTA): only the title
   should underline on hover, not the whole block of text inside it */
a.card { text-decoration: none; }
a.card:hover { text-decoration: none; border-color: var(--accent); }
a.card:hover h2, a.card:hover h3 { text-decoration: underline; }
a.set-card { text-decoration: none; }
a.set-card:hover { text-decoration: none; border-color: var(--accent); }
a.set-card:hover h3 { text-decoration: underline; }

.card h2 { margin-top: 0; }

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.set-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.set-card .tag {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  width: fit-content;
}

.set-card h3 { margin: 0; font-size: 16px; }

/* Premium-locked practice items: a gold "Premium" accent that invites an
   upgrade rather than looking broken/disabled. */
.set-card.locked { border-color: rgba(var(--warn-rgb), 0.4); }
.set-card .premium-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--warn);
  background: rgba(var(--warn-rgb), 0.14);
  padding: 2px 8px;
  border-radius: 999px;
  width: fit-content;
}
.set-card .lock-btn {
  background: rgba(var(--warn-rgb), 0.14);
  color: var(--warn);
  border: 1px solid rgba(var(--warn-rgb), 0.45);
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s;
}
.set-card .lock-btn:hover { background: rgba(var(--warn-rgb), 0.24); }

input, textarea, select {
  font: inherit;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}

/* radio/checkbox must NOT inherit width:100% from the rule above,
   otherwise their layout box swallows the row and pushes label text away */
input[type="radio"], input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--accent);
  margin: 3px 0 0;
}

textarea { resize: vertical; min-height: 220px; line-height: 1.5; }

label { font-size: 13px; color: var(--text-dim); display: block; margin-bottom: 6px; }

.form-row { margin-bottom: 14px; }

.hero {
  text-align: center;
  padding: 40px 0 20px;
}
.hero h1 { font-size: 32px; margin-bottom: 8px; }
.hero p { color: var(--text-dim); max-width: 560px; margin: 0 auto; }

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; }
.stat-tile {
  flex: 1;
  min-width: 140px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.stat-tile .num { font-size: 26px; font-weight: 700; }
.stat-tile .label { color: var(--text-dim); font-size: 13px; }

/* ---- Landing page (index) ---- */
.landing-hero { padding: 36px 0 22px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.hero-cta a { min-width: 160px; }
.btn-outline {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-align: center;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.section-h { font-size: 20px; margin: 30px 0 14px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.feature {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--bg-panel);
}
.feature-ic { font-size: 22px; line-height: 1.1; flex: 0 0 auto; }
.feature strong { display: block; margin-bottom: 2px; font-size: 14px; }
.feature p { margin: 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.35; }

.premium-hl {
  border: 1px solid rgba(var(--warn-rgb), 0.5);
  background: rgba(var(--warn-rgb), 0.06);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 30px;
}
.premium-hl h2 { font-size: 20px; }

.full-test-card {
  display: block;
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.06);
}
.full-test-card:hover { border-color: var(--accent-dark); }

.passage {
  white-space: pre-line;
  line-height: 1.7;
  font-size: 15.5px;
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 8px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
}

.question-block {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}
.question-block:first-child { border-top: none; padding-top: 0; }

.question-text { margin-bottom: 10px; white-space: pre-line; }

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 4px;
  text-align: left;
}
.option span { flex: 1 1 auto; }
.option:hover { background: var(--bg-panel-2); }
.option.selected { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }
.option.correct { border-color: var(--good); background: rgba(var(--good-rgb), 0.12); }
.option.incorrect { border-color: var(--bad); background: rgba(var(--bad-rgb), 0.12); }

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.badge.correct { background: rgba(var(--good-rgb), 0.18); color: var(--good); }
.badge.incorrect { background: rgba(var(--bad-rgb), 0.18); color: var(--bad); }

/* Academic Word List explainer (collapsible) on the vocabulary page */
.awl-explainer {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin: 14px 0 20px;
}
.awl-explainer summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}
.awl-explainer-body { margin-top: 10px; }
.awl-explainer-body p { line-height: 1.6; margin: 8px 0; }
.awl-explainer-body ul { margin: 8px 0 8px 20px; }
.awl-explainer-body li { line-height: 1.6; margin-bottom: 4px; }

/* Academic Word List sublist marker on vocabulary words */
.awl-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  vertical-align: middle;
  white-space: nowrap;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
}
.timer.warn { color: var(--warn); border-color: var(--warn); }
.timer.danger { color: var(--bad); border-color: var(--bad); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }

.msg { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 12px; }
.msg.error { background: rgba(var(--bad-rgb), 0.14); color: var(--bad); border: 1px solid rgba(var(--bad-rgb), 0.3); }
.msg.success { background: rgba(var(--good-rgb), 0.14); color: var(--good); border: 1px solid rgba(var(--good-rgb), 0.3); }

.word-count { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.word-count.ok { color: var(--good); }

.mic-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--bad);
  font-weight: 600;
}
.mic-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--bad);
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.divider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13px;
  margin: 16px 0;
}
.divider-row::before, .divider-row::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

#google-signin-btn { display: flex; justify-content: center; min-height: 40px; }

#yandex-signin-btn { display: flex; justify-content: center; margin-top: 10px; }
.yandex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 320px;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff;
  color: #21201f;
  border: 1px solid var(--border);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: box-shadow .15s, background .15s;
}
.yandex-btn:hover { box-shadow: 0 1px 6px rgba(0,0,0,0.15); }
.yandex-btn .yandex-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fc3f1d;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}

footer.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 30px 20px;
}

.subtle { color: var(--text-dim); font-size: 13px; }

/* ---- Section directions (real exam wording + Russian note) ---- */
.directions h3 { margin-top: 0; }
.directions-en {
  font-size: 15px;
  line-height: 1.6;
}
.directions-ru {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ---- Estimated scaled score ---- */
.scaled-box {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
}
.scaled-num { font-size: 26px; font-weight: 700; color: var(--accent); }
.scaled-max { font-size: 16px; color: var(--text-dim); font-weight: 600; }
.scaled-band { font-weight: 600; margin-top: 2px; }
.scaled-note { font-size: 12px; color: var(--text-dim); margin-top: 6px; line-height: 1.5; }

/* ---- Materials / premium ---- */
.material-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.premium-badge { background: rgba(var(--warn-rgb), 0.18); color: var(--warn); font-size: 13px; padding: 4px 10px; }
.promo-row { display: flex; gap: 8px; margin-top: 10px; }
.promo-row input { flex: 1; }
.promo-row button { flex: 0 0 auto; }
@media (max-width: 480px) {
  .material-row { flex-direction: column; align-items: flex-start; }
  .material-row > div:last-child { margin-left: 0 !important; }
}

/* ---- Profile / личный кабинет ---- */
.profile-link { color: var(--text-dim); font-weight: 500; }
.profile-link:hover { color: var(--text); text-decoration: none; }
.premium-dot { color: var(--warn); }
.profile-head { display: flex; align-items: center; gap: 18px; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: var(--accent-contrast);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; flex: 0 0 auto;
}
.section-title { margin: 24px 0 12px; font-size: 20px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ach {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; background: var(--bg-panel);
}
.ach.locked { opacity: 0.45; filter: grayscale(0.6); }
.ach.earned { border-color: var(--accent); }
.ach-icon { font-size: 26px; }
.ach-title { font-weight: 600; }
.activity-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--border);
}
.activity-row:first-child { border-top: none; }
@media (max-width: 480px) {
  .profile-head { flex-direction: column; text-align: center; }
}

/* ---- Theory section ---- */
.theory-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.theory-tab {
  padding: 8px 14px;
  font-weight: 500;
}
.theory-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.theory-tab-vocab {
  text-decoration: none;
  border-style: dashed;
  border-color: var(--accent);
  color: var(--accent);
  margin-left: 6px;
}
.theory-tab-vocab:hover {
  background: rgba(var(--accent-rgb), 0.12);
}
#theory-content { line-height: 1.65; }
#theory-content h2 { margin-top: 0; }
#theory-content h3 { margin-top: 26px; color: var(--accent); }
#theory-content h4 {
  margin: 18px 0 4px;
  font-size: 15px;
}
#theory-content ul { padding-left: 20px; }
#theory-content li { margin-bottom: 6px; }
#theory-content p { margin: 8px 0; }
.theory-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}
.theory-table th, .theory-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
.theory-table th { background: var(--bg-panel-2); }
.theory-tip {
  margin: 18px 0 4px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  font-size: 14px;
}
/* wide tables scroll rather than break the page layout on small screens */
@media (max-width: 640px) {
  #theory-content { overflow-x: auto; }
}

/* ---- Vocabulary trainer ---- */
.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-panel-2);
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: var(--good);
  transition: width 0.3s;
}
.flashcard {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel-2);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  user-select: none;
}
.flash-word { font-size: 34px; font-weight: 700; }
.flash-ru { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.flash-en { font-size: 15px; margin-bottom: 12px; }
.flash-ex { font-style: italic; color: var(--text); }
.flash-hint { margin-top: 6px; }
#word-list .theory-table td:nth-child(3) { max-width: 320px; }

/* ---- 2026 format: Complete the Words ---- */
.cw-paragraph { font-size: 18px; line-height: 2.1; }
.cw-gap { display: inline-flex; align-items: baseline; white-space: nowrap; }
.cw-shown { color: var(--text); }
.cw-input {
  border: none;
  border-bottom: 2px solid var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--text);
  font: inherit;
  padding: 0 2px;
  min-width: 2ch;
  border-radius: 3px 3px 0 0;
  outline: none;
}
.cw-input:focus { background: rgba(var(--accent-rgb), 0.16); }
.cw-input.correct { border-bottom-color: var(--good); background: rgba(var(--good-rgb), 0.14); color: var(--good); }
.cw-input.incorrect { border-bottom-color: var(--bad); background: rgba(var(--bad-rgb), 0.14); color: var(--bad); }
/* underscores hint how many letters are missing while the field is empty */
.cw-input::placeholder { color: var(--text-dim); letter-spacing: 1px; opacity: 0.65; }

/* ---- Premium plan cards (materials) ---- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 8px; }
.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  background: var(--bg-panel-2);
}
.plan-label { font-size: 14px; color: var(--text-dim); }
.plan-price { font-size: 24px; font-weight: 700; margin: 6px 0 10px; }
.plan-price .plan-cur { font-size: 15px; font-weight: 500; color: var(--text-dim); }
.plan-price .price-was { font-size: 16px; font-weight: 500; color: var(--text-dim); text-decoration: line-through; margin-right: 4px; }
.plan-permonth { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 6px; margin: -4px 0 10px; }
.plan-permonth .pm-old { font-size: 13px; color: var(--text-dim); text-decoration: line-through; }
.plan-permonth .pm-new { font-size: 14px; font-weight: 600; }
.plan-permonth .pm-badge { font-size: 12px; font-weight: 700; color: #1b7f4b; background: rgba(27,127,75,0.12); border-radius: 999px; padding: 1px 7px; }
.plan-card .buy-btn { width: 100%; }

/* ---- Premium benefits list (payment card) ---- */
.premium-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 18px;
  margin: 0 0 18px;
}
@media (max-width: 520px) {
  .premium-benefits { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .premium-hl { padding: 16px; }
}
.benefit { display: flex; gap: 10px; align-items: flex-start; }
.benefit-ic {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1.3;
}
.benefit-txt { display: flex; flex-direction: column; gap: 2px; }
.benefit-txt strong { font-size: 14.5px; }
.benefit-txt .subtle { font-size: 13px; line-height: 1.4; }

/* ---- Email verification banner (renderHeader) ---- */
.verify-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(var(--accent-rgb), 0.12);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.verify-banner span { flex: 1 1 auto; }
.verify-banner .btn { padding: 5px 12px; }
.verify-close { background: transparent; border: none; padding: 4px 8px; color: var(--text-dim); }

/* ---- 2026 format: in-task navigation (back to list / skip to next task) ---- */
.practice-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 2px; }
#next-link { color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }
#next-link:hover { text-decoration: underline; }

/* ---- 2026 format: Read in Daily Life notice ---- */
.notice-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 20px 22px;
}
.notice-title { font-weight: 700; text-align: center; margin-bottom: 10px; font-size: 15px; }
.notice-body { line-height: 1.6; color: var(--text); white-space: pre-line; }

/* ---- 2026 format: Build a Sentence ---- */
.bs-sentence {
  font-size: 19px;
  line-height: 2.2;
  margin: 10px 0 18px;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
}
.bs-fixed { font-weight: 600; }
.bs-slots { display: inline; }
.bs-placeholder { color: var(--text-dim); font-size: 15px; }
.bs-bank { display: flex; flex-wrap: wrap; gap: 8px; }
.bs-tile {
  font: inherit;
  padding: 6px 12px;
  margin: 0 3px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.10);
  color: var(--text);
  cursor: pointer;
}
.bs-tile:hover { background: rgba(var(--accent-rgb), 0.22); }
.bs-tile.placed { border-style: solid; background: rgba(var(--accent-rgb), 0.18); }

/* ---- 2026 format: Academic Discussion replies ---- */
.reply {
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  margin-top: 10px;
  background: var(--bg-panel);
  border-radius: 0 8px 8px 0;
  line-height: 1.5;
}

/* ---------- Legal pages (oferta, privacy) ---------- */
.legal { max-width: 820px; }
.legal h1 { margin-bottom: 6px; }
.legal h2 { font-size: 1.15rem; margin: 26px 0 8px; color: var(--accent); }
.legal p, .legal li { color: var(--text); line-height: 1.6; }
.legal ul { margin: 8px 0 8px 22px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--accent); }
.legal .legal-note {
  background: var(--bg-panel-2);
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 0;
  color: var(--text-dim);
  font-size: 0.92rem;
}

/* ---------- Blog / articles ---------- */
.article { max-width: 720px; }
.article .article-meta { color: var(--text-dim); font-size: 0.9rem; margin: 0 0 4px; }
.article .article-lead { font-size: 1.08rem; line-height: 1.6; color: var(--text-dim); margin: 10px 0 22px; }
.article h1 { margin-bottom: 6px; line-height: 1.25; }
.article h2 { font-size: 1.3rem; margin: 32px 0 10px; color: var(--accent); }
.article h3 { font-size: 1.08rem; margin: 22px 0 6px; }
.article p, .article li { color: var(--text); line-height: 1.7; font-size: 1rem; }
.article ul, .article ol { margin: 10px 0 14px 22px; }
.article li { margin-bottom: 8px; }
.article a { color: var(--accent); text-decoration: underline; }
.article .callout {
  background: var(--bg-panel-2);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 18px 0;
}
.article .callout p { margin: 0; }
.article .article-cta {
  margin: 34px 0 8px;
  padding: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.article .article-cta a.btn-cta {
  display: inline-block;
  margin-top: 10px;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.article .article-cta a.btn-cta:hover { background: var(--accent-dark); }
.article .breadcrumb { font-size: 0.9rem; margin-bottom: 14px; }
.article .article-table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.article .article-table th, .article .article-table td {
  border: 1px solid var(--border); padding: 8px 12px; text-align: left; font-size: 0.95rem;
}
.article .article-table th { background: var(--bg-panel-2); }
.article .article-nav { margin-top: 36px; border-top: 1px solid var(--border); padding-top: 18px; }
.article .article-nav h3 { margin-top: 0; }
.article .article-nav a { display: block; margin: 6px 0; }

.blog-list { display: grid; gap: 16px; margin-top: 20px; }
.blog-card {
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  transition: border-color 0.15s;
}
.blog-card:hover { border-color: var(--accent); text-decoration: none; }
.blog-card h2 { margin: 0 0 6px; font-size: 1.15rem; color: var(--text); }
.blog-card:hover h2 { color: var(--accent); }
.blog-card p { margin: 0; color: var(--text-dim); line-height: 1.5; font-size: 0.95rem; }
.blog-card .blog-card-meta { color: var(--text-dim); font-size: 0.82rem; margin-bottom: 8px; }

/* ---------- Site footer ---------- */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 22px 20px 30px;
}
.site-footer .footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-footer .footer-brand { font-weight: 700; color: var(--text); }
.site-footer .footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer .footer-links a { color: var(--text-dim); text-decoration: none; font-size: 0.92rem; }
.site-footer .footer-links a:hover { color: var(--accent); }
.site-footer .footer-note {
  max-width: 1000px;
  margin: 14px auto 0;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* ---------- Full-test variant picker ---------- */
.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.variant-btn {
  padding: 16px 14px;
  border: 1px solid var(--border);
  background: var(--bg-panel-2);
  color: var(--text);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, transform .05s;
}
.variant-btn:hover { border-color: var(--accent); }
.variant-btn:active { transform: translateY(1px); }

/* ---------- Refined interface system (Apple-inspired) ----------
   A light, calm surface system shared by every page.  It deliberately uses
   CSS only: no component markup or application behaviour is coupled to it. */
:root {
  --bg: #f5f5f7;
  --bg-panel: rgba(255, 255, 255, 0.86);
  --bg-panel-2: #f0f1f5;
  --border: rgba(17, 24, 39, 0.11);
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --accent: #0071e3;
  --accent-rgb: 0, 113, 227;
  --accent-dark: #0077ed;
  --accent-contrast: #ffffff;
  --good: #198754;
  --good-rgb: 25, 135, 84;
  --bad: #d70015;
  --bad-rgb: 215, 0, 21;
  --warn: #a85f00;
  --warn-rgb: 168, 95, 0;
  --radius: 18px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-panel: rgba(29, 29, 31, 0.82);
  --bg-panel-2: #1d1d1f;
  --border: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --text-dim: #a1a1a6;
  --accent: #2997ff;
  --accent-rgb: 41, 151, 255;
  --accent-dark: #47a6ff;
  --good: #30d158;
  --good-rgb: 48, 209, 88;
  --bad: #ff453a;
  --bad-rgb: 255, 69, 58;
  --warn: #ffd60a;
  --warn-rgb: 255, 214, 10;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-panel: rgba(29, 29, 31, 0.82);
    --bg-panel-2: #1d1d1f;
    --border: rgba(255, 255, 255, 0.14);
    --text: #f5f5f7;
    --text-dim: #a1a1a6;
    --accent: #2997ff;
    --accent-rgb: 41, 151, 255;
    --accent-dark: #47a6ff;
    --good: #30d158;
    --good-rgb: 48, 209, 88;
    --bad: #ff453a;
    --bad-rgb: 255, 69, 58;
    --warn: #ffd60a;
    --warn-rgb: 255, 214, 10;
    color-scheme: dark;
  }
}

html { scroll-behavior: smooth; }
body {
  letter-spacing: -0.012em;
  background:
    radial-gradient(900px 420px at 50% -160px, rgba(var(--accent-rgb), 0.13), transparent 68%),
    var(--bg);
}

.container { max-width: 1040px; padding-top: 34px; }
header.topbar {
  min-height: 60px;
  padding: 10px max(20px, calc((100vw - 1200px) / 2));
  background: color-mix(in srgb, var(--bg-panel) 88%, transparent);
  border-bottom-color: color-mix(in srgb, var(--border) 85%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
header.topbar .brand { font-size: 17px; letter-spacing: -0.025em; }
header.topbar .site-nav { gap: 6px; }
header.topbar .site-nav a {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 14px;
  transition: color .2s ease, background .2s ease;
}
header.topbar .site-nav a.active { background: rgba(var(--accent-rgb), .12); color: var(--accent); }
header.topbar .site-nav a:hover { background: var(--bg-panel-2); text-decoration: none; }
.nav-toggle, .theme-toggle {
  border-radius: 999px;
  border-color: transparent;
  background: var(--bg-panel-2);
  transition: transform .18s ease, background .18s ease;
}
.nav-toggle:hover, .theme-toggle:hover { transform: scale(1.04); background: rgba(var(--accent-rgb), .12); }
.user-box { gap: 9px; }
.user-box > a { color: var(--text); font-weight: 600; }
.user-box > button { padding: 6px 11px; font-size: 13px; border-radius: 999px; }

button, .btn, .btn-primary, .btn-outline, .lock-btn {
  border-radius: 999px;
  min-height: 40px;
  padding: 9px 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
button:hover:not(:disabled), .btn:hover, .btn-primary:hover, .btn-outline:hover, .lock-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}
button:active:not(:disabled), .btn:active, .btn-primary:active, .btn-outline:active { transform: translateY(0) scale(.98); }
.btn-primary {
  box-shadow: 0 5px 14px rgba(var(--accent-rgb), .24);
  background: var(--accent);
}
.btn-primary:hover { box-shadow: 0 8px 20px rgba(var(--accent-rgb), .32); }
.btn-outline { background: var(--bg-panel); border-color: var(--border); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), .32);
  outline-offset: 3px;
}

.card, .set-card, .feature, .stat-tile, .ach, .plan-card, .notice-card, .flashcard, .bs-sentence {
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .025), 0 12px 30px rgba(0, 0, 0, .035);
}
.card, .set-card, .feature, .ach, .notice-card { background: var(--bg-panel); }
.card { padding: 24px; }
.set-card, .feature, .plan-card, .ach { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.set-card:hover, a.card:hover, .feature:hover, .plan-card:hover, .ach.earned:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), .34);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .10);
}
.set-card { padding: 20px; gap: 10px; }
.set-card .tag, .tag { padding: 4px 10px; font-weight: 650; letter-spacing: .01em; }
.section-h, .section-title { letter-spacing: -0.035em; font-size: 24px; }

.hero { padding: 54px 0 32px; }
.hero h1 {
  max-width: 760px;
  margin: 0 auto 14px;
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}
.hero p { max-width: 620px; font-size: 18px; line-height: 1.5; }
.hero-cta { margin-top: 26px; }
.hero-cta a { min-width: 174px; }
.full-test-card { border-color: rgba(var(--accent-rgb), .35); background: linear-gradient(135deg, rgba(var(--accent-rgb), .13), var(--bg-panel) 60%); }
.premium-hl {
  border-color: rgba(var(--warn-rgb), .34);
  background: linear-gradient(135deg, rgba(var(--warn-rgb), .13), var(--bg-panel) 52%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .045);
}
.plan-card { padding: 18px 14px; }
.plan-card:hover { border-color: rgba(var(--accent-rgb), .55); }
.plan-price { letter-spacing: -0.04em; }

input, textarea, select {
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-panel-2) 86%, transparent);
  border-color: var(--border);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input:hover, textarea:hover, select:hover { border-color: rgba(var(--accent-rgb), .34); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .13);
  outline: none;
}
.option { border-radius: 12px; padding: 10px 12px; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.option:hover { transform: translateX(2px); }
.timer { border-radius: 999px; display: inline-flex; }
.msg { border-radius: 14px; padding: 12px 14px; }
.progress-bar { border: none; height: 8px; }
.progress-fill { background: linear-gradient(90deg, var(--accent), #5ac8fa); }

.site-footer { margin-top: 68px; background: transparent; border-top-color: var(--border); }
.site-footer .footer-inner, .site-footer .footer-note { max-width: 1040px; }
.footer-brand { letter-spacing: -0.02em; }

@media (max-width: 720px) {
  .container { padding-top: 24px; }
  header.topbar { padding: 10px 14px; }
  header.topbar .site-nav { padding: 8px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-panel); box-shadow: 0 14px 32px rgba(0, 0, 0, .10); }
  header.topbar .site-nav a { padding: 10px 11px; }
  .hero { padding: 34px 0 22px; }
  .hero h1 { font-size: clamp(34px, 10vw, 44px); }
  .hero p { font-size: 16px; }
  .card { padding: 18px; }
}

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