/* =====================================================================
   Formularz zapisów - "jedno pytanie na ekran"
   Osobny arkusz, celowo niezależny od styles.css, żeby zmiany na
   stronie głównej nie ruszały tego formularza (i odwrotnie).
   ===================================================================== */

:root {
    --red: #C0101A;
    --red-dark: #96070F;
    --yellow: #FFC423;
    --yellow-dark: #F7B500;
    --cream: #FFF9EC;
    --ink: #241012;
    --ink-soft: #6B5A5C;
    --line: rgba(36, 16, 18, 0.12);
    --white: #fff;
    --radius: 18px;
    --radius-pill: 999px;
    --font-head: 'Pally', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --shadow-card: 0 18px 45px rgba(150, 7, 15, 0.13);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--cream);
    /* Delikatne tło w barwach marki, bez dodatkowych plików graficznych */
    background-image:
        radial-gradient(circle at 12% 8%, rgba(255, 196, 35, 0.28), transparent 42%),
        radial-gradient(circle at 88% 92%, rgba(192, 16, 26, 0.16), transparent 46%);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.55;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* =============== SZKIELET =============== */
.quiz-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px calc(20px + env(safe-area-inset-bottom));
}

.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0 10px;
}

.quiz-logo img {
    height: 46px;
    width: auto;
}

/* =============== PRZEŁĄCZNIK JĘZYKA =============== */
.quiz-lang {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 4px;
    backdrop-filter: blur(6px);
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--ink-soft);
    transition: background-color 0.2s ease, color 0.2s ease;
    min-height: 38px;
}

.lang-btn.is-active {
    background: var(--red);
    color: var(--white);
}


/* =============== PASEK POSTĘPU =============== */
.quiz-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0 16px;
}

.quiz-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(192, 16, 26, 0.12);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--yellow) 0%, var(--red) 100%);
    border-radius: var(--radius-pill);
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-progress-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* =============== SCENA / KARTA PYTANIA =============== */
.quiz-stage {
    flex: 1;
    display: flex;
    align-items: flex-start;
    /* Zapas na przyklejoną stopkę - bez tego ostatnia opcja długiej listy
       (np. "Niedziela") chowa się pod przyciskiem "Dalej". */
    padding-bottom: 96px;
}

.card {
    width: 100%;
    background: var(--white);
    border-radius: 26px;
    box-shadow: var(--shadow-card);
    padding: 34px 30px;
    animation: cardIn 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.card.is-leaving {
    animation: cardOut 0.22s ease-in both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes cardOut {
    to {
        opacity: 0;
        transform: translateY(-12px);
    }
}

@media (prefers-reduced-motion: reduce) {

    .card,
    .card.is-leaving {
        animation: none;
    }

    .quiz-progress-fill {
        transition: none;
    }
}

/* =============== IKONA PYTANIA =============== */
.q-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(140deg, var(--yellow) 0%, var(--yellow-dark) 100%);
    color: var(--red);
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    box-shadow: 0 10px 22px rgba(255, 196, 35, 0.45);
}

.q-icon svg {
    width: 34px;
    height: 34px;
}

.q-step {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 8px;
}

.q-title {
    font-family: var(--font-head);
    font-size: clamp(1.45rem, 4.4vw, 2rem);
    font-weight: 700;
    line-height: 1.22;
    color: var(--ink);
    margin-bottom: 10px;
}

.q-help {
    color: var(--ink-soft);
    font-size: 0.97rem;
    margin-bottom: 24px;
}

/* =============== OPCJE WYBORU =============== */
.options {
    display: grid;
    gap: 12px;
}

.options.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: left;
    padding: 16px 18px;
    min-height: 62px;
    background: var(--white);
    border: 2px solid var(--line);
    border-radius: var(--radius);
    font-weight: 600;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.option:hover {
    border-color: var(--yellow);
    background: #FFFDF6;
}

.option:active {
    transform: scale(0.985);
}

.option.is-selected {
    border-color: var(--red);
    background: #FFF4F4;
}

.option-mark {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    border: 2px solid var(--line);
    display: grid;
    place-items: center;
    color: transparent;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.options.is-single .option-mark {
    border-radius: 50%;
}

.option.is-selected .option-mark {
    background: var(--red);
    border-color: var(--red);
    color: var(--white);
}

.option-mark svg {
    width: 15px;
    height: 15px;
}

.option-emoji {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    min-width: 0;
}

.option-label {
    display: block;
}

.option-sub {
    display: block;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 2px;
}

/* =============== POLA TEKSTOWE =============== */
.field {
    width: 100%;
    padding: 16px 18px;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--ink);
    background: #FFFDF8;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(192, 16, 26, 0.1);
}

.field::placeholder {
    color: #B7A9AA;
}

textarea.field {
    min-height: 130px;
    resize: vertical;
    line-height: 1.5;
}

.field-inline {
    margin-top: 12px;
}

/* =============== KOMUNIKAT BŁĘDU =============== */
.q-error {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--red);
    font-size: 0.9rem;
    font-weight: 600;
}

