/* Položeno — zajednički stil (početna, aplikacija, pravne stranice) */
:root {
  --bg: #faf7f0;
  --surface: #ffffff;
  --surface-2: #f2ede1;
  --ink: #0f1b3d;
  --ink-2: #3b4763;
  --muted: #6b7385;
  --line: #e6dfcf;
  --brand: #2443b8;
  --brand-2: #1b3494;
  --brand-soft: #e8edff;
  --on-brand: #ffffff;
  --marker: #ffe14d;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --bad: #b42318;
  --bad-soft: #fee4e2;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --focus: 0 0 0 3px rgba(36, 67, 184, 0.28);
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 61, 0.04), 0 8px 24px -8px rgba(15, 27, 61, 0.12);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1226;
    --surface: #121b33;
    --surface-2: #1a2542;
    --ink: #e8edf7;
    --ink-2: #c3cde0;
    --muted: #8e9bb5;
    --line: #243154;
    --brand: #8ea6ff;
    --brand-2: #a9bbff;
    --brand-soft: #1b2752;
    --on-brand: #0b1530;
    --ok: #4ade80;
    --ok-soft: #0f2b1c;
    --bad: #f87171;
    --bad-soft: #3a1416;
    --warn: #fbbf24;
    --warn-soft: #33270b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.02em; font-family: var(--serif); font-weight: 700; font-variation-settings: "opsz" 144; }
p { margin: 0 0 1em; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- zaglavlje ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .bar { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo img { width: 30px; height: 30px; }
.logo .word { font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: -0.03em; line-height: 1; }
.logo .word i { font-style: normal; color: var(--brand); }
@media (prefers-color-scheme: dark) { .logo img { filter: brightness(0) invert(1) opacity(0.92); } }
.spacer { flex: 1; }
.nav a { color: var(--ink-2); font-size: 15px; margin-left: 18px; }
@media (max-width: 640px) { .nav a.opt-link { display: none; } }

/* ---------- dugmad ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-quiet:hover { background: var(--surface-2); border-color: transparent; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; }
.pill.hot { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.pill.cold { color: var(--muted); }

/* ---------- kartice i elementi ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 14px; }
.card h3 { font-size: 17px; }
.row { display: flex; align-items: center; gap: 12px; }
.stack > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.track > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width 0.4s ease; }
.track.warn > i { background: var(--warn); }
.kbd { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--muted); }

/* ---------- početna (landing) ---------- */
.hero { padding: 64px 0 40px; }
.hero h1 { font-size: clamp(32px, 5.4vw, 54px); max-width: 15ch; }
.hero .lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-2); max-width: 56ch; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 40px; }
.facts .card { padding: 16px; }
.facts b { display: block; font-size: 26px; letter-spacing: -0.02em; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr 1fr; } }
.section { padding: 48px 0; }
.section h2 { font-size: clamp(24px, 3.4vw, 34px); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.feature .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 12px; }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.steps .card::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 700; margin-bottom: 12px; }
.price { max-width: 460px; margin: 24px auto 0; text-align: left; }
.price .amount { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; }
.price ul, .paylist { list-style: none; padding: 0; margin: 16px 0 20px; }
.price li, .paylist li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.price li .icon, .paylist li .icon { color: var(--brand); margin-top: 3px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.faq details + details { margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--ink-2); }
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; margin-top: 24px; color: var(--muted); font-size: 14px; }
.foot a { color: var(--ink-2); margin-right: 16px; }
.legal h1 { font-size: 30px; margin-top: 32px; }
.legal h2 { font-size: 20px; margin-top: 28px; }
.legal { padding-bottom: 32px; }
.note { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--ink); font-size: 14px; }

