/* Formulář hlášení NÚ — vanilla CSS, žádný build step.
 * Styl podle Fagron Design System (claude.ai/design „Fagron Design System"):
 * barvy a typografické tokeny z colors_and_type.css, komponenty podle
 * preview/component-buttons.html a component-inputs.html.
 * Font: Rubik (online corporate face), self-hostovaný — CSP formuláře
 * zakazuje externí zdroje a Google Fonts by byl GDPR problém. */

/* ---- Rubik (variabilní font, latin + latin-ext kvůli češtině) ---- */

@font-face {
    font-family: 'Rubik';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('fonts/rubik-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
        U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0,
        U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Rubik';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('fonts/rubik-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Fagron design tokeny ---- */

:root {
    --fagron-red:      #E6352B;
    --fagron-red-700:  #B82822;
    --fagron-red-100:  #FCE6E4;
    --fagron-grey:     #9C9E9F;
    --fagron-black:    #1A1A1A;
    --grey-900: #4B4B4B;   /* primární text */
    --grey-500: #6E7071;   /* sekundární text */
    --grey-300: #C6C7C8;   /* silnější ohraničení, disabled */
    --grey-200: #DDDEDE;   /* běžné ohraničení */
    --grey-100: #ECEDED;   /* tlumený povrch */
    --grey-50:  #F7F7F7;   /* pozadí bloků */

    --fagron-red-800:  #9A211C;

    --accent:       var(--fagron-red);      /* jen grafika (progress, akcenty) */
    --accent-ink:   var(--fagron-red-700);  /* červená pro text a výplně pod textem —
                                               #E6352B má na bílé jen 4,3:1 (WCAG AA
                                               vyžaduje 4,5:1), #B82822 má 6,3:1 */
    --accent-hover: var(--fagron-red-800);
    --c-text:   var(--grey-900);
    --c-muted:  var(--grey-500);
    --c-border: var(--grey-200);
    --c-border-input: #767676;   /* ohraničení ovládacích prvků: 1.4.11 chce 3:1 */
    --c-error:  var(--fagron-red-700);
    --c-ok:     #1B7A3D;

    --radius-sm: 4px;    /* inputy, tlačítka */
    --radius-md: 6px;    /* karty, bloky */
    --radius-pill: 999px;

    --shadow-focus: 0 0 0 3px rgba(184, 40, 34, 0.35);
    --font: 'Rubik', Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--c-text);
    /* fotografické pozadí se světlým středem; grey-50 jako fallback do načtení.
       Bílý překryv 30 % ≈ obrázek na cca 70% opacitě — sílu ladit hodnotou 0.3 */
    background-color: var(--grey-50);
    background-image: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)), url('back.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
@media (min-width: 861px) {
    body { background-attachment: fixed; }   /* na desktopu pozadí neroluje */
}

/* V embed režimu (iframe) transparentní pozadí (bez fotky) a nulový vnější
   padding — o rámování se stará stránka rodiče. */
body.embed { background: transparent; }
body.embed .wrap { padding: 0; max-width: none; }

.wrap { max-width: 860px; margin: 0 auto; padding: 40px 16px 48px; }

/* ---- Hlavička stránky (jen samostatná verze) ---- */

.page-head { position: relative; padding: 4px 0 28px; }
.logo { display: block; height: 48px; width: auto; margin-bottom: 28px; }

.eyebrow {
    font-size: .75rem; font-weight: 700; color: var(--accent-ink);
    letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px;
}

h1 {
    font-size: clamp(1.5rem, 2vw + 1rem, 2rem); font-weight: 500;
    letter-spacing: -0.02em; line-height: 1.2; color: var(--fagron-black);
    margin: 0; max-width: 560px; position: relative;
}
h2 {
    font-size: 1.125rem; font-weight: 600; line-height: 1.2;
    color: var(--fagron-black); margin: 0 0 18px;
    display: flex; align-items: center; gap: 10px;
}
/* Tečková mřížka z loga Fagron před nadpisem kroku (přesné souřadnice a barvy) */
.step h2::before, .state h2::before {
    content: ''; flex: none; width: 15px; height: 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 54.5 54.5'%3E%3Cg fill='%23E6352B'%3E%3Ccircle cx='6.99' cy='7.09' r='5.79'/%3E%3Ccircle cx='27.18' cy='7.09' r='5.79'/%3E%3Ccircle cx='47.37' cy='7.09' r='5.79'/%3E%3Ccircle cx='6.99' cy='27.28' r='5.79'/%3E%3Ccircle cx='27.18' cy='27.28' r='5.79'/%3E%3Ccircle cx='6.99' cy='47.47' r='5.79'/%3E%3C/g%3E%3Cg fill='%239C9E9F'%3E%3Ccircle cx='47.37' cy='27.28' r='5.79'/%3E%3Ccircle cx='27.18' cy='47.47' r='5.79'/%3E%3Ccircle cx='47.37' cy='47.47' r='5.79'/%3E%3C/g%3E%3C/svg%3E");
    background-size: contain; background-repeat: no-repeat;
}

/* Podtržení vždy — odkaz v textu se nesmí odlišovat jen barvou (WCAG 1.4.1) */
a { color: var(--accent-ink); text-decoration: underline; }

/* ---- Wizard jako karta (DS: bílá karta, border #DDDEDE, jemný stín) ---- */

#wizard {
    background: #fff; border: 1px solid var(--c-border); border-radius: 10px;
    box-shadow: 0 1px 3px rgba(26, 26, 26, 0.04);
    padding: 28px 32px;
}
@media (max-width: 560px) { #wizard { padding: 20px 16px; } }

/* V embedu žádná karta — o rámování se stará rodičovská stránka */
body.embed #wizard {
    background: transparent; border: 0; border-radius: 0;
    box-shadow: none; padding: 0;
}

