/* Planungs-Check — Public Frontend
 * Neutraler Stil, dezente Blau-/Grautöne (KONZEPT §8: keine Ampelfarben).
 * Mobile-first, Branding-Platzhalter — leicht ersetzbar.
 */

/* Selbst gehostete Channel-Schriften gehoeren als @font-face hierher, Dateien
 * unter assets/fonts/ (KONZEPT §4c). Derzeit keine: Default ist der System-Stack. */

:root {
  --color-text: #1c2733;
  --color-text-muted: #5b6a82;
  --color-bg: #ffffff;
  --color-bg-soft: #f4f6fa;
  --color-border: #d8dee9;
  --color-accent: #1a3e6f;
  --color-accent-soft: #e1ebf7;
  --color-accent-fg: #ffffff;  /* Textfarbe AUF accent-Hintergrund. Channel kann per
                                 --color-accent-fg-Override auf #000 wechseln (z.B. bei hellen
                                 Akzentfarben wie Gelb). Siehe backend/services/channel_render.py. */
  --color-error: #b03a3a;
  --color-success: #2f6f3f;

  /* Quadranten (KONZEPT §8): keine Ampelfarben; die zwei gemischten Felder 2 und 3
     tragen dieselbe Farbe, damit kein Ranking gelesen wird. */
  --quadrant-1: #e1ebf7;  /* Frühstarter (links unten) */
  --quadrant-2: #c3d3e9;  /* Möglichmacher (rechts unten) — gleich wie 3 */
  --quadrant-3: #c3d3e9;  /* Strukturierte (links oben) — gleich wie 2 */
  --quadrant-4: #9eb4d2;  /* Startklare (rechts oben) */

  --radius: 8px;
  --shadow-card: 0 1px 3px rgba(28, 39, 51, 0.08), 0 1px 2px rgba(28, 39, 51, 0.04);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-size: 16px;
  --line-height: 1.5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
}

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

h1, h2, h3 { line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.875rem; margin: 0 0 1rem; }
h2 { font-size: 1.4rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.5rem; }

p { margin: 0 0 1rem; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.container--wide { max-width: 960px; }

/* --- Header / Footer --- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 0.25rem 0;
  background: var(--color-header-bg, transparent);
}

.site-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1rem 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
}

.site-footer a { margin: 0 0.5rem; }

/* Tippflaechen auf Touch-Geraeten mind. 44 px hoch (Footer-Links, aufklappbare Hinweise). */
@media (pointer: coarse) {
  .site-footer a { display: inline-block; padding: 0.75rem 0.25rem; }
  .dsgvo-details summary { padding: 0.7rem 0; }
  .score-toggle { min-height: 44px; }
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-accent);
  background: var(--color-accent);
  color: var(--color-accent-fg);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease;
}

.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--secondary {
  background: var(--color-bg);
  color: var(--color-accent);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-muted);
  padding: 0.5rem 0.75rem;
}

.btn--block { width: 100%; }

/* Bereits gewaehlte Antwort (beim Zuruecknavigieren sichtbar). */
.btn--secondary.btn--selected {
  background: var(--color-accent-soft);
  box-shadow: inset 0 0 0 1px var(--color-accent);
  font-weight: 600;
}

/* --- Cards --- */

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1rem;
}

.card--soft {
  background: var(--color-bg-soft);
  border-color: var(--color-border);
}

/* --- Forms --- */

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
}

/* Eigener Pfeil statt nativer Darstellung: Safari auf iPhone/iPad ignoriert sonst
   Padding und Hoehe, die Auswahlfelder waeren flacher als die Textfelder. */
select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("select-arrow.svg");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.75rem;
  padding-right: 2.25rem;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

textarea { resize: vertical; min-height: 4rem; }

.form-row { margin-bottom: 1rem; }
.form-row__hint { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.25rem; }

.checkbox-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.checkbox-row input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
}

.checkbox-row label {
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0;
}

/* --- Question Step --- */

