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

  --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 .sect { color: var(--kobalt); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .74rem; }
.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.6rem, 5vw, 2.4rem); line-height: 1.12; margin: 0 0 14px; font-weight: 800; color: var(--kobalt); }
.subtitle { color: var(--muted); font-size: 1.04rem; margin: 0 0 28px; }
h2.question { font-size: clamp(1.25rem, 3.6vw, 1.7rem); line-height: 1.22; margin: 4px 0 8px; font-weight: 700; color: var(--inkoust); }
.qdesc { color: var(--muted); font-size: 0.98rem; margin: 0 0 20px; }
.qopt { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

/* ---- Sekce intro ---- */
.section-num { font-size: 0.82rem; font-weight: 800; letter-spacing: .1em; color: var(--mandarinka); text-transform: uppercase; margin-bottom: 12px; }
.section-desc { color: var(--muted); font-size: 1.05rem; margin: 0 0 28px; white-space: pre-line; }

/* ---- Tlačítka voleb ---- */
.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 .key {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; font-weight: 800; font-size: 0.9rem;
  background: var(--svetla-modra); color: var(--kobalt);
}
.choice.selected { border-color: var(--mandarinka); background: var(--svetla-oranzova); }
.choice.selected .key { background: var(--mandarinka); color: #fff; }
/* multiselect checkbox glyph */
.choice.multi .key { border-radius: 7px; }
.choice.multi.selected .key::after { content: "✓"; }
.choice.multi .key { font-size: .95rem; }

/* ---- Textové vstupy ---- */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.95rem; }
.field input, .field textarea, .answer-input {
  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;
}
textarea.answer-input { min-height: 130px; resize: vertical; line-height: 1.5; }
.field input:focus, .answer-input:focus { outline: none; border-color: var(--kobalt); }
.field input.invalid, .answer-input.invalid { border-color: #d64545; }
.other-input { margin-top: 10px; }
.consent { font-size: 0.82rem; color: var(--muted); margin: 6px 0 22px; }
.err-msg { color: #d64545; font-size: 0.9rem; margin-top: 10px; min-height: 1em; font-weight: 600; }

/* ---- Škála (opinion scale) ---- */
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .86rem; font-weight: 600; margin: 4px 2px 10px; }
.scale-btns { display: flex; flex-wrap: nowrap; gap: 6px; }
.scale-btn {
  flex: 1 1 0; min-width: 0; padding: 0; height: 52px; border: 2px solid var(--border); background: #fff;
  border-radius: 12px; font-family: inherit; font-weight: 700; font-size: 1.02rem; color: var(--inkoust);
  cursor: pointer; transition: border-color .12s, background .12s, transform .08s;
}
@media (max-width: 380px) { .scale-btns { gap: 4px; } .scale-btn { height: 46px; font-size: 0.92rem; } }
.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; }

/* ---- Matrix ---- */
.matrix { display: flex; flex-direction: column; gap: 16px; }
.matrix-row .mrow-title { font-weight: 700; margin-bottom: 8px; }
.matrix-cols { display: flex; flex-wrap: wrap; gap: 8px; }
.mcol {
  flex: 1 1 auto; border: 2px solid var(--border); background: #fff; border-radius: 10px;
  padding: 10px 12px; font-family: inherit; font-size: .92rem; font-weight: 600; color: var(--inkoust);
  cursor: pointer; transition: border-color .12s, background .12s; text-align: center;
}
.mcol:hover { border-color: var(--kobalt); background: #f7faff; }
.mcol.selected { border-color: var(--mandarinka); background: var(--svetla-oranzova); }

/* ---- CTA / primární 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: 26px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.actions.center { justify-content: center; }
.actions .spacer { flex: 1; }

/* ---- Výsledek ---- */
.result-badge {
  width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 2.4rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--kobalt), var(--mandarinka));
  box-shadow: var(--shadow-sm);
}
.result-eyebrow { text-align: center; }
.result-name {
  text-align: center; font-size: clamp(1.8rem, 6vw, 2.7rem); font-weight: 800; color: var(--kobalt);
  margin: 4px 0 12px; line-height: 1.06;
}
.result-tagline {
  text-align: center; font-size: 1.12rem; color: var(--inkoust); font-weight: 600;
  background: var(--svetla-oranzova); border-radius: 14px; padding: 16px 18px; margin: 0 0 22px;
}
.result-block { margin: 0 0 18px; }
.result-block h3 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--mandarinka);
  margin: 0 0 6px; font-weight: 800;
}
.result-block p { margin: 0; color: var(--inkoust); }

.cta-card {
  margin: 24px 0 6px; padding: 24px; border-radius: 16px; text-align: center;
  background: linear-gradient(135deg, var(--kobalt), #24499f); color: #fff;
}
.cta-card p { margin: 0 0 16px; color: #dbe6ff; }
.cta-note { font-size: .82rem; color: var(--muted); text-align: center; margin: 10px 0 0; }

/* ---- Hodnocení hvězdami ---- */
.feedback { text-align: center; margin: 28px 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; }
