/* Warmińsko-Mazurski Czek Turystyczny — formularz Uczestnika
   Kolorystyka wg wmrot.org (zieleń marki) i znaku Warmia Mazury (błękit, żółć).
   Bez zewnętrznych zasobów: czcionki systemowe, ikony inline SVG/tekst.
   created: 2026-08-13 BBU (Claude Code, Opus 5) */

:root {
    --brand: #139930;           /* zieleń marki — akcenty dekoracyjne */
    --brand-dark: #0C7C19;      /* zieleń przyciemniona — tekst i przyciski (kontrast 5,3:1) */
    --brand-darker: #0A6614;
    --brand-tint: #E9F5EB;
    --sky: #28B4E9;             /* błękit ze znaku */
    --focus: #0E6E93;           /* błękit przyciemniony — obrys fokusu */
    --sun: #F2B705;
    --ink: #1B292B;
    --muted: #5B6B6E;
    --line: #D3DAD9;
    --bg: #F4F7F5;
    --error: #B3261E;
    --error-bg: #FDECEA;
    --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

/* atrybut hidden musi wygrywać z display: flex/grid ustawionym na komponentach */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

a { color: var(--brand-dark); }
a:hover { color: var(--brand-darker); }

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
    position: absolute; left: 16px; top: -60px;
    background: #fff; color: var(--brand-dark);
    padding: 10px 16px; border-radius: 0 0 var(--radius) var(--radius);
    font-weight: 700; z-index: 10; transition: top .15s;
}
.skip-link:focus { top: 0; }

/* ---------- nagłówek / stopka ---------- */

.site-header {
    background: #fff;
    border-top: 5px solid var(--brand);
    border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.logo { width: 44px; height: 44px; flex: none; }
.site-header__title { margin: 0; line-height: 1.25; }
.site-header__title strong { display: block; font-size: 1.05rem; }
.site-header__title span { display: block; font-size: .8rem; color: var(--muted); }

.site-footer {
    margin-top: 40px; padding: 20px 0 32px;
    border-top: 1px solid var(--line);
    font-size: .875rem; color: var(--muted);
}
.site-footer p { margin: 4px 0; }

/* ---------- nagłówek strony i fakty ---------- */

h1 { font-size: 1.75rem; line-height: 1.2; margin: 28px 0 16px; }
h2 { font-size: 1.3rem; line-height: 1.25; margin: 0 0 6px; }
h3 { font-size: 1.05rem; margin: 22px 0 8px; }

.facts {
    list-style: none; display: flex; flex-wrap: wrap; gap: 8px;
    margin: 0 0 22px; padding: 0; font-size: .875rem; color: var(--muted);
}
.facts li {
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    padding: 6px 14px;
}
.facts strong { color: var(--ink); }

/* ---------- pasek kroków ---------- */

.stepper {
    list-style: none; display: flex; margin: 0 0 14px; padding: 0;
    counter-reset: step; gap: 6px;
}
.stepper li {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    font-size: .8rem; color: var(--muted); position: relative; padding-top: 4px;
}
.stepper li::before {
    content: ""; position: absolute; top: 20px; left: -50%; width: 100%; height: 2px;
    background: var(--line);
}
.stepper li:first-child::before { display: none; }
.stepper li.is-done::before, .stepper li.is-current::before { background: var(--brand); }
.stepper__num {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 2px solid var(--line); color: var(--muted);
    font-weight: 700; position: relative; z-index: 1;
}
.stepper li.is-done .stepper__num { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper li.is-current .stepper__num { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.stepper li.is-current .stepper__lbl { color: var(--ink); font-weight: 600; }

/* ---------- karta ---------- */

.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px 20px;
}

.step__title { margin-bottom: 6px; }
.step__title:focus-visible { outline-offset: 4px; }
.step__hint { margin: 0 0 18px; color: var(--muted); font-size: .9375rem; }

/* ---------- kafle wyboru grupy ---------- */

.tiles { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; }

.tile { position: relative; }
.tile input {
    position: absolute; top: 18px; left: 16px; width: 22px; height: 22px;
    accent-color: var(--brand-dark); margin: 0;
}
.tile label {
    display: block; cursor: pointer;
    border: 2px solid var(--line); border-radius: var(--radius);
    padding: 16px 16px 16px 52px; background: #fff;
    transition: border-color .12s, background-color .12s;
}
.tile label:hover { border-color: var(--brand); background: var(--brand-tint); }
.tile input:checked + label { border-color: var(--brand-dark); background: var(--brand-tint); }
.tile input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

.tile__icon {
    display: inline-block; margin-bottom: 6px;
    background: var(--brand-dark); color: #fff; font-weight: 700; font-size: .8rem;
    letter-spacing: .02em; padding: 3px 10px; border-radius: 999px;
}
.tile__name { display: block; font-weight: 700; font-size: 1.0625rem; }
.tile__desc { display: block; color: var(--muted); font-size: .9375rem; margin-top: 4px; }

/* ---------- pola formularza ---------- */

.grid { display: grid; gap: 16px; }
@media (min-width: 620px) {
    .grid { grid-template-columns: 1fr 1fr; }
    .field--wide { grid-column: 1 / -1; }
}

/* na szerszym ekranie trzy kafle obok siebie, znacznik wyboru nad treścią */
@media (min-width: 680px) {
    .tiles { grid-template-columns: repeat(3, 1fr); }
    .tile label { padding: 48px 16px 18px; height: 100%; }
}

.field { margin: 0; display: flex; flex-direction: column; }
.field label { font-weight: 600; margin-bottom: 5px; font-size: .9375rem; }
.field abbr { color: var(--error); text-decoration: none; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select {
    font: inherit; color: var(--ink); background: #fff;
    border: 1px solid #9AA5A5; border-radius: 8px;
    padding: 11px 12px; min-height: 48px; width: 100%;
}
select { appearance: none; padding-right: 38px;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%231B292B' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 12px;
}
input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--error); border-width: 2px; background: var(--error-bg); }

.field-hint { color: var(--muted); font-size: .8125rem; margin-top: 5px; }
.field-error { color: var(--error); font-size: .875rem; font-weight: 600; margin: 5px 0 0; }
.field-error:empty { display: none; }

/* prośba o ponowne wpisanie pola pominiętego w szkicu Wniosku (WF-046) */
.field-note {
    margin-top: 6px; padding: 8px 10px; border-radius: 8px;
    background: var(--brand-tint); color: var(--brand-dark);
    font-size: .8125rem; font-weight: 600;
}

.phone { display: flex; align-items: stretch; }
.phone__prefix {
    display: flex; align-items: center; padding: 0 12px;
    border: 1px solid #9AA5A5; border-right: 0; border-radius: 8px 0 0 8px;
    background: #EEF2F1; color: var(--muted); font-weight: 600;
}
.phone input { border-radius: 0 8px 8px 0; }

.field--code { max-width: 260px; }
#code {
    font-size: 1.5rem; letter-spacing: .35em; text-align: center;
    font-variant-numeric: tabular-nums; padding-left: 18px;
}