.question-step {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.question-step__progress {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.question-step__text {
  font-size: 1.2rem;
  line-height: 1.4;
  margin-bottom: 1.75rem;
}

.answer-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.answer-buttons .btn {
  padding: 1rem 0.5rem;
  font-size: 1rem;
}

.progress-bar {
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.progress-bar__fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.25s ease;
}

/* Handy: kompakter, damit Frage und alle Antworten auch auf kleinen Geraeten
   (z. B. iPhone SE, 320 x 568) ohne Scrollen sichtbar sind. */
@media (max-width: 480px) {
  .container { padding-top: 0.75rem; }
  .progress-bar { margin-bottom: 0.75rem; }
  .question-step { padding: 1.25rem 1rem; }
  .question-step__text { font-size: 1.1rem; margin-bottom: 1rem; }
}

/* --- Result Page --- */

.persona-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .persona-hero { grid-template-columns: 1fr 1fr; align-items: center; }
}

.persona-hero__name {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.persona-hero__headline {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.25;
}

.quadrant-chart {
  display: flex;
  justify-content: center;
}

.quadrant-chart svg {
  max-width: 360px;
  width: 100%;
  height: auto;
}

.persona-section { margin-bottom: 1.5rem; }
.persona-section h2 { font-size: 1.1rem; }

.bullet-list { padding-left: 1.25rem; margin: 0; }
.bullet-list li { margin-bottom: 0.4rem; }

.numbered-list {
  list-style: none;
  counter-reset: step-counter;
  padding: 0;
  margin: 0;
}

.numbered-list li {
  counter-increment: step-counter;
  padding-left: 2.5rem;
  position: relative;
  margin-bottom: 0.75rem;
}

.numbered-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.numbered-list li strong { display: block; margin-bottom: 0.2rem; }

.risk-item, .step-item { margin-bottom: 0.85rem; }
.risk-item strong, .step-item strong { display: block; }

/* --- Ergebnis-CTA "Ihr nächster Schritt" (KONZEPT §7) --- */

.offer-cta {
  background: var(--color-accent);
  color: var(--color-accent-fg);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.offer-cta h2 { color: var(--color-accent-fg); margin-bottom: 0.5rem; }
.offer-cta .btn {
  background: var(--color-accent-fg);
  color: var(--color-accent);
  border-color: var(--color-accent-fg);
  margin-top: 1rem;
}

/* --- Detail-Score --- */

/* Ein gemeinsames Raster fuer beide Balken: Die Spur beginnt bei beiden an derselben
   Stelle, egal wie lang die Achsen-Namen sind. */
.score-bars {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}
.score-bar { display: contents; }

.score-bar__label { font-size: 0.9rem; }
.score-bar__track {
  height: 14px;
  background: var(--color-bg-soft);
  border-radius: 7px;
  overflow: hidden;
}

.score-bar__fill {
  height: 100%;
  background: var(--color-accent);
}

.score-bar__value { font-size: 0.875rem; color: var(--color-text-muted); text-align: right; }

@media (max-width: 479px) {
  .score-bars { grid-template-columns: minmax(0, 1fr) max-content; row-gap: 0.4rem; }
  .score-bar__label { grid-column: 1 / -1; margin-top: 0.35rem; }
}

/* --- Self-Assessment-Cross-Check --- */

.self-check {
  background: var(--color-bg-soft);
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1rem 0;
}

/* --- Generic --- */

.muted { color: var(--color-text-muted); }
.error { color: var(--color-error); font-size: 0.9rem; margin-top: 0.4rem; }
.spacer-1 { margin-top: 0.5rem; }
.spacer-2 { margin-top: 1rem; }
.spacer-3 { margin-top: 1.5rem; }

.center { text-align: center; }

[x-cloak] { display: none !important; }

.print-only { display: none; }

/* --- Print (KONZEPT §7: "Ergebnis ausdrucken / als PDF") --- */

@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  .print-only { display: block !important; }
  body { font-size: 11pt; }
  .container { max-width: 100%; padding: 0; }
  .offer-cta { background: var(--color-bg-soft) !important; color: var(--color-text) !important; }
  .offer-cta h2 { color: var(--color-text) !important; }
  .offer-cta { border: 1px solid var(--color-border); page-break-inside: avoid; }
  .print-footer { margin-top: 1.5rem; padding-top: 0.5rem; border-top: 1px solid var(--color-border); font-size: 9pt; color: var(--color-text-muted); }
  .card { box-shadow: none; border: 1px solid var(--color-border); page-break-inside: avoid; }
}

/* --- Loading --- */

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
}

.loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  margin-left: 0.5rem;
  animation: spin 0.75s linear infinite;
  vertical-align: -3px;
}

@keyframes spin { to { transform: rotate(360deg); } }
