/* Resilience dotazník — moderní, elegantní, mobile-first
 * Paleta: near-white pozadí, near-black text, deep amber akcent (resilience = warm + grounded)
 */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --text: #0a0a0a;
  --text-muted: #525252;
  --text-subtle: #737373;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-soft: #fef3c7;
  --error: #dc2626;
  --max-width: 560px;
  --radius: 12px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ──────── topbar ──────── */

.topbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.progress {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ──────── screen container ──────── */

.screen-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.screen {
  display: flex;
  flex-direction: column;
  padding: 32px 0 24px;
  animation: fadeIn 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.q-title {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.q-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ──────── option buttons (single + multi) ──────── */

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  font-size: 16px;
  color: var(--text);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.option:hover {
  border-color: var(--border-strong);
  background: var(--bg-soft);
}

.option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 500;
}

.option .indicator {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.option[data-type="multi"] .indicator {
  border-radius: 5px;
}

.option.selected .indicator {
  border-color: var(--accent);
  background: var(--accent);
}

.option.selected .indicator::after {
  content: "";
  display: block;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.option.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ──────── scale (Q6, Q9) ──────── */

.scale {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 8px;
}

.scale-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.scale-btn {
  padding: 16px 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.scale-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-soft);
}

.scale-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-subtle);
  padding: 0 4px;
}

/* ──────── text inputs ──────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.field-help {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-subtle, #888);
  line-height: 1.4;
}

.field-help code {
  background: var(--bg-muted, #f3f4f6);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

/* ── Demografická obrazovka (q11) ─────────────────────────────── */

.demographic-group {
  margin-top: 20px;
}

.demographic-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.demographic-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.demographic-option {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 999px;
  background: var(--bg-card, #fff);
  border: 1.5px solid var(--border, #e5e7eb);
  color: var(--text, #171717);
  cursor: pointer;
  transition: all 0.15s ease;
}

.demographic-option:hover {
  border-color: var(--accent, #0d9488);
}

.demographic-option.selected {
  background: var(--accent, #0d9488);
  border-color: var(--accent, #0d9488);
  color: #fff;
}

.demographics-skip {
  text-align: center;
  margin-top: 16px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-subtle, #888);
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px;
}

.link-btn:hover {
  color: var(--accent, #0d9488);
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.char-count {
  font-size: 12px;
  color: var(--text-subtle);
  text-align: right;
  margin-top: 2px;
}

/* ──────── animal screen specific ──────── */

.animal-pair {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.animal-pair-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

/* ──────── nav buttons ──────── */

.nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-bottom: 24px;
}

.btn {
  flex: 1;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled {
  background: var(--border-strong);
  color: var(--text-subtle);
  cursor: not-allowed;
}

.btn-secondary {
  flex: 0 0 auto;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  padding: 16px 18px;
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.error-msg {
  color: var(--error);
  font-size: 14px;
  margin-top: 8px;
  min-height: 20px;
}

/* ──────── welcome / thank you ──────── */

.welcome,
.thanks {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  padding: 40px 0;
  min-height: 60vh;
}

.welcome h1,
.thanks h1 {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.welcome p,
.thanks p {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.welcome-meta {
  margin-top: 24px;
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--text-subtle);
}

.thanks-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 24px;
}

.thanks-cta {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 12px;
  text-decoration: none;
}

/* ──────── computing screen (po submitu, čekáme na výsledek) ──────── */

.thanks.computing {
  align-items: flex-start;
}

.computing-dots {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.computing-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: computingPulse 1.4s infinite ease-in-out;
}

.computing-dots span:nth-child(2) { animation-delay: 0.2s; }
.computing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes computingPulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40%           { opacity: 1;    transform: scale(1.05); }
}

/* ──────── result screen po submitu ──────── */

.result {
  align-items: flex-start;
  gap: 16px;
}

.result h1 {
  font-size: 26px;
  margin-bottom: 4px;
}

.result-map {
  width: 100%;
  max-width: 360px;
  align-self: center;
  margin: 8px 0 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}

.result-map svg {
  display: block;
  width: 100%;
  height: auto;
}

.result-archetype {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin-top: 4px;
}

.result-interpretation {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  margin: 4px 0 8px;
}

.result-animal {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-muted);
  width: 100%;
  box-sizing: border-box;
}

.result-animal-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  color: var(--text);
}

.result-animal-pair .sep { color: var(--text-subtle); }

.result-animal-note {
  margin-top: 6px;
  font-style: italic;
  color: var(--text-muted);
}

.result-cta {
  align-self: flex-start;
  text-decoration: none;
  margin-top: 8px;
}

/* ──────── footer ──────── */

.footer {
  text-align: center;
  padding: 16px 20px 24px;
  color: var(--text-subtle);
  font-size: 12px;
}

/* ──────── desktop tweaks ──────── */

@media (min-width: 640px) {
  body { font-size: 18px; }
  .q-title { font-size: 28px; }
  .topbar { padding: 18px 24px; }
  .screen { padding: 48px 0 32px; }
}

/* ──────── virtue grid (Q11: VIA ctnosti) ──────── */

.virtue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.virtue-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 64px;
}

.virtue-chip:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-soft);
}

.virtue-chip.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.virtue-chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.virtue-foe-note {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 15px;
  color: var(--text-muted);
  font-style: italic;
}

/* ──────── baseline pct (in result screen) ──────── */

.baseline-pct {
  display: inline-block;
  font-size: 13px;
  color: var(--text-subtle);
  margin-left: 6px;
}

.result-virtue-pair {
  display: flex;
  gap: 16px;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 16px 0 8px;
}
.result-virtue-pair .sep { color: var(--text-subtle); }
.result-virtue-note {
  background: var(--bg-soft);
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  margin-top: 8px;
}

/* ──────── reduce motion ──────── */

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
