/* =========================================================
   ByzRevize — audit podnikání · styl
   Paleta Otter Horizon (Námořní kobalt + Mandarinka), písmo Catamaran.
   Vše přes CSS proměnné → snadno přebarvitelné.
   Design dle zásad pro ADHD: klid, jedna otázka na obrazovku, velké cíle,
   nízké tření (nic není povinné), předvídatelná navigace.
   ========================================================= */
:root {
  --kobalt: #1B3A8F;
  --mandarinka: #F47A20;
  --inkoust: #14203A;
  --svetla-modra: #CFE0F5;
  --svetla-oranzova: #FBDDBD;
  --snezna: #FAFBFD;
  --zelena: #2E9E6B;
  --cervena: #D9663F;

  --bg: var(--snezna);
  --text: var(--inkoust);
  --muted: #5a6480;
  --card: #ffffff;
  --border: #e4e9f2;
  --accent: var(--mandarinka);
  --primary: var(--kobalt);
  --radius: 18px;
  --shadow: 0 10px 40px rgba(20, 32, 58, 0.10);
  --shadow-sm: 0 4px 16px rgba(20, 32, 58, 0.08);
  --maxw: 680px;
  --font: 'Catamaran', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 100% -10%, var(--svetla-oranzova) 0%, transparent 55%),
    radial-gradient(1100px 500px at -10% 110%, var(--svetla-modra) 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 40px);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.loading { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---- Progress ---- */
.progress-wrap { margin-bottom: 24px; }
.progress-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem; color: var(--muted); font-weight: 600; margin-bottom: 8px;
  letter-spacing: 0.02em; gap: 12px;
}
.progress-top .sec { color: var(--kobalt); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
.progress-bar { height: 8px; background: var(--svetla-modra); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--kobalt), var(--mandarinka));
  border-radius: 999px; transition: width .35s cubic-bezier(.4,0,.2,1);
}

