/* ============================================================
   Kalkulačky – základný štýl (neutrálny, na dizajn sa doladí neskôr)
   Všetko je riadené CSS premennými, takže rebranding = zmena :root
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --c-bg: #ffffff;
  --c-surface: #f7f8fa;
  --c-surface-2: #eef1f6;
  --c-border: #d8d8d8;
  --c-border-strong: #b8b8b9;
  --c-text: #000711;
  --c-body: #4f4f4f;
  --c-text-muted: #777777;
  --c-accent: #4408b6;
  --c-accent-hover: #5a1fd4;
  --c-accent-lilac: #8b5cf0;
  --c-accent-soft: #f0ecfd;
  --c-positive: #0f6e56;
  --c-negative: #a32d2d;
  --c-neutral: #777777;

  --c-series-1: #4408b6;
  --c-series-2: #9aa0a6;
  --c-series-3: #0f6e56;
  --c-series-4: #a32d2d;
  --c-series-5: #8b5cf0;

  --r-sm: 8px;
  --r-md: 8px;
  --r-lg: 16px;
  --r-pill: 9999px;

  --sp-1: 6px;
  --sp-2: 10px;
  --sp-3: 16px;
  --sp-4: 20px;
  --sp-5: 28px;
  --sp-6: 40px;

  --font: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-num: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --shadow-card: none;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

.calc-root {
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
.calc-root h1, .calc-root h2, .calc-root h3, .calc-root h4 { margin: 0; font-weight: 600; line-height: 1.25; }

.calc-wrap { max-width: var(--maxw); margin: 0 auto; padding: var(--sp-5) var(--sp-4) var(--sp-6); }

/* ---------- Hlavička ---------- */
.calc-header { margin-bottom: var(--sp-5); }
.calc-back { display: inline-block; font-size: 13px; color: var(--c-text-muted); text-decoration: none; margin-bottom: var(--sp-3); }
.calc-back:hover { color: var(--c-accent); }
.calc-eyebrow { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--c-accent); font-weight: 600; }
.calc-title { font-size: clamp(24px, 3.6vw, 36px); margin-top: var(--sp-2); }
.calc-lede { color: var(--c-text-muted); max-width: 62ch; margin-top: var(--sp-3); }

/* ---------- Layout ---------- */
.calc-layout { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: var(--sp-5); align-items: start; }
@media (max-width: 900px) { .calc-layout { grid-template-columns: 1fr; } }

.calc-form-col { position: sticky; top: var(--sp-4); }
@media (max-width: 900px) { .calc-form-col { position: static; } }

/* ---------- Karty ---------- */
.card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-card);
}
.card + .card { margin-top: var(--sp-4); }
.card-title { font-size: 17px; margin-bottom: var(--sp-3); }
.card-sub { font-size: 13px; color: var(--c-text-muted); margin: calc(var(--sp-1) * -1) 0 var(--sp-3); }

/* ---------- Formulár ---------- */
.field { margin-bottom: var(--sp-3); }
.field-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: var(--sp-1); }
.field-hint { font-size: 12px; color: var(--c-text-muted); margin-top: var(--sp-1); }
.field-error { font-size: 12px; color: var(--c-negative); margin-top: var(--sp-1); display: none; }
.field.has-error .field-error { display: block; }
.field.has-error .input-shell { border-color: var(--c-negative); }

.input-shell {
  display: flex; align-items: center;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  transition: border-color .15s, box-shadow .15s;
}
.input-shell:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.input-shell input, .input-shell select {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  padding: 10px 12px; font: inherit; font-size: 15px; color: inherit;
}
.input-suffix { padding: 0 12px 0 4px; color: var(--c-text-muted); font-size: 14px; white-space: nowrap; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }

.field-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: var(--sp-3); }
.field-check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--c-accent); }
.field-check label { font-size: 14px; }