.test-banner {
    background: #FFF3CD; border: 1px solid #E0C460; border-radius: var(--radius-sm);
    padding: 8px 12px; font-weight: 500; margin-bottom: 16px;
}
.btn-testfill {
    margin-left: 10px; padding: 4px 12px; font-size: .8rem;
    background: #fff; color: var(--c-text); border-color: #E0C460;
}

.noscript {
    background: var(--grey-50); border: 1px solid var(--c-border);
    border-radius: var(--radius-md); padding: 16px;
}

/* ---- Progress ---- */

.progress {
    margin: 0 0 24px; padding-bottom: 20px;
    border-bottom: 1px solid var(--c-border);
}
.progress-label { margin: 0 0 6px; font-weight: 500; color: var(--fagron-black); }
.progress-label .sep { color: var(--c-muted); font-weight: 400; }

.progress-bar {
    height: 5px; background: var(--grey-100); border-radius: 3px; overflow: hidden;
}
#progress-fill {
    height: 100%; width: 0; background: var(--accent); transition: width .2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Stepper: jeden řádek, číslované kroužky se spojnicí a popiskem pod nimi */
.progress-steps {
    list-style: none; display: flex; align-items: flex-start;
    margin: 16px 0 0; padding: 0;
}
.progress-steps li { flex: 1; position: relative; min-width: 0; }
/* spojnice mezi kroužky */
.progress-steps li + li::before {
    content: ''; position: absolute; top: 13px;
    left: calc(-50% + 18px); width: calc(100% - 36px); height: 2px;
    background: var(--grey-200);
}
.progress-steps li:has(.done) + li::before,
.progress-steps li:has(.current)::before {
    background: var(--accent);
}
.progress-steps button {
    font-family: var(--font); width: 100%;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    background: none; border: 0; padding: 0; cursor: default;
}
.progress-steps .dot {
    width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid var(--grey-300); background: #fff; color: var(--c-muted);
    font-size: .8rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}
