/* Základ vzhľadu (rozloženie a komponenty); tvar „Ako mapy v mobile“ (sklenené panely, kapsuly) je v packages/vzhlad/vzhlad.css.
   Farby sú v packages/vzhlad/palety.js (svetlý aj tmavý režim) – app.js ich zapíše do premenných --brand, --ink…
   Hodnoty nižšie sú len poistka do prvého vykreslenia. */

:root {
  color-scheme: light dark;
  --brand: #754BFF; --brandInk: #5b33e0; --naBrand: #fff; --brandJemna: #efeaff; --brandText: #6334ed; --lamp: #FFB547;
  --ink: #1c1830; --muted: #5d5873; --line: #dedbe8; --bg: #fff; --bg2: #f5f4f9; --chyba: #b3261e; --ok: #1b7a3d; --tien: 31, 27, 58;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-nadpis: var(--font);
  --dotyk: 48px; --r: 16px; --r-panel: 24px;
  --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
  --tien1: 0 2px 4px rgba(var(--tien), .06);
  --tien2: 0 6px 16px -2px rgba(var(--tien), .16);
  --tien3: 0 12px 32px -4px rgba(var(--tien), .24);
  --pohyb: 260ms cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; font-family: var(--font); color: var(--ink); background: var(--bg2); -webkit-text-size-adjust: 100%; font-size: 16px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
h2, h3, p { margin: 0; }

/* ---------- mapa ---------- */
.mapa { position: fixed; inset: 0; height: 100dvh; background: var(--bg2); touch-action: none; }
.mlmap { position: absolute; inset: 0; }
.mllabels { position: absolute; inset: 0; pointer-events: none; z-index: 1; }

/* ---------- logo ---------- */
.logo { display: inline-grid; place-items: center; flex: none; min-width: 52px; height: 36px; padding: 0 10px; border-radius: 12px; background: var(--brand); color: var(--naBrand); font-weight: 800; font-size: 16px; letter-spacing: .04em; }
.logo svg { height: 22px; width: auto; display: block; }
.logo.velke { min-width: 72px; height: 48px; font-size: 22px; border-radius: 14px; }

/* ---------- horná lišta s vyhľadaním ---------- */
.horna { position: fixed; top: 0; left: 0; right: 0; z-index: 5; padding: calc(var(--st) + 12px) 12px 0; pointer-events: none; }
.lista { display: flex; align-items: center; gap: 8px; max-width: 560px; margin: 0 auto; padding: 6px; border-radius: 22px; background: var(--bg); box-shadow: var(--tien2); pointer-events: auto; }
.hladanie { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.hladanie .lupa { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.hladanie input { width: 100%; height: var(--dotyk); padding: 0 44px 0 40px; border: 0; border-radius: 14px; background: transparent; font-size: 17px; -webkit-appearance: none; appearance: none; }
.hladanie input::placeholder { color: var(--muted); opacity: 1; }
.hladanie input::-webkit-search-cancel-button { display: none; }
.hladanie input:focus { outline: none; background: var(--bg2); }
.hladanie input:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; }
.zmazat { position: absolute; right: 0; width: var(--dotyk); height: var(--dotyk); border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; border-radius: 14px; }
.vysledky { position: absolute; top: calc(100% + 12px); left: -64px; right: -62px; list-style: none; margin: 0; padding: 6px; background: var(--bg); border-radius: var(--r); box-shadow: var(--tien3); max-height: 55dvh; overflow-y: auto; }
.vysledky li { display: flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 6px 14px; border-radius: 12px; cursor: pointer; }
.vysledky li[aria-selected="true"], .vysledky li:hover { background: var(--brandJemna); }
.vysledky span { font-weight: 600; }
.vysledky small { color: var(--muted); font-size: 14px; }
.vysledky .nic { color: var(--muted); cursor: default; }

/* ---------- okrúhle tlačidlá ---------- */
.kruh { flex: none; width: var(--dotyk); height: var(--dotyk); border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--ink); }
.kruh:active { transform: scale(.94); }
.kruh.plochy { background: transparent; }
.ovladanie { position: fixed; right: 12px; bottom: calc(var(--sb) + 20px); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 12px; transition: transform var(--pohyb); }
.ovladanie .kruh { width: 52px; height: 52px; box-shadow: var(--tien2); }
.ovladanie .skupina { display: flex; flex-direction: column; border-radius: 26px; background: var(--bg); box-shadow: var(--tien2); }
.ovladanie .skupina .kruh { box-shadow: none; background: transparent; }
.ovladanie .skupina .kruh + .kruh { border-top: 1px solid var(--line); border-radius: 0 0 26px 26px; }
.ovladanie .skupina .kruh:first-child { border-radius: 26px 26px 0 0; }
.kruh.hlavny { width: 60px !important; height: 60px !important; background: var(--brand); color: var(--naBrand); }
.ovladanie #podklad[aria-pressed="true"] { background: var(--brand); color: var(--naBrand); }
.kruh[aria-busy="true"] { animation: pulz 1s infinite; }
@keyframes pulz { 50% { opacity: .5; } }
body.panel-otvoreny .ovladanie { transform: translateY(calc(-1 * var(--vyska-panelu, 230px) + var(--sb) + 8px)); }

/* ---------- krátke hlásenie ---------- */
.hlaska { position: fixed; left: 12px; right: 12px; top: calc(var(--st) + 84px); max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: var(--r); background: var(--ink); color: var(--bg); font-size: 15px; line-height: 1.45; z-index: 6; box-shadow: var(--tien3); animation: zhora var(--pohyb); }

/* ---------- spodný panel svetelného miesta ---------- */
.panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; max-width: 560px; margin: 0 auto; padding: 8px 20px calc(var(--sb) + 20px); background: var(--bg); border-radius: var(--r-panel) var(--r-panel) 0 0; box-shadow: var(--tien3); animation: zdola var(--pohyb); }
.uchyt { width: 40px; height: 5px; margin: 4px auto 14px; border-radius: 3px; background: var(--line); }
.stitok { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.cislo-sm { font-size: 32px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.cislo-sm.male { font-size: 22px; margin: 0; }
.miesto { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 500; margin-bottom: 20px; }
.miesto svg { color: var(--brandText); flex: none; }
.zavriet { position: absolute; top: 10px; right: 10px; color: var(--muted); }
.hlavne { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: var(--r); font-size: 18px; font-weight: 700; color: var(--naBrand); background: var(--brand); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--brand) 60%, transparent); transition: transform 120ms, background 120ms; }
/* overenie stavu lampy a hlášky TSB namiesto tlačidla (rovnaká minimálna výška ako tlačidlo, panel neskáče) */
.overenie, .sprava-lampy { min-height: 56px; display: flex; align-items: center; gap: 12px; margin: 0; font-size: 16px; line-height: 1.45; }
.overenie { color: var(--muted); justify-content: center; }
.overenie .tocik { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: tocit 800ms linear infinite; }
.sprava-lampy { padding: 14px 16px; border-radius: var(--r); background: var(--bg2); color: var(--ink); font-weight: 600; border: 1.5px solid var(--line); }
.hlavne:active { transform: scale(.98); }
.hlavne:hover { background: var(--brandInk); }
.hlavne[disabled] { opacity: .7; cursor: progress; }