.q-error svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

/* =============== EKRAN POWITALNY / KOŃCOWY =============== */
.intro {
    text-align: center;
}

.intro-img {
    width: 190px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--yellow);
    box-shadow: 0 14px 30px rgba(192, 16, 26, 0.2);
    aspect-ratio: 1;
}

.intro-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.intro-kicker {
    font-family: var(--font-head);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 10px;
}

.intro-title {
    font-family: var(--font-head);
    font-size: clamp(1.6rem, 5.2vw, 2.3rem);
    font-weight: 700;
    line-height: 1.18;
    margin-bottom: 18px;
}

.intro-body {
    text-align: left;
    color: #4A3A3C;
    font-size: 1rem;
    display: grid;
    gap: 12px;
    margin-bottom: 26px;
}

.intro-body strong {
    color: var(--ink);
}

.intro-sign {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--red);
    text-align: center;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

.intro-time {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.intro-time svg {
    width: 16px;
    height: 16px;
}

/* =============== PODSUMOWANIE =============== */
.summary-list {
    display: grid;
    gap: 2px;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 8px;
}

.summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    padding: 13px 16px;
    background: #FFFDF8;
    border-bottom: 1px solid var(--line);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-key {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
    flex: 0 0 100%;
}

.summary-val {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.summary-edit {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--red);
    text-decoration: underline;
    padding: 2px 4px;
}

/* =============== EKRAN KOŃCOWY =============== */
.done-badge {
    width: 82px;
    height: 82px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--yellow), var(--yellow-dark));
    display: grid;
    place-items: center;
    color: var(--red);
    box-shadow: 0 14px 30px rgba(255, 196, 35, 0.5);
    animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.done-badge svg {
    width: 44px;
    height: 44px;
}

@keyframes pop {
    from {
        transform: scale(0.4);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.done-next {
    margin-top: 26px;
    padding: 22px;
    background: var(--cream);
    border: 2px dashed var(--yellow-dark);
    border-radius: var(--radius);
    text-align: center;
}

.done-next h3 {
    font-family: var(--font-head);
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.done-next p {
    color: var(--ink-soft);
    font-size: 0.94rem;
    margin-bottom: 18px;
}

.done-img {
    width: 150px;
    margin: 24px auto 0;
}

/* =============== PRZYCISKI =============== */
.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 15px 32px;
    min-height: 54px;
    background: var(--red);
    color: var(--white);
    font-weight: 700;
    font-size: 1.02rem;
    border-radius: var(--radius-pill);
    box-shadow: 0 10px 24px rgba(192, 16, 26, 0.3);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.btn-cta:hover {
    background: var(--red-dark);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(192, 16, 26, 0.38);
}

.btn-cta:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-cta svg {
    width: 18px;
    height: 18px;
}

.btn-cta.btn-yellow {
    background: var(--yellow);
    color: var(--ink);
    box-shadow: 0 10px 24px rgba(255, 196, 35, 0.5);
}

.btn-cta.btn-yellow:hover {
    background: var(--yellow-dark);
}

.btn-wide {
    width: 100%;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    min-height: 46px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--ink-soft);
    border: 2px solid var(--line);
    transition: border-color 0.18s ease, color 0.18s ease;
    text-decoration: none;
}

.btn-ghost:hover {
    border-color: var(--red);
    color: var(--red);
}

/* =============== STOPKA NAWIGACJI =============== */
.quiz-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0 8px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 249, 236, 0) 0%, var(--cream) 40%);
    position: sticky;
    bottom: 0;
}

