/* Stránky čekací listiny (/vyzkouset/ a /potvrdit/): doplněk ke styles.css. Vzory popisuje DESIGN.md. */

/* ---------- Tmavá plocha s gradientem, maskot a nadpis ---------- */
.wl { --focus: var(--lemon); position: relative; isolation: isolate; overflow: hidden; min-height: 70svh; padding: 6.75rem 0 clamp(3rem, 7vw, 5.5rem); background: var(--night); color: var(--white); text-align: center; }
html:not(.js) .wl { padding-top: 2rem; }
.wl > .wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.wl .wl-buddy { width: clamp(7rem, 24vw, 9.5rem); height: clamp(7rem, 24vw, 9.5rem); margin-bottom: 1.75rem; }
.wl > .wrap > h1 { max-width: 13em; font-size: clamp(2.125rem, 1.2rem + 4.2vw, 3.5rem); line-height: 1.08; }
.wl-lead { max-width: 28rem; margin-top: 1rem; color: #ebe8ff; font-size: clamp(1.125rem, 1rem + 0.6vw, 1.3125rem); }
/* Formulář: menší maskot a sevřenější mezery, ať je z formuláře vidět co nejvíc bez posouvání */
.wl--form { padding-top: 6rem; }
.wl--form .wl-buddy { width: clamp(5.25rem, 18vw, 7.125rem); height: clamp(5.25rem, 18vw, 7.125rem); margin-bottom: 1.125rem; }
.wl--form .wl-lead { margin-top: 0.625rem; }
/* Veselé oči po úspěchu */
.wl-happy { display: none; fill: none; stroke: #151043; stroke-width: 6; stroke-linecap: round; }
.wl-buddy.is-happy rect[x='35'], .wl-buddy.is-happy rect[x='56'] { display: none; }
.wl-buddy.is-happy .wl-happy { display: inline; }

/* ---------- Bílá karta ---------- */
.wl-card { --focus: var(--indigo); width: 100%; max-width: 39rem; margin-top: 2.25rem; padding: clamp(1.5rem, 5vw, 2.75rem) clamp(1.125rem, 5vw, 2.75rem); border-radius: 1.75rem; background: var(--white); box-shadow: 0 2rem 4rem -1.5rem rgb(0 0 0 / 0.65); color: var(--night); text-align: left; }
.wl--confirm .wl-card { margin-top: 0; text-align: center; }
.wl--form .wl-card { margin-top: 1.5rem; padding-top: clamp(1.5rem, 4vw, 2rem); }
.wl-card a:not(.btn) { color: #342db3; font-weight: 700; text-underline-offset: 0.2em; overflow-wrap: anywhere; }

.wl-field { min-width: 0; margin: 0 0 1.75rem; padding: 0; border: 0; }
.wl-label { display: block; padding: 0; font: 900 1.1875rem/1.35 var(--head); }
.wl-sublabel { display: block; font: 800 1rem/1.35 var(--head); }
.wl-opt { display: inline-block; padding: 0.05em 0.6em; border-radius: 999px; background: #ece8ff; color: #4a4478; font: 700 0.8125rem/1.5 var(--body); vertical-align: 0.1em; }
.wl-hint { margin-top: 0.25rem; color: #4a4478; font-size: 0.9375rem; line-height: 1.45; }
.wl-input { display: block; width: 100%; min-height: 3.25rem; margin-top: 0.5rem; padding: 0.625rem 1rem; border: 2px solid #8a80e4; border-radius: 1rem; background: var(--white); color: var(--night); font: 400 1.125rem/1.45 var(--body); }
.wl-input:focus-visible { outline-offset: 2px; }
.wl-input[aria-invalid='true'] { border-color: #b3123f; background: #fff6f8; }
.wl-error { margin-top: 0.5rem; color: #a30f39; font-size: 1rem; font-weight: 700; line-height: 1.45; }
.wl-error:empty { display: none; }
.wl-error--form { margin: 0 0 1rem; padding: 0.75rem 1rem; border: 2px solid #e8a3b6; border-radius: 1rem; background: #fff1f4; }

/* ---------- Čipy: skutečná zaškrtávací políčka, vybraný má fajfku (ne jen barvu) ---------- */
.wl-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.wl-chip { position: relative; display: inline-flex; }
.wl-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.wl-chip span { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; padding: 0.375rem clamp(0.75rem, 3.4vw, 1rem); border: 2px solid #8a80e4; border-radius: 999px; font: 800 1rem/1.3 var(--head); pointer-events: none; -webkit-user-select: none; user-select: none; }
.wl-chip input:checked + span { border-color: var(--indigo); background: var(--indigo); box-shadow: 0 3px 0 #2d288f; color: var(--white); }
.wl-chip input:checked + span::before { content: ''; width: 0.35rem; height: 0.7rem; margin: -0.15rem 0.15rem 0 0; border: solid var(--lemon); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.wl-chip input:focus-visible + span { outline: 3px solid var(--indigo); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .wl-chip input:hover:not(:checked) + span { background: #f1eeff; } }
.wl-other { margin-top: 1rem; }

/* ---------- Souhlas, tlačítko, stavy ---------- */
.wl-checks { display: grid; gap: 0.25rem; }
.wl-check { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); column-gap: 0.75rem; align-items: start; min-height: 2.75rem; padding: 0.375rem 0; font-size: 1.0625rem; line-height: 1.5; cursor: pointer; }
.wl-check input { width: 1.5rem; height: 1.5rem; margin: 0.05rem 0 0; accent-color: var(--indigo); cursor: pointer; }
.wl-check input[aria-invalid='true'] { outline: 3px solid #b3123f; outline-offset: 2px; }
.wl-more { margin: 0 0 0.5rem 2.5rem; color: #4a4478; font-size: 0.9375rem; line-height: 1.5; }
.wl-checks .wl-error { margin: 0 0 0.5rem 2.5rem; }
.wl-hp { position: absolute; left: -200vw; width: 1px; height: 1px; overflow: hidden; }
.wl-turnstile:not(:empty) { margin-bottom: 1rem; }
.wl-submit { width: 100%; }
.wl-card .btn:disabled, .wl-card .btn[aria-disabled='true'] { opacity: 0.7; cursor: progress; }
.wl-after { margin-top: 1rem; color: #4a4478; font-size: 0.9375rem; text-align: center; }
.wl-done, .wl-state { text-align: center; }
.wl-card h2, .wl-state h1 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.25rem); line-height: 1.15; }
.wl-done > p, .wl-state > p { margin: 1rem auto 0; max-width: 26rem; color: #302b66; }
.wl-done > p.wl-address { margin-top: 0.75rem; color: var(--night); font-weight: 700; overflow-wrap: anywhere; }
.wl-status:empty { display: none; }
.wl-state .wl-submit { margin-top: 1.75rem; max-width: 22.5rem; }
.wl-actions { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; margin-top: 1.75rem; }
.wl-actions .btn { width: min(100%, 22.5rem); }
.wl-link { display: inline-block; min-height: 2.75rem; padding: 0.6875rem 0.75rem; border: 0; background: none; color: #342db3; font: 800 1.0625rem/1.3 var(--head); text-decoration: underline; text-underline-offset: 0.25em; cursor: pointer; }

.wl-warn { margin-bottom: 1rem; padding: 0.875rem 1rem; border: 2px solid var(--lemon-edge); border-radius: 1rem; background: #fff7d6; font-size: 1rem; line-height: 1.5; text-align: left; }
.wl-failed { display: none; }
html.failed .wl-failed { display: block; }
html:not(.js) .wl-form, html:not(.js) .wl-state { display: none; }
/* Bez skriptu a po chybě načtení karta ukazuje jen upozornění */
html:not(.js) .wl-card > p:last-child.visually-hidden { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .wl-buddy { transition: transform 420ms var(--spring); }
  .wl-buddy.is-happy { transform: rotate(-8deg) scale(1.08); }
  .wl-chip span { transition: transform 160ms var(--spring); }
  .wl-chip input:active + span { transform: scale(0.95); }
  .wl-done:not([hidden]), .wl-state:not([hidden]) { animation: wl-in 360ms var(--out); }
  @keyframes wl-in { from { opacity: 0; transform: translateY(0.75rem); } }
}