/* ---------- informačné okno (spodný hárok nad stlmenou mapou) ---------- */
.vrstva { position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column; justify-content: flex-end; }
.clona { position: absolute; inset: 0; background: rgba(13, 19, 38, .45); animation: zjav var(--pohyb); }
.harok { position: relative; width: 100%; max-width: 560px; margin: 0 auto; max-height: calc(100dvh - var(--st) - 24px); display: flex; flex-direction: column; background: var(--bg); border-radius: var(--r-panel) var(--r-panel) 0 0; box-shadow: var(--tien3); animation: zdola var(--pohyb); }
.harok .uchyt { margin-top: 10px; flex: none; }
.info-obsah { overflow-y: auto; padding: 4px 22px 12px; overscroll-behavior: contain; }
.info h2 { font-size: 26px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; margin: 16px 0 10px; }
.info h2:focus { outline: none; }
.info p { color: var(--ink); }
#info-odseky p { margin-bottom: 14px; font-size: 16px; }
.kroky { list-style: none; counter-reset: k; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.kroky li { counter-increment: k; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--bg2); font-weight: 500; }
.kroky li::before { content: counter(k); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--naBrand); font-weight: 700; font-size: 15px; }
.poznamka { font-size: 14px; color: var(--muted) !important; padding-left: 12px; border-left: 3px solid var(--lamp); margin-bottom: 20px !important; }
.info h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.kontakty { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.kontakty li + li { border-top: 1px solid var(--line); }
.kontakty a { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 14px; color: var(--ink); text-decoration: none; }
.kontakty a:active { background: var(--bg2); }
.kontakty .ik { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brandJemna); color: var(--brandText); }
.kontakty b { display: block; font-weight: 700; font-size: 17px; }
.kontakty small { color: var(--muted); font-size: 13px; }
address { font-style: normal; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
address a { color: var(--brandText); font-weight: 600; }
.tip { font-size: 14px; color: var(--muted) !important; }
.paticka { flex: none; padding: 12px 20px calc(var(--sb) + 16px); background: var(--bg); border-top: 1px solid var(--line); }

/* ---------- celoobrazovkový formulár a poďakovanie ---------- */
.obrazovka { position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, 100dvh); z-index: 9; display: flex; flex-direction: column; background: var(--bg); max-width: 640px; margin: 0 auto; animation: zprava var(--pohyb); }
.obr-hlavicka { flex: none; display: flex; align-items: center; gap: 4px; padding: calc(var(--st) + 6px) 12px 6px 6px; border-bottom: 1px solid var(--line); }
.obr-hlavicka h2 { font-size: 18px; font-weight: 700; line-height: 1.3; }
.obr-hlavicka h2:focus { outline: none; }
.obr-telo { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 28px; scroll-padding: 24px; }
.uvod { color: var(--muted); margin-bottom: 18px; }
.karta-sm { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--brandJemna); margin-bottom: 26px; }
.ikona-sm { flex: none; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle, var(--lamp) 0 30%, color-mix(in srgb, var(--lamp) 35%, transparent) 31% 60%, transparent 61%); }
.miesto-text { font-weight: 500; font-size: 15px; }

