/* ===== Design tokens ===== */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #16202e;
  --muted: #5a6677;
  --border: #dde2e9;
  --brand: #111418;
  --brand-2: #2b3038;
  --accent: #f2a516;
  --accent-ink: #1a1300;
  --good: #1f8a4c;
  --bad: #b93a32;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
  --max: 1160px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1520;
    --surface: #151f2e;
    --surface-2: #1c2839;
    --text: #e6ebf2;
    --muted: #9aa7b8;
    --border: #2a3749;
    --brand: #0a0c0f;
    --brand-2: #2a2f37;
    --accent: #f5b335;
    --good: #4cc483;
    --bad: #f07a71;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 12px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: #1d5fae; }
@media (prefers-color-scheme: dark) { a { color: #8fb6ff; } }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ===== Header ===== */
.site-header {
  background: var(--brand);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
}
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.1rem; }
.logo img { width: 40px; height: 40px; border-radius: 50%; background: #fff; padding: 2px; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { color: #dbe4f3; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.12); }
.nav a.cta { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 1rem; }
@media (max-width: 1240px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--brand); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
}

/* ===== Hero ===== */
.hero { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); color: #fff; padding: 48px 0 56px; }
.hero p { color: #cfdaeb; font-size: 1.1rem; max-width: 640px; }
.hero .eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-weight: 700; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-size: .95rem; font-family: inherit; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-dark { background: var(--brand-2); color: #fff; }
.btn-block { width: 100%; }

/* ===== Layout ===== */
main { padding: 32px 0 56px; }
.section { margin-bottom: 48px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 84px; }
@media (max-width: 960px) { .sidebar { position: static; } }

/* ===== Cards ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag.sponsored { background: var(--accent); color: var(--accent-ink); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--muted); margin: 6px 0 12px; }

/* ===== Course review card ===== */
.course { display: flex; flex-direction: column; }
.course .top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.stars { color: var(--accent); letter-spacing: 1px; font-size: 1rem; white-space: nowrap; }
.stars .num { color: var(--text); font-weight: 700; margin-left: 4px; letter-spacing: 0; font-size: .9rem; }
.course .price { font-weight: 800; font-size: 1.15rem; }
.course .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.course.is-sponsored { border-color: var(--accent); }
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.proscons ul { padding-left: 1.1em; margin: 0; }
.pros li::marker { content: "✓  "; color: var(--good); }
.cons li::marker { content: "✕  "; color: var(--bad); }
@media (max-width: 560px) { .proscons { grid-template-columns: 1fr; } }

/* ===== Filters ===== */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 7px 14px; border-radius: 999px; font: inherit; font-size: .9rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.select, .input, textarea { font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.input, textarea { width: 100%; }
label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: 4px; }
.field { margin-bottom: 14px; }

/* ===== Ads ===== */
.ad { border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 16px; text-align: center; position: relative; }
.ad .ad-label { position: absolute; top: 6px; right: 10px; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ad a { text-decoration: none; color: inherit; display: block; }
.ad img { margin: 0 auto 8px; border-radius: 8px; }
.ad strong { display: block; font-size: 1.05rem; }
.ad.banner { padding: 22px 16px; }
.ad.house { border-color: var(--accent); }

/* ===== Article ===== */
.article-body { max-width: 720px; font-size: 1.05rem; }
.article-body h2 { margin-top: 1.6em; font-size: 1.35rem; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li { margin-bottom: .4em; }
.callout { background: var(--surface-2); border-left: 4px solid var(--accent); padding: 14px 16px; border-radius: 8px; margin: 1.2em 0; }

/* ===== Pricing ===== */
.pricing { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.plan { display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--accent); }
.plan .amount { font-size: 2.2rem; font-weight: 800; }
.plan ul { padding-left: 1.1em; flex: 1; }
.plan li::marker { content: "✓  "; color: var(--good); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* ===== Modal ===== */
dialog { border: none; border-radius: var(--radius); padding: 0; max-width: 680px; width: calc(100% - 32px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10, 18, 30, .6); }
dialog .modal-inner { padding: 24px; max-height: 85vh; overflow-y: auto; }
dialog .close { float: right; background: none; border: none; font-size: 1.5rem; color: var(--muted); cursor: pointer; line-height: 1; }

/* ===== Footer ===== */
.site-footer { background: var(--brand); color: #b9c6da; padding: 40px 0 24px; font-size: .92rem; }
.site-footer a { color: #dbe4f3; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 2fr 1fr 1fr 1fr; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid h4 { color: #fff; margin: 0 0 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 28px; padding-top: 16px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ===== Install banner ===== */
.install-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 520px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.2); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; z-index: 60; }
.install-bar p { margin: 0; flex: 1; font-size: .92rem; }
.install-bar button.dismiss { background: none; border: none; color: var(--muted); font-size: 1.3rem; cursor: pointer; }

.notice { background: #fff6dd; color: #5a4300; border: 1px solid #f2d27a; border-radius: 10px; padding: 10px 14px; font-size: .9rem; margin-bottom: 20px; }
@media (prefers-color-scheme: dark) { .notice { background: #2e2610; color: #f3dd9d; border-color: #6b5520; } }

/* ===== Accounts, reviews & locked content ===== */
.demo-bar { background: #fff6dd; color: #5a4300; text-align: center; font-size: .82rem; padding: 6px 16px; }
@media (prefers-color-scheme: dark) { .demo-bar { background: #2e2610; color: #f3dd9d; } }
.error { color: var(--bad); font-size: .9rem; min-height: 1.2em; margin: 6px 0; }
.linkish { background: none; border: none; padding: 0; color: #1d5fae; text-decoration: underline; cursor: pointer; font: inherit; }
@media (prefers-color-scheme: dark) { .linkish { color: #8fb6ff; } }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 6px 0 4px; }
.check input { margin-top: 5px; }

.unlock h3 { margin-bottom: 6px; }
.steps { list-style: none; padding: 0; margin: 12px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.steps li > div { flex: 1; }
.steps li.open { background: rgba(31, 138, 76, .1); }
.steps .lock { font-size: 1.2rem; }

.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; list-style: none; margin: 4px 0 0; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.combo-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.combo-list li:hover, .combo-list li.active { background: var(--surface-2); }
.combo-list li.add { color: #1d5fae; font-weight: 600; border-top: 1px solid var(--border); }
.combo-list li.empty { color: var(--muted); cursor: default; }
.input:disabled { opacity: .55; }

.rating-input { border: none; padding: 0; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rating-input legend { font-weight: 600; font-size: .9rem; margin-bottom: 4px; width: 100%; }
.rating-input input { position: absolute; opacity: 0; width: 1px; }
.rating-input label { font-size: 2rem; color: var(--border); cursor: pointer; margin: 0; line-height: 1; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: var(--accent); }
.rating-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }

.review { border-top: 1px solid var(--border); padding: 14px 0; }
.review-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.review p { margin: 6px 0; }

.lock-banner { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; }
.lock-panel { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 20px; max-width: 640px; margin-top: 20px; }
.card.locked { opacity: .85; }

.auth { max-width: 460px; margin: 0 auto; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tab { background: none; border: none; padding: 10px 14px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.tab[aria-selected="true"] { color: var(--text); border-color: var(--accent); }

.profile-head { display: flex; gap: 16px; align-items: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; flex: none; }

/* Home toolbar: search + course type + sort */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar .input { width: 220px; }
@media (max-width: 560px) { .toolbar, .toolbar .input, .toolbar .select { width: 100%; } }
#latest-reviews .review:first-child { border-top: none; padding-top: 0; }

/* Home page: each section in its own box */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.panel .card { box-shadow: none; background: var(--bg); }
#latest-reviews { display: grid; gap: 12px; }
#latest-reviews .review { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--bg); }
#latest-reviews .review:first-child { border-top: 1px solid var(--border); padding-top: 14px; }
@media (max-width: 560px) { .panel { padding: 16px; } }
.panel.section { margin-bottom: 24px; }

/* Profile pictures */
img.avatar { object-fit: cover; padding: 0; }
.avatar.lg { width: 96px; height: 96px; font-size: 2.2rem; }
.avatar.sm { width: 24px; height: 24px; font-size: .75rem; display: inline-grid; vertical-align: middle; margin-right: 6px; }
a.reviewer { white-space: nowrap; }
.photo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.photo-row .photo-btn { cursor: pointer; margin: 0 8px 6px 0; }

/* Header menu: keep each item on one line, and a slimmer CV Writing Service button */
.nav { align-items: center; }
.nav a { white-space: nowrap; padding: 7px 10px; font-size: .92rem; }
.nav a.cta { padding: 6px 14px; line-height: 1.3; }
@media (max-width: 1240px) { .nav a.cta { align-self: flex-start; } }

/* Legal pages */
.legal { max-width: 780px; }
.legal h3 { margin-top: 1.2em; }
.legal mark { background: #fff1a8; color: #3a2f00; padding: 0 3px; border-radius: 3px; }