/* ---------- aplikacija ---------- */
.app main { padding: 20px 0 64px; }
.hello { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.hello h1 { font-size: 24px; margin: 0; }
.ready { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.ring { width: 112px; height: 112px; position: relative; }
.ring svg { width: 112px; height: 112px; transform: rotate(-90deg); }
.ring .bg { stroke: var(--surface-2); }
.ring .fg { stroke: var(--brand); transition: stroke-dashoffset 0.6s ease; }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .val b { font-family: var(--serif); font-size: 30px; letter-spacing: -0.02em; line-height: 1; }
.ring .val span { font-size: 12px; color: var(--muted); }
.goal { margin-top: 12px; }
.goal .row { justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.go { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.go:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.go .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.go b { display: block; font-size: 16px; color: var(--ink); }
.go.main b { color: var(--on-brand); }
.go span { color: var(--muted); font-size: 14px; }
.go.main { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.go.main .ico { background: rgba(255, 255, 255, 0.16); color: var(--on-brand); }
.go.main span { color: color-mix(in srgb, var(--on-brand) 80%, transparent); }
.go .end { margin-left: auto; }
.areas .area { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); cursor: pointer; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; }
.areas .area:first-of-type { border-top: 0; }
.areas .area:hover .name { color: var(--brand); }
.areas .area .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; }
.areas .name { font-weight: 600; font-size: 15px; }
.areas .meta { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.areas .meta .icon { width: 14px; height: 14px; }
.areas .track { margin-top: 6px; }
.upsell { display: flex; gap: 14px; align-items: center; background: #0f1b3d; color: #fff; border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; }
.upsell .btn { background: var(--marker); color: #0f1b3d; border-color: var(--marker); white-space: nowrap; }
@media (max-width: 520px) { .upsell { flex-direction: column; align-items: stretch; } }
.exams { display: flex; gap: 6px; align-items: flex-end; height: 56px; margin-top: 10px; }
.exams i { flex: 1; max-width: 26px; border-radius: 6px 6px 2px 2px; background: var(--bad); opacity: 0.85; }
.exams i.pass { background: var(--ok); }

/* kviz */
.qtop { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.qtop .track { flex: 1; }
.qarea { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }
.qtext { font-size: clamp(19px, 2.6vw, 22px); font-weight: 600; line-height: 1.42; margin-bottom: 20px; }
.opts { display: grid; gap: 10px; }
.opt { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1.45; transition: border-color 0.12s ease, background 0.12s ease; }
.opt:hover:not([disabled]) { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.opt .kbd { min-width: 30px; height: 30px; }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); }
.opt.ok .kbd { background: var(--ok); color: #fff; border-color: var(--ok); }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); }
.opt.bad .kbd { background: var(--bad); color: #fff; border-color: var(--bad); }
.opt[disabled] { cursor: default; }
.opt .mark { color: var(--ok); }
.opt.bad .mark { color: var(--bad); }
.fb { margin-top: 16px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.fb.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.fb.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.fb h4 { margin: 0 0 6px; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.fb.ok h4 { color: var(--ok); }
.fb.bad h4 { color: var(--bad); }
.fb p { margin: 0; color: var(--ink-2); font-size: 15px; }
.qfoot { position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); margin-top: 18px; }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 10px; }
@media (hover: none) { .hint { display: none; } }

/* ispit */
.timer { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; }
.timer.low { color: var(--bad); }
.qgrid { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; margin: 0 0 18px; }
@media (max-width: 520px) { .qgrid { grid-template-columns: repeat(7, 1fr); } }
.qgrid button { aspect-ratio: 1; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; padding: 0; }
.qgrid button.done { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.qgrid button.cur { border-color: var(--brand); color: var(--ink); box-shadow: var(--focus); }
.navrow { display: flex; gap: 10px; }
.navrow .btn { flex: 1; }

/* rezultat */
.result { text-align: center; padding: 28px 20px; }
.result .big { font-family: var(--serif); font-size: 60px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; margin: 10px 0; }
.verdict { display: inline-flex; gap: 8px; align-items: center; padding: 8px 16px; border-radius: 999px; font-weight: 700; }
.verdict.pass { background: var(--ok-soft); color: var(--ok); }
.verdict.fail { background: var(--bad-soft); color: var(--bad); }
.review .item { padding: 14px 0; border-top: 1px solid var(--line); }
.review .item:first-child { border-top: 0; }
.review .q { font-weight: 600; margin-bottom: 6px; }
.review .no, .review .yes { display: flex; gap: 6px; align-items: flex-start; }
.review .no { color: var(--bad); }
.review .yes { color: var(--ok); }
.review .no .icon, .review .yes .icon { width: 16px; height: 16px; margin-top: 3px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table td { padding: 9px 0; border-top: 1px solid var(--line); }
.table td:last-child { text-align: right; font-weight: 600; }

/* modal i poruke */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 15, 28, 0.55); }
.modal .card { width: 100%; max-width: 420px; padding: 24px; max-height: calc(100vh - 32px); overflow: auto; }
.modal h2 { font-size: 22px; }
.field { display: block; width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.field:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- način fokusa: učenje i simulacija preko cijelog ekrana, bez skrolanja stranice ---------- */
body.focus { overflow: hidden; }
body.focus .top { display: none; }
.app body.focus main, body.focus.app main { padding: 0; }
.stage { height: 100vh; height: 100dvh; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; }
.stage-top { flex: none; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.stage-top .track { flex: 1; }
.stage-top .counter { font-size: 14px; font-weight: 700; color: var(--muted); min-width: 40px; text-align: right; }
.stage-top .timer { font-size: 15px; }
.icon-btn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin-left: -8px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.stage-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 6px 16px 18px; }
.stage-body .qarea { margin-bottom: 8px; }
.stage-body .qtext { font-size: clamp(18px, 4.8vw, 22px); margin-bottom: 16px; }
.stage-body .opts { gap: 9px; }
.stage-body .opt { padding: 13px 14px; font-size: 16px; min-height: 56px; }
.opt.dim { opacity: 0.55; }
.stage-foot { flex: none; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.stage-foot .hint { margin: 0; }
@media (hover: none) { .stage-foot.idle { display: none; } }
/* povratna informacija kao donji panel */
.stage-foot.sheet { border-top: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px -12px rgba(15, 27, 61, 0.25); animation: rise 0.18s ease-out; }
.stage-foot.sheet.ok { background: var(--ok-soft); }
.stage-foot.sheet.bad { background: var(--bad-soft); }
.fb-body { max-height: 34vh; max-height: 34dvh; overflow-y: auto; margin-bottom: 12px; }
.fb-body h4 { margin: 0 0 6px; font-size: 18px; display: flex; gap: 8px; align-items: center; }
.stage-foot.ok .fb-body h4 { color: var(--ok); }
.stage-foot.bad .fb-body h4 { color: var(--bad); }
.fb-body p { margin: 0; font-size: 15px; color: var(--ink); line-height: 1.5; }
.fb-body p.ex { margin-top: 8px; color: var(--ink-2); }
@keyframes rise { from { transform: translateY(16px); opacity: 0.6; } to { transform: none; opacity: 1; } }
/* simulacija: donja traka za kretanje */
.exam-foot { display: flex; gap: 10px; }
.exam-foot .btn { min-height: 52px; padding: 0 16px; }
.exam-foot .btn.grow { flex: 1; gap: 8px; }
.exam-foot .btn .icon { width: 22px; height: 22px; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); border-color: var(--bad); }
/* pregled pitanja u donjem panelu */
.modal .qgrid { grid-template-columns: repeat(7, 1fr); gap: 7px; margin: 14px 0 18px; }
.modal .qgrid button { font-size: 14px; border-radius: 10px; }
/* na telefonu se dijalozi otvaraju odozdo (lakše palcem) */
@media (max-width: 560px) {
  .modal { place-items: end center; padding: 0; }
  .modal .card { max-width: none; border-radius: 22px 22px 0 0; padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); animation: rise 0.18s ease-out; }
}
/* niski ekrani (npr. iPhone SE): gušće, da pitanje i odgovori stanu bez skrolanja */
@media (max-height: 740px) {
  .stage-top { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 6px; }
  .stage-body { padding-top: 2px; }
  .stage-body .qarea { margin-bottom: 4px; font-size: 12px; }
  .stage-body .qtext { font-size: 17px; line-height: 1.36; margin-bottom: 12px; }
  .stage-body .opts { gap: 7px; }
  .stage-body .opt { padding: 9px 12px; min-height: 48px; font-size: 15px; line-height: 1.36; column-gap: 10px; }
  .stage-body .opt .kbd { min-width: 26px; height: 26px; }
  .stage-foot { padding-top: 9px; padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
  .exam-foot .btn { min-height: 46px; }
  .stage-foot.sheet .btn-lg { min-height: 48px; }
}