.quiz-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 12px 18px;
    min-height: 50px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--ink-soft);
    transition: color 0.18s ease, background-color 0.18s ease;
}

.quiz-back:hover {
    color: var(--red);
    background: rgba(192, 16, 26, 0.06);
}

.quiz-back[hidden] {
    display: none;
}

.quiz-footer .btn-cta {
    margin-left: auto;
}

.quiz-hint {
    font-size: 0.8rem;
    color: var(--ink-soft);
    font-weight: 500;
}

/* =============== NOTKA DEWELOPERSKA =============== */
.dev-note {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #FFF4D6;
    border: 1px solid var(--yellow-dark);
    font-size: 0.86rem;
    color: #6B4E00;
    text-align: left;
}

.dev-note strong {
    display: block;
    margin-bottom: 4px;
}

.dev-note code {
    font-size: 0.85em;
    background: rgba(0, 0, 0, 0.07);
    padding: 1px 5px;
    border-radius: 4px;
}

/* =============== TELEFON =============== */
@media (max-width: 640px) {
    .quiz-shell {
        padding: 0 14px calc(14px + env(safe-area-inset-bottom));
    }

    .quiz-header {
        padding: 14px 0 8px;
    }

    .quiz-logo img {
        height: 38px;
    }

    .card {
        padding: 26px 20px;
        border-radius: 22px;
    }

    .q-icon {
        width: 54px;
        height: 54px;
        border-radius: 17px;
        margin-bottom: 16px;
    }

    .q-icon svg {
        width: 28px;
        height: 28px;
    }

    .q-help {
        margin-bottom: 20px;
    }

    /* Na wąskim ekranie zawsze jedna kolumna - dwie kolumny łamałyby etykiety */
    .options.cols-2 {
        grid-template-columns: 1fr;
    }

    .option {
        padding: 14px 15px;
        min-height: 58px;
        gap: 12px;
    }

    .intro-img {
        width: 150px;
    }

    .intro-body {
        font-size: 0.95rem;
    }

    /* Stopka: przycisk "Dalej" ma być największym celem dotyku */
    .quiz-footer {
        gap: 10px;
        padding: 12px 0 6px;
    }

    .quiz-back {
        padding: 12px 14px;
    }

    .quiz-footer .btn-cta {
        flex: 1;
        padding: 15px 20px;
    }

    /* Podpowiedź o klawiszu Enter nie ma sensu na telefonie */
    .quiz-hint {
        display: none;
    }

    .done-next {
        padding: 18px 16px;
    }
}

@media (max-width: 360px) {
    .lang-btn {
        padding: 7px 11px;
        font-size: 0.8rem;
    }
}

/* =============== KLAUZULA RODO NA PODSUMOWANIU ===============
   Widoczna w chwili zbierania danych, czyli zanim ktos kliknie
   "Wyslij". Celowo stonowana - to informacja, nie ostrzezenie.
   ============================================================== */

.rodo-note {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #F5F6F7;
    border: 1px solid #E2E5E8;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #5B6369;
    text-align: left;
}

.rodo-note strong {
    display: block;
    margin-bottom: 4px;
    color: #3D4247;
}

.rodo-note p {
    margin: 0;
}

.rodo-note a {
    color: var(--red, #C0101A);
    text-decoration: underline;
}

/* Przyklejony pasek z przyciskiem "Dalej" nie moze chowac sie pod
   banerem zgody. Gdy baner jest schowany, zmienna nie istnieje
   i wartosc zapasowa 0px daje dokladnie stare zachowanie. */
.quiz-footer {
    bottom: var(--hzj-baner-h, 0px);
}

/* Belka z linkami prawnymi pod formularzem. Celowo cicha - ma byc
   dostepna, a nie konkurowac z przyciskiem "Dalej". */
.quiz-prawne {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px calc(24px + env(safe-area-inset-bottom));
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    justify-content: center;
    align-items: center;
    font-size: 0.78rem;
    color: var(--ink-soft, #6B7280);
}

.quiz-prawne a,
.quiz-prawne .hzj-cookies-link {
    color: inherit;
    text-decoration: underline;
    font-size: inherit;
}

.quiz-prawne a:hover,
.quiz-prawne .hzj-cookies-link:hover {
    color: var(--red, #C0101A);
}
