@import url(../fonts/fonts.css);
/* UX-015: nahradne pisma s upravenymi rozmermi, aby sa pri vymene pisma text neposunul */
@font-face { font-family: 'Fredoka Fallback'; src: local('Arial'), local('Helvetica'); size-adjust: 104%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%; }
@font-face { font-family: 'Nunito Fallback'; src: local('Arial'), local('Helvetica'); size-adjust: 101%; ascent-override: 100%; descent-override: 35%; line-gap-override: 0%; }

:root {
  --blue: #1b5fd8;
  --blue-600: #1449ae;
  --blue-400: #4a8af0;
  --blue-100: #e3eeff;
  --sky: #eef6ff;
  --navy: #0f2557;
  --ink: #16233f;
  --muted: #5a6a8a;
  --line: #d9e5f6;
  --surface: #ffffff;
  --sun: #ffb81c;
  --sun-600: #f29d00;
  --on-sun: #3a2600;
  --yellow: #ffd600;
  --yellow-600: #e0b800;
  --on-yellow: #4a3b00;
  --purple: #b02ce0;
  --pink: #ff5fa8;
  --green: #067a4a;
  --green-bg: #dcf6ea;
  --orange: #ff8a1f;
  --orange-bg: #fff0dd;
  --red: #d93a3a;
  --red-bg: #fde3e3;
  --g-blue: linear-gradient(135deg, #1449ae, #4a8af0);
  --g-green: linear-gradient(135deg, #0a8552, #3cc98a);
  --g-sun: linear-gradient(135deg, #e08a00, #ffc533);
  --g-yellow: linear-gradient(135deg, #e0b800, #ffe14d);
  --g-pink: linear-gradient(135deg, #d92e86, #ff7ab8);
  --g-purple: linear-gradient(135deg, #7a2bd6, #b57bff);
  --g-red: linear-gradient(135deg, #c62d2d, #ff6b6b);
  --shadow: 0 6px 24px -10px rgba(15, 37, 87, 0.35);
  --shadow-sm: 0 2px 10px -4px rgba(15, 37, 87, 0.25);
  --radius: 20px;
  /* UX-044: skala zaoblenia a farby spodnej hrany tlacidiel (hodnoty ostavaju rovnake ako doteraz) */
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --edge-green: #086a43;
  --edge-orange: #8f3600;
  --edge-pink: #8e1043;
  --edge-danger: #a82424;
  --font-display: 'Fredoka', 'Fredoka Fallback', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Nunito', 'Nunito Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--sky);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.15; text-wrap: balance; color: var(--navy); }
p { margin: 0; }
img, svg { display: block; max-width: 100%; }
img[src=""] { display: none; } /* ihrisko bez loga alebo maskota: ziadny prazdny obrazok */
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; box-shadow: 0 0 0 6px #fff; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---- tlacidla ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 16px; padding: 14px 20px; min-height: 52px;
  font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: 0.01em;
  background: var(--blue); color: #fff; text-decoration: none; text-align: center;
  box-shadow: 0 5px 0 var(--blue-600), 0 10px 18px -8px rgba(20, 73, 174, 0.6);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--blue-600), 0 4px 10px -6px rgba(20, 73, 174, 0.6); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.sun { background: var(--sun); color: var(--on-sun); box-shadow: 0 5px 0 var(--sun-600), 0 10px 18px -8px rgba(242, 157, 0, 0.7); }
.btn.sun:active:not(:disabled) { box-shadow: 0 2px 0 var(--sun-600); }
.btn.yellow { background: var(--yellow); color: var(--on-yellow); box-shadow: 0 5px 0 var(--yellow-600), 0 10px 18px -8px rgba(224, 184, 0, 0.6); }
.btn.yellow:active:not(:disabled) { box-shadow: 0 2px 0 var(--yellow-600); }
.btn.green { background: #0a8552; box-shadow: 0 5px 0 var(--edge-green), 0 10px 18px -8px rgba(10, 133, 82, 0.6); } /* kontrast bieleho textu 4,7:1 */
.btn.orange { background: #c24a00; box-shadow: 0 5px 0 var(--edge-orange), 0 10px 18px -8px rgba(194, 74, 0, 0.6); }
.btn.pink { background: #c2185b; box-shadow: 0 5px 0 var(--edge-pink); }
.btn.danger { background: var(--red); box-shadow: 0 5px 0 var(--edge-danger); }
.btn.ghost { background: var(--blue-100); color: var(--blue-600); box-shadow: none; }
.btn.ghost:active:not(:disabled) { box-shadow: none; transform: scale(0.98); }
.btn.outline { background: transparent; color: #fff; box-shadow: none; border: 2px solid rgba(255, 255, 255, 0.85); }
.btn.outline.dark { color: var(--blue-600); border-color: var(--blue); }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: 15px; border-radius: var(--r-sm); box-shadow: none; }
.link { background: none; border: 0; padding: 6px 2px; color: var(--blue); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 0; background: var(--blue-100); color: var(--blue-600); display: grid; place-items: center; }
.ico { width: 24px; height: 24px; fill: currentColor; stroke: none; flex: none; } /* plne ikony: tvar = fill, jemny akcent = opacity .35 v sprite */
.ico.sm { width: 18px; height: 18px; }
.ico.lg { width: 32px; height: 32px; }

/* ---- karty a prvky ---- */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); border: 1px solid rgba(217, 229, 246, 0.7); }
.card.flat { box-shadow: none; }
.card h3 { font-size: 20px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 4px 2px 0; }
.section-title h2 { font-size: 21px; }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 800; background: var(--blue-100); color: var(--blue-600); white-space: nowrap; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.pink { background: #ffe3f0; color: #c4266f; }
.pill.orange { background: var(--orange-bg); color: #b25b00; }
.pill.red { background: var(--red-bg); color: #b42323; } /* kontrast 5,5:1 */
.pill.sun { background: #fff0c2; color: #8a5a00; }
.pill.gray { background: #eef1f7; color: var(--muted); }

.progress { height: 14px; border-radius: 999px; background: var(--blue-100); overflow: hidden; }
.progress > i { display: block; height: 100%; width: var(--p, 0%); border-radius: 999px; background: linear-gradient(90deg, var(--blue-400), var(--blue)); transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.progress.sun > i { background: linear-gradient(90deg, #ffd45e, var(--sun)); }

.tabs { display: flex; background: var(--blue-100); border-radius: 16px; padding: 4px; gap: 4px; }
.tabs button { flex: 1; border: 0; border-radius: var(--r-sm); background: transparent; padding: 10px 8px; font-weight: 800; font-size: 15px; color: var(--muted); }
.tabs button[aria-selected='true'] { background: #fff; color: var(--blue-600); box-shadow: var(--shadow-sm); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 6px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 2px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px; padding: 8px 16px; min-height: 44px; font-weight: 800; font-size: 14px; }
.chip[aria-pressed='true'] { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---- formulare ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 800; font-size: 14px; color: var(--navy); }
.field .opt { font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 13px 14px; min-height: 52px;
  font-size: 17px; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(27, 95, 216, 0.15); }
.input.bad { border-color: var(--red); }
.hint { font-size: 13px; color: var(--muted); }
.field-err { display: block; color: #c42b2b; font-weight: 800; font-size: 14px; margin-top: 4px; }
.err { color: #c42b2b; font-weight: 800; font-size: 14px; min-height: 20px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink); line-height: 1.4; }
.check input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--blue); }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: #c7d3e8; border-radius: 999px; transition: background 0.2s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }

/* ---- zoznamy ---- */
.list { display: flex; flex-direction: column; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 0; background: #fff; width: 100%; text-align: left; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-row:last-child { border-bottom: 0; }
.list-row:active { background: var(--sky); }
.list-row .lead { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; background: var(--g-blue);
  box-shadow: 0 4px 10px -4px rgba(15, 37, 87, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.12); }
.list-row .lead .ico { width: 24px; height: 24px; stroke-width: 2.2; }
.list-row .lead.sun { background: var(--g-sun); }
.list-row .lead.yellow { background: var(--g-yellow); }
.list-row .lead.green { background: var(--g-green); }
.list-row .lead.pink { background: var(--g-pink); }
.list-row .lead.red { background: var(--g-red); }
.list-row .lead.purple { background: var(--g-purple); }
.list-row b { font-weight: 800; display: block; }
.list-row .sub { font-size: 13px; color: var(--muted); }
.list-row .chev { color: #9fb0cf; }

.empty { text-align: center; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); }
.empty img { width: 160px; }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 800; box-shadow: var(--shadow); z-index: 100; max-width: min(92vw, 440px); text-align: center; animation: toast-in 0.25s ease-out; }
.toast.bad { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Nacitavanie obrazovky: kostra (tri riadky) namiesto tocitka. Trieda .spinner sa nemeni, vsetky obrazovky ju uz pouzivaju. */
.spinner { display: block; width: 100%; height: 44px; margin: 24px 0 132px; border-radius: var(--r-md, 14px); background: #e3eeff;
  box-shadow: 0 58px 0 0 #e3eeff, 0 116px 0 0 #e3eeff; animation: skel-pulse 1.4s ease-in-out infinite; }
.btn .spinner, button .spinner { width: 1.2em; height: 1.2em; margin: 0; box-shadow: none; border-radius: 50%; }
@keyframes skel-pulse { 50% { opacity: 0.55; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- vyskakovacie okno a metriky (zdielane) ---- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 25, 60, 0.55); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s; }
.sheet { width: min(100%, 480px); max-height: 92dvh; overflow: auto; background: #fff; border-radius: var(--r-lg) 28px 0 0; padding: 0 0 calc(20px + env(safe-area-inset-bottom)); animation: sheet-up 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: #c7d3e8; margin: 10px auto; }
.sheet .content { padding: 4px 18px 8px; display: flex; flex-direction: column; gap: 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1; object-fit: cover; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { background: var(--blue-100); border-radius: 16px; padding: 12px 14px; }
.kpi b { display: block; font-family: var(--font-display); font-size: 26px; color: var(--navy); line-height: 1.1; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Dotykove plochy aspon 44 px (pristupnost). Vzhlad sa nemeni, len sa zvacsi klikaciu plocha. */
.link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.tabs button { min-height: 44px; }
.app .btn.small { min-height: 44px; }
.check a { display: inline-block; padding: 12px 0; margin: -12px 0; }
.switch input { inset: -7px -4px; width: calc(100% + 8px); height: calc(100% + 14px); }

/* UX-014: dotykove plochy min. 44 px */
summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
label.consent { min-height: 44px; }

/* Vykon a pristupnost: pri znizenom pohybe bez plynuleho posunu a bez animacie kostier */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .skel, .spinner { animation: none !important; }
}

/* Kostry (skeleton) pri nacitani obrazovky, ktora sa stahuje az pri otvoreni */
.skel-wrap { padding: 0 0 24px; }
.skel { background: linear-gradient(90deg, #e3eeff 25%, #f3f8ff 50%, #e3eeff 75%); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; }
.skel-hero { height: 130px; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.skel-card { height: 92px; border-radius: var(--r-md); margin: 14px 18px 0; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Vyssi kontrast na poziadanie systemu (prefers-contrast): tmavsie sede texty, ciary a okraje */
@media (prefers-contrast: more) {
  :root { --muted: #3a4866; --line: #7a8db3; --blue-100: #d6e6ff; }
  .card, .input, input, select, textarea { border: 1px solid var(--line); }
  .pill { border: 1px solid currentColor; }
  a, .link { text-decoration: underline; }
  :focus-visible { outline-width: 4px; }
  .spinner { background: #b9cdf0; box-shadow: 0 58px 0 0 #b9cdf0, 0 116px 0 0 #b9cdf0; }
  .skel { background: #b9cdf0; animation: none; }
  .toast { border: 2px solid currentColor; }
}

/* rezim udrzby (common.js showMaintenance) */
.maint { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15, 37, 87, .94); }
.maint-box { max-width: 420px; background: #fff; border-radius: 24px; padding: 28px 24px; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.maint-box h1 { margin: 0; font-size: 24px; color: #0f2557; }
.maint-box p { margin: 0; font-size: 17px; line-height: 1.45; }
