/* Szakma Sztár gyakorló – stíluslap */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #172033;
  --muted: #5b6577;
  --border: #d9dfea;
  --brand: #1d4ed8;
  --brand-ink: #ffffff;
  --brand-soft: #e3ebff;
  --accent: #f59e0b;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --warn: #a16207;
  --warn-soft: #fef3c7;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1420;
    --surface: #171e2d;
    --surface-2: #1f2839;
    --text: #e6eaf2;
    --muted: #9aa5b8;
    --border: #2c3850;
    --brand: #4f7cff;
    --brand-ink: #ffffff;
    --brand-soft: #1f2e55;
    --ok: #4ade80;
    --ok-soft: #14321f;
    --bad: #f87171;
    --bad-soft: #3a1919;
    --warn: #fbbf24;
    --warn-soft: #3a2e10;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 16px; }
main { padding-top: 20px; padding-bottom: 40px; min-height: 70vh; outline: none; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }

/* ---------- top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-size: 1.05rem; }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand b { color: var(--brand); }
.mainnav { display: flex; gap: 4px; flex-wrap: wrap; }
.mainnav a { text-decoration: none; color: var(--muted); padding: 7px 11px; border-radius: 9px; font-weight: 600; font-size: .95rem; }
.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a.active { background: var(--brand-soft); color: var(--brand); }

/* ---------- generic */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; min-height: 42px;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand); filter: brightness(1.08); }
.btn-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.btn-bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.btn-warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 5px 10px; min-height: 34px; font-size: .9rem; }
.btn-lg { padding: 12px 22px; font-size: 1.05rem; }
input[type="text"], input[type="search"], input[type="number"], select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-height: 42px; width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
label.field { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.field-hint { font-weight: 400; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .9rem; cursor: pointer; min-height: 34px;
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tag { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag-mc { background: var(--brand-soft); color: var(--brand); }
.tag-open { background: var(--warn-soft); color: var(--warn); }
.hero { padding: 26px 22px; background: linear-gradient(135deg, var(--brand) 0%, #3b2fd0 100%); color: #fff; border: 0; }
.hero h1 { font-size: 1.9rem; }
.hero p { color: rgba(255, 255, 255, .88); max-width: 60ch; }
.hero .btn { border-color: rgba(255, 255, 255, .5); }
.hero .btn-primary { background: #fde047; border-color: #fde047; color: #1a1a1a; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.5rem; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .88rem; }
.tile { display: block; text-decoration: none; color: inherit; height: 100%; }
.tile:hover { border-color: var(--brand); }
.tile h3 { display: flex; align-items: center; gap: 8px; }
.tile .ico { font-size: 1.4rem; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; }
.bar .b-ok { background: var(--ok); }
.bar .b-part { background: var(--accent); }
.bar .b-bad { background: var(--bad); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--border); flex: none; }
.dot.right { background: var(--ok); }
.dot.partial { background: var(--accent); }
.dot.wrong { background: var(--bad); }

details.more { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--brand); }

/* ---------- task list */
.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tasklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.taskrow { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; text-decoration: none; color: inherit; }
.taskrow:hover { border-color: var(--brand); }
.taskrow .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 3px; }
.taskrow .title { font-weight: 700; font-size: .95rem; }
.taskrow .stem { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.taskrow .dot { margin-top: 6px; }

/* ---------- task view */
.task-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.task-head .title { font-weight: 700; }
.paper { background: #fff; border-radius: 10px; border: 1px solid var(--border); padding: 8px; overflow: hidden; }
.paper img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.paper + .paper { margin-top: 10px; }
.options { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.opt {
  width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 11px 13px; font: inherit; cursor: pointer; min-height: 48px;
}
.opt:hover:not(:disabled) { border-color: var(--brand); }
.opt .key {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-2); font-weight: 700; font-size: .9rem;
}
.opt.multi .key { border-radius: 6px; }
.opt[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.opt[aria-pressed="true"] .key { background: var(--brand); color: var(--brand-ink); }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.correct .key { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .key { background: var(--bad); color: #fff; }
.opt.missed { border-style: dashed; border-color: var(--ok); }
.opt:disabled { cursor: default; }
.opt .txt { padding-top: 2px; }
.subq { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); }
.subq-label { font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.subq .options { margin-top: 10px; }
.subfb { margin: 6px 0 0; padding-left: 20px; font-weight: 500; }
.feedback { border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-weight: 600; }
.feedback.right { background: var(--ok-soft); color: var(--ok); }
.feedback.partial { background: var(--warn-soft); color: var(--warn); }
.feedback.wrong { background: var(--bad-soft); color: var(--bad); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.solution h3 { margin-top: 18px; }
.selfgrade { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hint { font-size: .88rem; color: var(--muted); margin-top: 8px; }
.kbd { font: 600 .78rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; background: var(--surface-2); }

/* ---------- runner */
.runbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.runbar .progress { flex: 1; min-width: 140px; }
.timer { font: 700 1.1rem ui-monospace, SFMono-Regular, Consolas, monospace; padding: 6px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.timer.low { color: var(--bad); border-color: var(--bad); }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.qbtn { min-height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; position: relative; }
.qbtn.answered { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.qbtn.current { outline: 2px solid var(--brand); outline-offset: 1px; }
.qbtn.flagged::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.qbtn.right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.qbtn.partial { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.qbtn.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.qbtn.pending { border-style: dashed; }
.qbtn.none { border-color: var(--bad); color: var(--bad); }
.qbtn.skipped { color: var(--muted); }
.score-big { font-size: 3rem; font-weight: 800; line-height: 1; }
.sharebox { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.sharebox input { flex: 1; min-width: 200px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; }
.note { border-left: 4px solid var(--accent); background: var(--warn-soft); padding: 10px 12px; border-radius: 8px; font-size: .92rem; }
table.simple { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.simple th, table.simple td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.simple th { color: var(--muted); font-weight: 600; }
table.simple td.num { text-align: right; white-space: nowrap; }
.tablewrap { overflow-x: auto; }

/* ---------- lightbox, toast */
.lightbox { position: fixed; inset: 0; background: rgba(8, 12, 20, .88); z-index: 100; display: flex; flex-direction: column; }
.lightbox[hidden] { display: none; }
.lightbox-body { flex: 1; overflow: auto; padding: 48px 12px 16px; -webkit-overflow-scrolling: touch; }
.lightbox-body img { display: block; margin: 0 auto; max-width: none; width: min(1400px, 200%); background: #fff; border-radius: 8px; }
.lightbox-close { position: fixed; top: 10px; right: 12px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff; color: #111; font-size: 1.2rem; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 120; max-width: calc(100% - 32px); }
.footer { color: var(--muted); font-size: .84rem; padding-bottom: 30px; }
.footer p { margin: 0 0 .4em; }

@media (max-width: 600px) {
  h1 { font-size: 1.45rem; }
  .hero h1 { font-size: 1.55rem; }
  .card { padding: 14px; }
  .mainnav a { padding: 6px 8px; font-size: .9rem; }
  .actions .btn { flex: 1 1 auto; }
  .lightbox-body img { width: 220%; }
}