.field-group-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--c-text-muted); font-weight: 600;
  margin: var(--sp-4) 0 var(--sp-2); padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
}
.field-group-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 20px; border: 0; border-radius: var(--r-sm);
  background: var(--c-accent); color: #fff; font: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer; transition: filter .15s;
}
.btn:hover { filter: brightness(.93); }
.btn-ghost { background: transparent; color: var(--c-text-muted); border: 1px solid var(--c-border-strong); }
.btn-ghost:hover { filter: none; border-color: var(--c-text-muted); color: var(--c-text); }
.btn-sm { width: auto; padding: 8px 14px; font-size: 13px; }

/* ---------- Slider ---------- */
.slider-field { margin: var(--sp-3) 0; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-1); }
.slider-head b { font-size: 15px; color: var(--c-accent); }
.slider-field input[type=range] { width: 100%; accent-color: var(--c-accent); }
.slider-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--c-text-muted); margin-top: 2px; }

/* ---------- Výsledky ---------- */
.results-empty { text-align: center; padding: var(--sp-6) var(--sp-4); color: var(--c-text-muted); }
.results-empty h3 { color: var(--c-text); margin-bottom: var(--sp-2); }

.hero-stat { text-align: left; }
.hero-stat .hero-label { font-size: 13px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.hero-stat .hero-value { font-size: clamp(30px, 5vw, 46px); font-weight: 700; line-height: 1.1; margin: var(--sp-2) 0; letter-spacing: -0.02em; }
.hero-stat .hero-note { color: var(--c-text-muted); font-size: 14px; }
.hero-stat.is-positive .hero-value { color: var(--c-positive); }
.hero-stat.is-negative .hero-value { color: var(--c-negative); }
.hero-stat.is-accent .hero-value { color: var(--c-accent); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); }
.stat {
  background: var(--c-surface); border-radius: var(--r-md); padding: var(--sp-3);
  border: 1px solid var(--c-border);
}
.stat-label { font-size: 12.5px; color: var(--c-text-muted); }
.stat-value { font-size: 21px; font-weight: 700; margin-top: 2px; letter-spacing: -0.01em; }
.stat-sub { font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }
.stat.is-positive .stat-value { color: var(--c-positive); }
.stat.is-negative .stat-value { color: var(--c-negative); }
.stat.is-accent .stat-value { color: var(--c-accent); }

.callout {
  border-left: 3px solid var(--c-accent); background: var(--c-accent-soft);
  padding: var(--sp-3); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 14px;
}
.callout.is-positive { border-color: var(--c-positive); background: rgba(23,145,107,.08); }
.callout.is-negative { border-color: var(--c-negative); background: rgba(207,59,59,.08); }
.callout.is-muted { border-color: var(--c-border-strong); background: var(--c-surface); }
.callout strong { font-weight: 600; }

.small-print { font-size: 12px; color: var(--c-text-muted); margin-top: var(--sp-3); }