/* ---- Karta / obrazovka ---- */
.screen {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 40px);
  animation: fadeUp .35s ease both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .screen, .progress-fill { animation: none; transition: none; }
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mandarinka); margin-bottom: 14px;
}
h1.title { font-size: clamp(1.7rem, 5vw, 2.5rem); line-height: 1.1; margin: 0 0 14px; font-weight: 800; color: var(--kobalt); }
.subtitle { color: var(--muted); font-size: 1.06rem; margin: 0 0 22px; }
.note { color: var(--muted); font-size: 0.95rem; background: var(--snezna); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 24px; }
h2.question { font-size: clamp(1.3rem, 4vw, 1.75rem); line-height: 1.2; margin: 6px 0 8px; font-weight: 700; color: var(--inkoust); }
.qdesc { color: var(--muted); font-size: 0.98rem; margin: 0 0 22px; }
.qmeta { font-size: 0.72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* ---- Škála 0–10 ---- */
.scale { margin: 8px 0 6px; }
.scale-grid { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; }
.scale-btn {
  aspect-ratio: 1 / 1; min-height: 44px;
  border: 2px solid var(--border); border-radius: 12px; background: #fff;
  font-family: inherit; font-weight: 800; font-size: 1.02rem; color: var(--kobalt);
  cursor: pointer; transition: border-color .12s, background .12s, transform .08s, color .12s;
}
.scale-btn:hover { border-color: var(--kobalt); background: #f7faff; }
.scale-btn:active { transform: scale(.96); }
.scale-btn.selected { border-color: var(--mandarinka); background: var(--mandarinka); color: #fff; }
.scale-btn:focus-visible { outline: 3px solid var(--mandarinka); outline-offset: 2px; }
.scale-labels { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
@media (max-width: 520px) {
  .scale-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ---- Volby (single / multi) ---- */
.choices { display: flex; flex-direction: column; gap: 12px; }
.choice {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  background: #fff; border: 2px solid var(--border); border-radius: 14px;
  padding: 16px 18px; font-family: inherit; font-size: 1.05rem; font-weight: 600; color: var(--inkoust);
  cursor: pointer; transition: border-color .15s, background .15s, transform .08s;
}
.choice:hover { border-color: var(--kobalt); background: #f7faff; }
.choice:active { transform: scale(.99); }
.choice:focus-visible { outline: 3px solid var(--mandarinka); outline-offset: 2px; }
.choice .box {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px;
  border: 2px solid var(--svetla-modra); display: grid; place-items: center;
  color: #fff; font-weight: 900; font-size: 0.9rem; transition: background .12s, border-color .12s;
}
.choice.radio .box { border-radius: 50%; }
.choice.selected { border-color: var(--mandarinka); background: var(--svetla-oranzova); }
.choice.selected .box { background: var(--mandarinka); border-color: var(--mandarinka); }
.other-input { margin-top: 6px; }

/* ---- Matice ---- */
.matrix { margin: 6px 0; overflow-x: auto; }
.matrix table { border-collapse: collapse; width: 100%; min-width: 460px; }
.matrix th, .matrix td { padding: 8px 6px; text-align: center; }
.matrix thead th { font-size: 0.72rem; color: var(--muted); font-weight: 700; vertical-align: bottom; }
.matrix tbody th { text-align: left; font-weight: 700; color: var(--inkoust); font-size: 0.98rem; padding-right: 12px; }
.matrix tbody tr { border-top: 1px solid var(--border); }
.mx-dot {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--svetla-modra);
  background: #fff; cursor: pointer; display: inline-block; transition: background .12s, border-color .12s, transform .08s;
}
.mx-dot:hover { border-color: var(--kobalt); }
.mx-dot.selected { background: var(--mandarinka); border-color: var(--mandarinka); }
.mx-dot:focus-visible { outline: 3px solid var(--mandarinka); outline-offset: 2px; }

/* ---- Text pole ---- */
.field { margin-bottom: 4px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.95rem; }
.field input, .field textarea, .ta {
  width: 100%; padding: 14px 16px; font-family: inherit; font-size: 1.05rem;
  border: 2px solid var(--border); border-radius: 12px; color: var(--inkoust); background: #fff;
  line-height: 1.5;
}
.ta { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus, .ta:focus { outline: none; border-color: var(--kobalt); }
.field input.invalid { border-color: #d64545; }
.consent { font-size: 0.82rem; color: var(--muted); margin: 10px 0 20px; }
.err-msg { color: #d64545; font-size: 0.88rem; margin-top: 6px; min-height: 1em; }

/* ---- Tlačítka ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit; font-weight: 800; font-size: 1.06rem;
  padding: 15px 26px; border-radius: 999px; border: 0; cursor: pointer;
  transition: transform .08s, box-shadow .15s, background .15s; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--kobalt); outline-offset: 3px; }
.btn-primary { background: var(--mandarinka); color: #fff; box-shadow: 0 8px 20px rgba(244,122,32,.35); }
.btn-primary:hover { background: #e56d15; }
.btn-primary[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--kobalt); font-weight: 700; padding: 10px 12px; font-size: 0.98rem; }
.btn-ghost:hover { color: var(--mandarinka); }

.actions { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.actions.center { justify-content: center; }
.actions .spacer { flex: 1; }

/* ---- Sekce intro ---- */
.sec-badge {
  width: 54px; height: 54px; border-radius: 14px; margin-bottom: 16px;
  display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--kobalt), var(--mandarinka)); box-shadow: var(--shadow-sm);
}

/* ---- Výsledek ---- */
.result-overall { text-align: center; margin: 6px 0 26px; }
.gauge {
  width: 132px; height: 132px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
}
.gauge .inner {
  width: 104px; height: 104px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  font-size: 2.2rem; font-weight: 800; color: var(--kobalt);
}
.gauge .unit { font-size: 0.9rem; color: var(--muted); font-weight: 700; }
.overall-label { font-weight: 700; color: var(--inkoust); }

.areas { margin: 8px 0 6px; }
.area-row { margin: 0 0 16px; }
.area-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 10px; }
.area-name { font-weight: 700; color: var(--inkoust); }
.area-score { font-weight: 800; color: var(--kobalt); white-space: nowrap; }
.bar { height: 12px; background: var(--svetla-modra); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--kobalt), var(--mandarinka)); transition: width .6s cubic-bezier(.4,0,.2,1); }

.commit-card { background: var(--svetla-oranzova); border-radius: 16px; padding: 20px 22px; margin: 22px 0 6px; }
.commit-card h3 { margin: 0 0 12px; font-size: 1.15rem; font-weight: 800; color: var(--kobalt); }
.commit { margin: 0 0 12px; }
.commit:last-child { margin-bottom: 0; }
.commit .c-q { font-size: 0.8rem; font-weight: 700; color: var(--kobalt); margin-bottom: 2px; }
.commit .c-a { color: var(--inkoust); font-weight: 600; }
.commit .c-empty { color: var(--muted); font-weight: 500; font-style: italic; }

.result-block { margin: 26px 0 6px; }
.result-block h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--mandarinka); margin: 0 0 8px; font-weight: 800; }

.download-note { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 12px 0 0; }
.closing { text-align: center; color: var(--inkoust); font-weight: 600; margin: 22px 0 6px; }

/* ---- Hodnocení hvězdami ---- */
.feedback { text-align: center; margin: 26px 0 6px; }
.feedback .fb-title { font-weight: 700; margin-bottom: 10px; }
.stars { display: inline-flex; gap: 6px; }
.star { font-size: 2rem; line-height: 1; background: none; border: 0; cursor: pointer; color: #d8deea; padding: 2px; transition: transform .1s, color .1s; }
.star:hover { transform: scale(1.15); }
.star.on { color: var(--mandarinka); }
.fb-thanks { color: var(--muted); font-weight: 600; margin-top: 8px; min-height: 1.2em; }

.center-text { text-align: center; }
.mt { margin-top: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