.progress-steps .lbl {
    font-size: .72rem; font-weight: 500; color: var(--c-muted);
    line-height: 1.2; text-align: center; max-width: 116px;
}
.progress-steps button.done { cursor: pointer; }
.progress-steps button.done .dot {
    border-color: var(--accent); color: transparent; position: relative;
}
.progress-steps button.done .dot::after {
    content: '✓'; position: absolute; color: var(--accent-ink); font-size: .8rem;
}
.progress-steps button.done:hover .dot { background: var(--fagron-red-100); }
.progress-steps button.done .lbl { color: var(--c-text); }
.progress-steps button.current .dot {
    background: var(--accent-ink); border-color: var(--accent-ink); color: #fff;
}
.progress-steps button.current .lbl { color: var(--fagron-black); font-weight: 600; }

/* Na úzkém displeji jen „Krok 2 z 6" + tenký proužek */
@media (max-width: 560px) {
    .progress-steps { display: none; }
}

/* ---- Pole ---- */

.step { margin-bottom: 8px; }
.intro {
    background: var(--grey-50); border-radius: var(--radius-md); padding: 12px 16px;
    color: var(--c-text);
}

.field { margin-bottom: 18px; border: 0; padding: 0; }
fieldset.field { border: 0; }
fieldset.field legend { padding: 0; }

.field > label, fieldset.field legend {
    display: block; font-weight: 500; margin-bottom: 6px; font-size: .875rem;
    color: var(--c-text);
}

.hint { margin: 0 0 6px; font-size: .8rem; color: var(--c-muted); }
/* společná nápověda pod dvojicí polí (telefon / e-mail) */
.hint-row { margin: -10px 0 16px; }

input[type=text], input[type=tel], input[type=email], input[type=date],
input[type=number], select, textarea {
    width: 100%; padding: 10px 12px; font-family: var(--font); font-size: .9rem;
    color: var(--c-text); border: 1px solid var(--c-border-input);
    border-radius: var(--radius-sm); background: #fff;
}
textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent-ink); box-shadow: var(--shadow-focus);
}
/* Fokus musí být zřetelný sám o sobě (1.4.11): plný obrys, ne jen bledý stín */
button:focus-visible, a:focus-visible,
[type=checkbox]:focus-visible, [type=radio]:focus-visible, summary:focus-visible {
    outline: 2px solid var(--accent-ink); outline-offset: 2px;
    border-radius: var(--radius-sm);
}

input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

input[disabled], textarea[disabled] { background: var(--grey-100); color: var(--c-muted); }

input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] {
    border-color: var(--c-error);
}

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }

.date-pair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.date-pair .datepick { width: 130px; flex: none; }
.date-pair input[type=text]:not(.datepick) { flex: 1; min-width: 180px; }
.date-pair .or { color: var(--c-muted); font-size: .8rem; white-space: nowrap; }

/* ---- Český datepicker ---- */