/* ---------- Tabuľka ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.calc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.calc-table th, table.calc-table td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--c-border); white-space: nowrap; }
table.calc-table th:first-child, table.calc-table td:first-child { text-align: left; }
table.calc-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--c-text-muted); font-weight: 600; }
table.calc-table tbody tr:hover { background: var(--c-surface); }
table.calc-table tfoot td { font-weight: 700; border-top: 2px solid var(--c-border-strong); border-bottom: 0; }
table.calc-table td.pos { color: var(--c-positive); }
table.calc-table td.neg { color: var(--c-negative); }

details.calc-details { border: 1px solid var(--c-border); border-radius: var(--r-md); margin-top: var(--sp-3); }
details.calc-details > summary { cursor: pointer; padding: 12px var(--sp-3); font-weight: 600; font-size: 14px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.calc-details > summary::-webkit-details-marker { display: none; }
details.calc-details > summary::after { content: "＋"; color: var(--c-text-muted); font-weight: 400; }
details.calc-details[open] > summary::after { content: "－"; }
details.calc-details > .details-body { padding: 0 var(--sp-3) var(--sp-3); max-height: 460px; overflow: auto; }

/* ---------- Graf ---------- */
.chart-box { margin-top: var(--sp-2); }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--sp-3); font-size: 13px; margin-bottom: var(--sp-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--c-text-muted); }
.chart-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid-line { stroke: var(--c-border); stroke-width: 1; }
.chart-svg .axis-text { fill: var(--c-text-muted); font-size: 11px; font-family: var(--font); }
.chart-svg .hover-line { stroke: var(--c-border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tooltip {
  position: absolute; pointer-events: none; background: var(--c-text); color: #fff;
  padding: 8px 10px; border-radius: var(--r-sm); font-size: 12px; line-height: 1.5;
  white-space: nowrap; opacity: 0; transition: opacity .1s; z-index: 20;
}
.chart-holder { position: relative; }

/* ---------- Donut ---------- */
.donut-wrap { display: flex; gap: var(--sp-4); align-items: center; flex-wrap: wrap; }
.donut-legend { flex: 1; min-width: 180px; font-size: 14px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.donut-legend i { width: 11px; height: 11px; border-radius: 3px; }
.donut-legend b { margin-left: auto; }

/* ---------- Bar list ---------- */
.barlist div.barlist-row { margin-bottom: var(--sp-2); }
.barlist .barlist-top { display: flex; justify-content: space-between; font-size: 13.5px; gap: var(--sp-3); }
.barlist .barlist-top b { white-space: nowrap; }
.barlist .barlist-track { height: 8px; background: var(--c-surface-2); border-radius: var(--r-pill); margin-top: 4px; overflow: hidden; }
.barlist .barlist-fill { height: 100%; border-radius: var(--r-pill); }

/* ---------- Index stránka ---------- */
.calc-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-3); }
a.calc-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--c-border); border-radius: var(--r-md); padding: var(--sp-4);
  transition: border-color .15s, transform .15s, box-shadow .15s; background: var(--c-bg);
}
a.calc-card:hover { border-color: var(--c-accent); transform: translateY(-2px); box-shadow: var(--shadow-card); }
a.calc-card h3 { font-size: 16px; margin-bottom: var(--sp-1); }
a.calc-card p { font-size: 13.5px; color: var(--c-text-muted); margin: 0; }
.calc-index-section { margin-bottom: var(--sp-5); }
.calc-index-section > h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .07em; color: var(--c-text-muted); margin-bottom: var(--sp-3); }

.print-only { display: none; }
@media print {
  .calc-form-col, .calc-back, .btn { display: none !important; }
  .calc-layout { grid-template-columns: 1fr; }
  .card { break-inside: avoid; box-shadow: none; }
}


/* ============================================================
   Brand — Peter Spodniak
   Podľa spodniak-DESIGN.md. Meniť tu, nie v pravidlách vyššie.
   ============================================================ */

.calc-root { color: var(--c-body); }
.calc-root h1, .calc-root h2, .calc-root h3, .calc-root h4 { color: var(--c-text); font-weight: 700; }

/* Čísla v Interi s rovnako širokými číslicami — pri prepočte neposkakujú */
.hero-stat .hero-value,
.stat-value,
.slider-head b,
.donut-legend b,
.barlist .barlist-top b,
table.calc-table th,
table.calc-table td,
.chart-tooltip,
.slider-ticks {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.chart-svg .axis-text { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* Hlavný výsledok je čierny, nie fialový — je to údaj, nie pútač */
.hero-stat.is-accent .hero-value { color: var(--c-text); }

/* Tlačidlá ako pilulky */
.btn { border-radius: var(--r-pill); font-weight: 500; }
.btn:hover { background: var(--c-accent-hover); filter: none; }
.btn-ghost:hover { background: transparent; }

/* Ploché plochy — bez tieňov */
.card { box-shadow: none; }
a.calc-card:hover { box-shadow: none; border-color: var(--c-accent); }

/* Viditeľný focus na všetkom, čo sa dá ovládať */
.calc-root a:focus-visible,
.calc-root .btn:focus-visible,
.calc-root input:focus-visible,
.calc-root select:focus-visible,
.calc-root summary:focus-visible {
  outline: 3px solid var(--c-accent-lilac);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .calc-root *, .calc-root *::before, .calc-root *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
