:root {
  --navy: #182B51;
  --navy-hover: #0F1F3D;
  --pink: #E84152;
  --pink-dark: #C7303F;
  --bg: #F4F5F7;
  --ink: #0B1220;
  --muted: #3B4658;
  --muted-2: #6B7587;
  --line: #E5E8EE;
  --tint: #EEF1F8;
  --white: #FFFFFF;
  --green: #1F8A5B;
  --green-bg: #E0F2EA;
  --green-line: #BFDCC7;
  --green-ink: #156645;
  --red: #C73E3E;
  --shadow: 0 1px 2px rgba(15,30,60,0.04), 0 1px 3px rgba(15,30,60,0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--navy); text-decoration-color: var(--pink); text-underline-offset: 3px; }
a:hover { color: var(--navy-hover); }

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* Header / footer */
.site-header { background: var(--navy); padding: 14px 0; }
.header-inner { display: flex; align-items: center; gap: 14px; }
.logo-header { height: 42px; width: auto; display: block; }
.header-tag { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--pink); letter-spacing: 0.14em; text-transform: uppercase; }
main#app { flex: 1; width: 100%; }
.site-footer { border-top: 1px solid var(--line); background: var(--white); padding: 24px 0; }
.site-footer p { margin: 0 auto; font-size: 12.5px; color: var(--muted-2); line-height: 1.6; text-align: center; }

/* Buttons */
.btn { font-family: inherit; cursor: pointer; border-radius: 8px; border: 1px solid transparent; font-weight: 600; transition: filter .1s, background .15s, border-color .12s, color .12s; }
.btn:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: #D2D7E0; cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; color: var(--muted); border-color: #D2D7E0; }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-pink { background: var(--pink); color: var(--white); }
.btn-pink:hover { filter: brightness(1.06); }
.btn-pink:disabled { background: var(--pink-dark); cursor: wait; }