#datepick-pop {
    position: absolute; z-index: 50; width: 252px; padding: 12px;
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(26, 26, 26, 0.12); font-family: var(--font);
}
.dp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dp-head strong { font-size: .9rem; font-weight: 600; color: var(--fagron-black); }
.dp-head button {
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    width: 28px; height: 28px; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--c-text);
}
.dp-head button:hover { background: var(--grey-100); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { font-size: .7rem; color: var(--c-muted); text-align: center; padding: 2px 0; }
.dp-day {
    border: 1px solid transparent; background: none; border-radius: var(--radius-sm);
    padding: 5px 0; font-size: .85rem; cursor: pointer; text-align: center; color: var(--c-text);
}
.dp-day:hover { background: var(--grey-100); }
.dp-day.today { border-color: var(--accent); }
.dp-day.sel { background: var(--accent-ink); color: #fff; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; }

.options { display: flex; flex-direction: column; gap: 8px; }
.options-wrap { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; }
.opt {
    font-weight: 400; font-size: .9rem; display: flex; align-items: baseline;
    gap: 8px; cursor: pointer;
}
.opt input { flex: none; }

/* Únikové volby (checkbox vedle vstupu) */
.escapes { display: inline-flex; gap: 16px; margin-top: 6px; }
.esc-opt {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .8rem; color: var(--c-muted); cursor: pointer;
}
.esc-like { color: var(--c-muted); }

.err { color: var(--c-error); font-size: .8rem; font-weight: 500; margin: 4px 0 0; }

.summary {
    border: 1px solid var(--c-error); border-radius: var(--radius-md);
    background: var(--fagron-red-100); padding: 12px 16px; margin-bottom: 16px;
}
.summary p { margin: 0 0 6px; font-weight: 500; color: var(--fagron-red-700); }
.summary ul { margin: 0; padding-left: 20px; }
.summary li { color: var(--grey-900); font-size: .875rem; }

.notice {
    background: var(--grey-50); border-left: 3px solid var(--fagron-grey);
    border-radius: 0 var(--radius-md) var(--radius-md) 0; padding: 12px 16px;
    font-size: .9rem;
}
.notice-serious {
    border-left-color: var(--c-error); background: var(--fagron-red-100);
}

/* ---- Souběžné přípravky ---- */

.soubezne-row {
    border: 1px solid var(--c-border); border-radius: var(--radius-md);
    padding: 14px 16px; margin-bottom: 12px;
}
.soubezne-row legend { font-weight: 500; font-size: .875rem; padding: 0 6px; }
.row-remove { margin-top: 4px; }

/* ---- Tlačítka (DS: primary red / secondary outline / tertiary link) ---- */

.btn {
    font-family: var(--font); font-size: .9rem; font-weight: 500;
    border-radius: var(--radius-sm); padding: 10px 18px;
    cursor: pointer; border: 1px solid transparent;
    transition: background .12s ease;
}
.btn-primary { background: var(--accent-ink); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary[disabled] { background: var(--grey-300); cursor: wait; }
.btn-secondary {
    background: transparent; color: var(--c-text); border-color: var(--grey-300);
}
.btn-secondary:hover { background: var(--grey-100); }
.btn-link {
    background: none; border: 0; color: var(--accent-ink);
    text-decoration: underline; padding: 4px 0; font-size: .85rem; cursor: pointer;
}

.wizard-nav {
    display: flex; justify-content: space-between; gap: 12px;
    flex-wrap: wrap;   /* tři tlačítka (po návratu z rekapitulace) na 320 px */
    border-top: 1px solid var(--c-border); padding-top: 20px; margin-top: 8px;
}
.wizard-nav #btn-next, .wizard-nav #btn-submit { margin-left: auto; }
/* „Přejít na rekapitulaci" vpravo vedle Dalšího kroku */
.wizard-nav #btn-torecap { margin-left: auto; }
.wizard-nav #btn-torecap:not([hidden]) ~ #btn-next,
.wizard-nav #btn-torecap:not([hidden]) ~ #btn-submit { margin-left: 0; }
#btn-submit { font-size: 1rem; padding: 14px 24px; }   /* DS: large variant */

.legend { color: var(--c-muted); font-size: .8rem; }

.form-tools { margin-top: 10px; text-align: left; }

/* ---- Potvrzovací dialog ---- */

dialog {
    border: 1px solid var(--c-border); border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(26, 26, 26, 0.10);
    padding: 24px; max-width: 400px; font-family: var(--font); color: var(--c-text);
}
dialog::backdrop { background: rgba(26, 26, 26, 0.4); }
dialog h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 600; color: var(--fagron-black); }
dialog p { margin: 0; font-size: .9rem; }
.dialog-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ---- Prohlášení o přístupnosti ---- */

.accessibility-dialog {
    position: relative;
    width: min(680px, calc(100% - 32px));
    max-width: 680px;
    max-height: min(82vh, 760px);
    overflow: auto;
    padding: 28px 30px;
}
.accessibility-dialog h2 {
    margin: 0 52px 10px 0;
    color: var(--fagron-black);
    font-size: 1.45rem;
}
.accessibility-dialog h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}
.accessibility-dialog p { line-height: 1.55; }
.accessibility-dialog section + section { margin-top: 18px; }
.accessibility-intro { margin-bottom: 20px !important; }
.accessibility-status {
    padding: 14px 16px;
    border-left: 4px solid var(--accent-ink);
    border-radius: var(--radius-sm);
    background: var(--grey-50);
}
.dialog-close-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--c-text);
    font: 400 1.75rem/1 var(--font);
    cursor: pointer;
}
.dialog-close-icon:hover { background: var(--grey-100); }
.dialog-close-icon:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