/* ---------- zgody ---------- */

.consents { display: grid; gap: 14px; }
.consent { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.consent input {
    width: 24px; height: 24px; flex: none; margin: 1px 0 0;
    accent-color: var(--brand-dark);
}
.consent label { font-size: .9375rem; line-height: 1.45; }
.consent--box {
    border: 2px solid var(--line); border-radius: var(--radius);
    padding: 16px; align-items: center; background: #fff;
}
.consent--box label { font-weight: 600; font-size: 1rem; }

/* pułapka na boty */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- przyciski ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.actions .btn--primary { margin-left: auto; }

/* ---------- okno wyboru po odświeżeniu strony ---------- */

.overlay {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(27, 41, 43, .55);
}
.dialog { width: 100%; max-width: 440px; }
.dialog__title { margin: 0 0 10px; font-size: 1.25rem; }
.dialog__text { margin: 0; color: var(--muted); font-size: .9375rem; }
.dialog .actions { margin-top: 22px; }

.btn {
    font: inherit; font-weight: 700; cursor: pointer;
    border-radius: 8px; padding: 12px 26px; min-height: 48px;
    border: 2px solid transparent;
}
.btn--primary { background: var(--brand-dark); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-darker); }
.btn--ghost { background: #fff; color: var(--brand-dark); border-color: var(--brand-dark); }
.btn--ghost:hover:not(:disabled) { background: var(--brand-tint); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent; }
.btn.is-busy::after {
    content: ""; position: absolute; inset: 0; margin: auto;
    width: 20px; height: 20px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff;
    animation: spin .7s linear infinite;
}
.btn--ghost.is-busy::after { border-color: rgba(12, 124, 25, .3); border-top-color: var(--brand-dark); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-busy::after { animation-duration: 2s; } }

.linkbtn {
    background: none; border: 0; padding: 0; font: inherit;
    color: var(--brand-dark); text-decoration: underline; cursor: pointer;
}

.timer { color: var(--muted); font-size: .875rem; margin: 12px 0 0; }
.timer strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- ekrany wyniku ---------- */

.result { text-align: left; }
.result__badge {
    width: 52px; height: 52px; border-radius: 50%; margin: 0 0 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem; font-weight: 700; color: #fff;
}
.result--ok .result__badge { background: var(--brand-dark); }
.result--no .result__badge { background: var(--error); }
.result--ok { border-top: 5px solid var(--brand-dark); }
.result--no { border-top: 5px solid var(--error); }
.result__reason { font-size: 1.0625rem; font-weight: 600; }

.czek {
    display: grid; grid-template-columns: auto 1fr; gap: 6px 18px;
    background: var(--brand-tint); border: 1px solid var(--brand);
    border-radius: var(--radius); padding: 16px; margin: 18px 0;
}
.czek dt { color: var(--muted); font-size: .875rem; }
.czek dd { margin: 0; font-weight: 700; }
#czek-number { font-size: 1.25rem; letter-spacing: .04em; }

.next-steps { margin: 0; padding-left: 22px; }
.next-steps li { margin-bottom: 8px; }
.muted { color: var(--muted); font-size: .875rem; }

@media (max-width: 420px) {
    h1 { font-size: 1.5rem; }
    .card { padding: 20px 16px; }
    .actions .btn { flex: 1 1 100%; margin-left: 0; }
    .stepper__lbl { font-size: .7rem; }
}