.pole { margin: 0 0 26px; padding: 0; border: 0; min-width: 0; }
.pole legend, .pole > label { display: block; padding: 0; font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.pole .hviezda { color: var(--chyba); margin-left: 2px; }
.pole .nepov { font-weight: 500; font-size: 14px; color: var(--muted); margin-left: 6px; }
.pole .pomoc { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.moznosti { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.moznost { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--bg); font-weight: 600; cursor: pointer; transition: border-color 120ms, background 120ms; }
.moznost input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.moznost .znak { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; }
.moznost:has(input:checked) { border-color: var(--brand); background: var(--brandJemna); }
.moznost:has(input:checked) .znak { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 4px var(--brandJemna); }
.moznost:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.pole textarea, .pole input[type="email"] { display: block; width: 100%; min-height: 56px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--bg); font-size: 17px; -webkit-appearance: none; appearance: none; }
.pole textarea { min-height: 112px; resize: vertical; }
.pole textarea:focus, .pole input[type="email"]:focus { outline: none; border: 2px solid var(--brand); padding: 13.5px 15.5px; }
.pole [aria-invalid="true"], .pole.ma-chybu .moznost { border-color: var(--chyba); }
.chyba-pola { display: flex; gap: 6px; align-items: center; color: var(--chyba); font-weight: 600; font-size: 15px; margin-top: 8px; }
.chyba-pola::before { content: '!'; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--chyba); color: var(--bg); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.fotky-tlacidla { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fotky-tlacidla label { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border: 1.5px solid var(--brand); border-radius: var(--r); color: var(--brandText); font-weight: 700; cursor: pointer; position: relative; }
.fotky-tlacidla label:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.fotky-tlacidla label[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.fotky-tlacidla input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.nahlady { list-style: none; display: flex; gap: 12px; margin: 12px 0 0; padding: 0; }
.nahlady li { position: relative; width: 104px; height: 104px; border-radius: var(--r); overflow: hidden; box-shadow: var(--tien1); background: var(--bg2); animation: zjav var(--pohyb); }
.nahlady img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nahlady button { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; }
.nahlady button span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(13, 19, 38, .72); color: #fff; }
.chyba-formulara { color: var(--chyba); font-weight: 600; font-size: 15px; margin-bottom: 10px; text-align: center; }

.dakujeme .stred { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding-top: calc(var(--st) + 40px); }
.ok-znak { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; color: var(--naBrand); background: var(--brand); box-shadow: 0 0 0 14px var(--brandJemna), 0 0 48px 18px color-mix(in srgb, var(--lamp) 45%, transparent); margin-bottom: 18px; animation: naskoc 420ms cubic-bezier(.2, 1.4, .4, 1); }
.dakujeme h2 { font-size: 28px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; max-width: 320px; }
.dakujeme h2:focus { outline: none; }
.dakujeme p { color: var(--muted); font-size: 17px; max-width: 340px; }

.cislo-sm, .info h2, .dakujeme h2, .obr-hlavicka h2 { font-family: var(--font-nadpis); }

/* ---------- načítavanie ---------- */
.nacitavam { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--bg2); color: var(--muted); font-size: 17px; font-weight: 500; transition: opacity 300ms; }
.nacitavam .tocka { width: 34px; height: 34px; border-radius: 50%; border: 3.5px solid var(--line); border-top-color: var(--brand); animation: tocit 800ms linear infinite; }
.nacitavam.chyba { color: var(--chyba); padding: 24px; text-align: center; }
.nacitavam.chyba .tocka { display: none; }

@keyframes tocit { to { transform: rotate(360deg); } }
@keyframes zdola { from { transform: translateY(100%); } }
@keyframes zhora { from { transform: translateY(-12px); opacity: 0; } }
@keyframes zprava { from { transform: translateX(28px); opacity: 0; } }
@keyframes zjav { from { opacity: 0; } }
@keyframes naskoc { from { transform: scale(.6); opacity: 0; } }

@media (max-width: 359px) { .moznosti, .fotky-tlacidla { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