@media (max-width: 560px) {
    .accessibility-dialog { padding: 24px 20px; }
}

/* ---- Rekapitulace ---- */

.recap-section { margin-bottom: 20px; }
.recap-section h3 {
    font-size: .95rem; font-weight: 600; color: var(--fagron-black); margin: 0 0 8px;
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.recap-section h3 a { font-size: .8rem; font-weight: 500; }
.recap-section dl {
    margin: 0; border: 1px solid var(--c-border);
    border-radius: var(--radius-md); overflow: hidden;
}
.recap-row { display: grid; grid-template-columns: 40% 60%; }
.recap-row + .recap-row { border-top: 1px solid var(--c-border); }
.recap-row dt {
    padding: 7px 12px; background: var(--grey-50); font-size: .8rem;
    color: var(--c-muted); margin: 0;
}
.recap-row dd { padding: 7px 12px; margin: 0; font-size: .875rem; overflow-wrap: anywhere; }
.recap-row dd.esc { color: var(--accent-ink); font-style: italic; }
@media (max-width: 560px) { .recap-row { grid-template-columns: 1fr; } .recap-row dd { padding-top: 0; } }

.privacy { margin: 24px 0; font-size: .875rem; }
.privacy details { margin: 8px 0; }
.privacy summary { cursor: pointer; color: var(--accent-ink); font-weight: 500; }
.privacy dt { font-weight: 600; margin-top: 12px; color: var(--fagron-black); }
.privacy dd { margin: 2px 0 0; color: var(--c-text); }

/* ---- Stavy ---- */

.state { text-align: center; padding: 40px 16px; }
.state h2 { justify-content: center; color: var(--c-ok); }
.state-error h2 { color: var(--c-error); }
.state .ref {
    font-size: 1.25rem; font-weight: 600; color: var(--fagron-black);
    background: var(--grey-100); display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 22px; border-radius: var(--radius-md); letter-spacing: .03em;
    border: 1px dashed var(--grey-300); font-family: var(--font); cursor: pointer;
}
.state .ref:hover { background: var(--grey-200); }
/* ikona kopírování naznačuje, že číslo je klikací */
.state .ref::after {
    content: ''; flex: none; width: 15px; height: 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E7071' stroke-width='2'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M15 5V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h1'/%3E%3C/svg%3E");
    background-size: contain; background-repeat: no-repeat;
}
.ref-hint { font-size: .8rem; color: var(--c-muted); margin: 6px 0 12px; }
.ref-hint.copied { color: var(--c-ok); font-weight: 500; }
.state-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ---- Patička ---- */

.footer {
    margin-top: 24px;
    font-size: .8rem; color: var(--c-text);
    /* patička leží mimo bílou kartu na fotografickém pozadí — bez vlastního
       podkladu klesal kontrast textu místy ke 2:1 (WCAG 1.4.3) */
    background: rgba(255, 255, 255, 0.92);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}
body.embed .footer {
    background: transparent; border-radius: 0; padding: 14px 0 0;
    border-top: 1px solid var(--c-border);
}
.footer a { color: var(--accent-ink); font-weight: 500; }
.footer-meta { margin-bottom: 0; }
.footer-link {
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-ink);
    font: inherit;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
}
.footer-link:hover { color: var(--accent-hover); }
.footer-link:focus-visible {
    outline: 2px solid var(--accent-ink);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ---- Honeypot: mimo obrazovku, ne display:none (některé boty to poznají) ---- */
.hp {
    position: absolute !important; left: -9999px !important;
    width: 1px; height: 1px; overflow: hidden;
}

/* ---- Přístupnost: respektovat omezení animací v systému ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
