/* ExamsPrepApp — one stylesheet for the whole site */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --text: #152033;
  --muted: #566176;
  --border: #dfe3ea;
  --primary: #0d6b63;
  --primary-hover: #0a5751;
  --primary-ink: #ffffff;
  --primary-soft: #e3f3f1;
  --accent: #e8962a;
  --accent-soft: #fdf1e1;
  --accent-ink: #5c3604;
  --success: #15803d;
  --success-soft: #e5f6eb;
  --danger: #b4321a;
  --danger-soft: #fbe9e5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 14px;
  --radius-sm: 9px;
  --max: 1160px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d131d; --surface: #151d2a; --surface-2: #1c2636; --text: #e8edf4; --muted: #9ba6b8;
    --border: #273246; --primary: #35bfae; --primary-hover: #4fd3c2; --primary-ink: #04201d;
    --primary-soft: #12302e; --accent: #f2ad4e; --accent-soft: #33260f; --accent-ink: #fbe3bd;
    --success: #4ade80; --success-soft: #11291b; --danger: #f87171; --danger-soft: #331715;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d131d; --surface: #151d2a; --surface-2: #1c2636; --text: #e8edf4; --muted: #9ba6b8;
  --border: #273246; --primary: #35bfae; --primary-hover: #4fd3c2; --primary-ink: #04201d;
  --primary-soft: #12302e; --accent: #f2ad4e; --accent-soft: #33260f; --accent-ink: #fbe3bd;
  --success: #4ade80; --success-soft: #11291b; --danger: #f87171; --danger-soft: #331715;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.section { padding-top: 40px; padding-bottom: 40px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.hidden { display: none !important; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); }
.header-tools { display: flex; gap: 6px; align-items: center; }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); height: 38px; min-width: 38px; padding: 0 8px; cursor: pointer; font: inherit; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--surface-2); }
.lang-select { height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; padding: 0 6px; }
.menu-btn { display: none; }
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; margin-left: auto; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; border-bottom: 1px solid var(--border); }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn-accent { background: var(--accent); color: #2a1803; }
.btn-accent:hover { filter: brightness(1.05); color: #2a1803; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .9rem; }

/* Forms */
label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); }
.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.item-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s; position: relative; }
.item-card:hover { transform: translateY(-2px); color: var(--text); }
.item-thumb { aspect-ratio: 16/9; background: var(--surface-2); display: grid; place-items: center; position: relative; overflow: hidden; }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-thumb .type-icon { font-size: 2.2rem; color: var(--primary); }
.item-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.item-title { font-weight: 700; line-height: 1.35; }
.item-meta { font-size: .82rem; color: var(--muted); }
.lock-badge { position: absolute; top: 10px; right: 10px; background: var(--accent); color: #2a1803; font-weight: 800; font-size: .75rem; padding: 4px 9px; border-radius: 99px; display: inline-flex; gap: 4px; align-items: center; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.badge-free { background: var(--success-soft); color: var(--success); }
.badge-premium { background: var(--accent-soft); color: var(--accent-ink); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

/* Hero */
.hero { background: linear-gradient(160deg, var(--primary-soft), var(--bg) 70%); padding: 56px 0 40px; }
.hero p.lead { font-size: 1.12rem; color: var(--muted); max-width: 640px; }
.search-box { display: flex; gap: 8px; max-width: 640px; margin-top: 20px; }
.search-box input { flex: 1; }
.picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; max-width: 640px; margin-top: 12px; }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.filters select { width: auto; min-width: 140px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 99px; padding: 6px 14px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.chip[aria-pressed="true"], .chip:hover { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

.breadcrumbs { font-size: .88rem; color: var(--muted); margin: 18px 0 8px; }
.breadcrumbs a { color: var(--muted); }

/* Video */
.player { aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; position: relative; }
.player iframe { width: 100%; height: 100%; border: 0; }
.player-poster { width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; background: #000 center/cover no-repeat; position: relative; }
.player-poster .play { position: absolute; inset: 0; margin: auto; width: 76px; height: 54px; border-radius: 14px; background: rgba(0,0,0,.75); display: grid; place-items: center; }
.player-poster:hover .play { background: #e11d2a; }
.locked-panel { aspect-ratio: 16/9; border-radius: var(--radius); background: linear-gradient(135deg, var(--surface-2), var(--accent-soft)); display: grid; place-items: center; text-align: center; padding: 20px; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.prose h2 { margin-top: 1.4em; font-size: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }

/* Quiz */
.quiz-q { font-size: 1.08rem; font-weight: 600; margin-bottom: 14px; }
.options { display: grid; gap: 10px; }
.option { text-align: left; width: 100%; padding: 14px 16px; border-radius: var(--radius-sm); border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; }
.option:hover:not([disabled]) { border-color: var(--primary); }
.option .letter { font-weight: 800; color: var(--primary); min-width: 1.2em; }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option.correct { border-color: var(--success); background: var(--success-soft); }
.option.wrong { border-color: var(--danger); background: var(--danger-soft); }
.explain { margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; padding: 4px 12px; border-radius: 99px; background: var(--surface-2); }
.timer.low { background: var(--danger-soft); color: var(--danger); }
.score-big { font-size: 3rem; font-weight: 800; color: var(--primary); line-height: 1; }

/* Pricing */
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 10px; position: relative; }
.plan.featured { border: 2px solid var(--primary); }
.plan .ribbon { position: absolute; top: -12px; left: 20px; background: var(--primary); color: var(--primary-ink); font-size: .75rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.price { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.price small { font-size: .95rem; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 6px 0 12px; flex: 1; }
.plan li { padding: 4px 0 4px 26px; position: relative; }
.plan li::before { content: '✓'; position: absolute; left: 4px; color: var(--success); font-weight: 800; }
table.compare { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
table.compare th, table.compare td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
table.compare td:not(:first-child), table.compare th:not(:first-child) { text-align: center; }
.table-wrap { overflow-x: auto; }
details.faq { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; }
details.faq summary { font-weight: 700; cursor: pointer; }

/* Banners */
.banner { padding: 14px 16px; border-radius: var(--radius-sm); margin: 16px 0; border: 1px solid var(--border); background: var(--surface); }
.banner-info { background: var(--primary-soft); border-color: transparent; }
.banner-warn { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.banner-error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.banner-success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.upgrade-strip { background: var(--accent-soft); color: var(--accent-ink); }
.upgrade-strip .container { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 10px 16px; flex-wrap: wrap; font-weight: 600; font-size: .92rem; }

.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; z-index: 90; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: var(--radius-sm); z-index: 100; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .num { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .85rem; }
.bar-row { display: grid; grid-template-columns: minmax(100px, 1fr) 2fr 48px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: .92rem; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); min-height: 220px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 48px; padding: 32px 0 24px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.site-footer h3 { font-size: .95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.yt-cta { display: inline-flex; align-items: center; gap: 8px; background: #e11d2a; color: #fff !important; padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 700; text-decoration: none; }

@media print {
  .site-header, .site-footer, .upgrade-strip, .no-print, .cookie-banner { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