/* Tylko dla czytnikow ekranu (komunikaty aria-live) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.fade-in { animation: fadeIn .32s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Start ---------- */
.screen { padding: 36px 0 48px; }
.start-title { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 16px; text-wrap: pretty; }
.start-lead { font-size: 16px; line-height: 1.55; margin: 0 0 24px; color: var(--muted); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.rules-label { margin: 0 0 12px; font-weight: 700; font-size: 14px; }
.rules { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.rules strong { color: var(--navy); }
.btn-cta { margin-top: 26px; width: 100%; min-height: 56px; font-size: 15px; letter-spacing: 0.04em; padding: 14px 22px; }
.start-note { margin: 14px 0 0; text-align: center; font-size: 13.5px; font-style: italic; color: var(--muted-2); }

/* ---------- Question ---------- */
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted-2); }
.q-top b { color: var(--ink); font-weight: 600; }
.q-timer { font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 500; color: var(--muted-2); }
.q-timer.warn { color: var(--pink); }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 22px; }
.progress-bar { height: 100%; background: var(--navy); border-radius: 999px; transition: width .3s; }
.q-card { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 24px 22px; box-shadow: var(--shadow); }
.q-dzial { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy-hover); background: var(--tint); border-radius: 3px; padding: 3px 8px; margin-bottom: 14px; }
.q-text { font-size: 18px; line-height: 1.45; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 22px; text-wrap: pretty; }
.answers { display: flex; flex-direction: column; gap: 10px; }
.answer { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 14px 16px; text-align: left; font-size: 14.5px; line-height: 1.5; font-family: inherit; cursor: pointer; border-radius: 12px; border: 2px solid var(--line); background: var(--white); color: var(--ink); transition: border-color .12s, background .12s; }
.answer:hover { border-color: #C2C9D6; }
.answer:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.answer.selected { border-color: var(--navy); background: var(--tint); }
.answer-badge { flex-shrink: 0; width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 600; background: var(--bg); color: var(--muted); }
.answer.selected .answer-badge { background: var(--navy); color: var(--white); }
.answer-text { flex: 1; }
.q-actions { display: flex; gap: 10px; margin-top: 22px; }
.btn-confirm { flex: 1; min-height: 52px; padding: 12px 22px; font-size: 14.5px; }
.btn-skip { min-height: 52px; padding: 12px 18px; font-size: 14px; font-weight: 500; }

/* ---------- Result ---------- */
.result-note { background: #FCEFC2; border: 1px solid #F2D788; border-radius: 10px; padding: 12px 16px; font-size: 13.5px; font-weight: 500; color: #8A6611; margin-bottom: 20px; }
.result-eyebrow { margin: 0 0 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.result-score { font-size: 54px; font-weight: 800; letter-spacing: -0.02em; margin: 0; line-height: 1; color: var(--navy); }
.result-score span { font-size: 24px; color: var(--muted-2); font-weight: 600; }
.result-thr { margin: 8px 0 0; font-size: 13.5px; color: var(--muted-2); }
.score-track { margin: 18px 0 6px; position: relative; height: 8px; background: var(--line); border-radius: 999px; }
.score-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 999px; }
.score-mark { position: absolute; top: -5px; width: 2px; height: 18px; background: var(--ink); }
.score-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: #9AA3B2; margin-bottom: 26px; }
.tier-card { margin-bottom: 18px; }
.tier-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 10px; line-height: 1.3; text-wrap: pretty; }
.tier-body { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.btn-again { margin-top: 16px; background: none; border: none; padding: 8px 0; font-size: 13px; font-weight: 500; color: var(--muted-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-again:hover { color: var(--navy); }

/* ---------- Gate ---------- */
.gate { padding: 8px 0 56px; }
.gate-inner { background: var(--navy); border-radius: 16px; padding: 26px 24px; color: #E5E8EE; }
.gate-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; line-height: 1.25; color: var(--white); text-wrap: pretty; }
.gate-lead { margin: 0 0 22px; font-size: 14.5px; line-height: 1.55; }
.gate-lead strong { color: var(--pink); }
.gate-label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: #B9C2D4; }
.gate-input { width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 8px; border: 1px solid #3B4658; background: var(--white); color: var(--ink); font-size: 16px; font-family: inherit; }
.gate-input:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.gate-consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 12.5px; line-height: 1.5; color: #B9C2D4; cursor: pointer; }
.gate-consent input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--pink); cursor: pointer; }
.gate-consent a { color: var(--pink); }
.gate-error { margin: 12px 0 0; font-size: 13.5px; font-weight: 600; color: #F0B9A8; }
.btn-gate { margin-top: 20px; width: 100%; min-height: 54px; padding: 14px 22px; font-size: 14.5px; font-weight: 700; letter-spacing: 0.04em; }
.gate-legal { margin: 14px 0 0; font-size: 11px; line-height: 1.5; color: #8A93A6; }
.gate-legal a { color: #8A93A6; text-decoration: underline; }

/* ---------- Omowienia ---------- */
.omowienia { padding: 8px 0 56px; }
.banner { background: var(--green-bg); border: 1px solid var(--green-line); border-radius: 10px; padding: 14px 16px; font-size: 13.5px; font-weight: 500; line-height: 1.5; color: var(--green-ink); margin-bottom: 26px; }
.om-h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 18px; }
/* Pobieranie omowien w PDF (auto-width = opcjonalny dodatek, nie glowne CTA) */
.pdf-box { margin: 0 0 21px; }
.btn-pdf { min-height: 44px; padding: 10px 18px; font-size: 13.5px; }
.btn-pdf.is-busy, .btn-pdf.is-busy:hover { background: #F1F3F7; border-color: #E5E8EE; color: #9AA3B2; cursor: not-allowed; }
.pdf-note { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted-2); }
.pdf-error { margin: 10px 0 0; font-size: 13.5px; font-weight: 600; color: var(--red); }
.pdf-error:empty { display: none; }

.om-list { display: flex; flex-direction: column; gap: 14px; }
.om-item { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow); }
.om-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.om-num { font-size: 11px; font-weight: 600; color: #9AA3B2; }
.om-dzial { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy-hover); background: var(--tint); border-radius: 3px; padding: 2px 7px; }
.om-tresc { font-size: 15px; line-height: 1.45; font-weight: 600; margin: 0 0 12px; }
.om-user { margin: 0 0 4px; font-size: 13.5px; line-height: 1.5; font-weight: 600; }
.om-user.correct { color: var(--green); }
.om-user.wrong { color: var(--red); }
.om-user.skip { color: var(--muted-2); }
.om-correct { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--green-ink); font-weight: 600; }
.om-text { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--muted); border-left: 3px solid var(--navy); background: var(--tint); padding: 12px 14px; border-radius: 0 8px 8px 0; }
.cta-card { margin-top: 30px; background: var(--tint); border: 1px solid #DDE3F0; border-radius: 16px; padding: 24px; }
.cta-card p { margin: 0 0 18px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.cta-card strong { color: var(--ink); }
.cta-btn { display: block; text-align: center; background: var(--navy); color: var(--white); text-decoration: none; border-radius: 8px; padding: 15px 22px; font-size: 14.5px; font-weight: 700; letter-spacing: 0.03em; transition: filter .1s; }
.cta-btn:hover { filter: brightness(1.12); color: var(--white); }
.cta-btn:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(11,18,32,0.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-overlay[hidden] { display: none; }
.modal { background: var(--white); border-radius: 16px; padding: 26px 24px; max-width: 400px; width: 100%; box-shadow: 0 2px 6px rgba(15,30,60,0.05), 0 8px 24px rgba(15,30,60,0.06); animation: fadeIn .25s ease; }
.modal-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.modal-text { margin: 0 0 20px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-actions .btn { min-height: 52px; padding: 12px 22px; font-size: 14.5px; }

@media (min-width: 680px) {
  .start-title { font-size: 32px; }
}
