/* ──────────────────────────────────────────────────────────────────────────
   Radontec Risikocheck (Public-Form) – Styles
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --red: #b70e0c;
  --red-dark: #8c0a09;
  --red-soft: #fef2f2;
  --red-tint: rgba(183, 14, 12, 0.10);

  --bg: #f4f5f7;
  --card: #ffffff;
  --border: #e5e7eb;
  --border-soft: #f1f2f4;

  --text: #111827;
  --text-2: #1f2937;
  --muted: #6b7280;
  --muted-2: #9ca3af;

  --green: #16a34a;
  --green-soft: #f0fdf4;

  --radius: 14px;
  --radius-sm: 10px;
}

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

/* HTML5 hidden-Attribut absichern (sonst gewinnen display:flex etc. dagegen) */
[hidden] { display: none !important; }

/* Form-Elemente erben Font vom Body (sonst System-Default wie Tahoma) */
button, input, textarea, select { font: inherit; color: inherit; }

html, body { min-height: 100%; }

body {
  font-family: 'Figtree', system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(1400px 700px at 80% -10%, rgba(183,14,12,0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(183,14,12,0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

/* ── Header ──────────────────────────────────────────────────────────── */
.rc-header {
  padding: 22px 24px 0;
}
.rc-header-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.rc-brand img { height: 28px; display: block; }
.rc-tagline {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding-left: 14px;
  border-left: 1px solid var(--border);
  letter-spacing: 0.02em;
}

/* ── Main ────────────────────────────────────────────────────────────── */
.rc-main {
  flex: 1;
  padding: 32px 20px 48px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* ── Progress ────────────────────────────────────────────────────────── */
.rc-progress {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin: 0 auto 20px;
  max-width: 480px;
  overflow: hidden;
}
.rc-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--red);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ── Card ────────────────────────────────────────────────────────────── */
.rc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 36px 32px;
  box-shadow: 0 20px 50px -20px rgba(17, 24, 39, 0.16),
              0 2px 6px rgba(17, 24, 39, 0.04);
  position: relative;
  min-height: 320px;
}

/* ── Step ────────────────────────────────────────────────────────────── */
.rc-step { animation: rc-fade-in 0.24s ease; }
@keyframes rc-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

h1, h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
  line-height: 1.25;
}
h2 { font-size: 22px; }
.rc-lead {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 18px;
}

/* ── PLZ Form ────────────────────────────────────────────────────────── */
.rc-plz-form { margin-top: 18px; }
.rc-plz-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.rc-plz-row input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rc-plz-row input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(183,14,12,0.12);
}
.rc-plz-row .rc-btn { padding: 14px 22px; white-space: nowrap; }
.rc-plz-error {
  margin-top: 10px;
  font-size: 13px;
  color: var(--red);
}
.rc-plz-hint {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted-2);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.rc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.rc-btn:active { transform: scale(0.98); }
.rc-btn-primary {
  background: var(--red);
  color: #fff;
}
.rc-btn-primary:hover { background: var(--red-dark); }
.rc-btn-primary:disabled {
  background: var(--muted-2);
  cursor: not-allowed;
}
.rc-btn-block { width: 100%; margin-top: 6px; padding: 14px; }

.rc-btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rc-spin 0.7s linear infinite;
}
@keyframes rc-spin { to { transform: rotate(360deg); } }

/* ── Question (dynamisch) ────────────────────────────────────────────── */
.rc-question-text {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 22px;
}
.rc-question-step {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Antwort-Grid mit konsistenter Kachel-Breite. Anzahl der Spalten richtet
   sich nach der Anzahl der Antworten: 2 → 2 in Reihe, 3 → 3 in Reihe,
   4 → 2x2. So bleiben die Kacheln über alle Fragen hinweg gleich groß. */
.rc-answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 0 auto;
}
.rc-answer-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 440px; }
.rc-answer-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 660px; }
.rc-answer-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 440px; }

.rc-answer {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}
.rc-answer:hover {
  transform: translateY(-3px);
  border-color: var(--red);
  box-shadow: 0 10px 24px -10px rgba(183,14,12,0.25);
}
.rc-answer:focus-visible {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(183,14,12,0.18);
}
.rc-answer img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f3f4f6;
}
.rc-answer-label {
  padding: 12px 14px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  line-height: 1.4;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Back-Button */
.rc-back {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
  margin-bottom: 14px;
}
.rc-back:hover { color: var(--text); }
.rc-back svg { width: 13px; height: 13px; }

/* ── Lead Form ───────────────────────────────────────────────────────── */
.rc-lead-icon {
  width: 72px;
  height: 72px;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.rc-step[data-step="lead"] { text-align: center; }
.rc-step[data-step="lead"] .rc-lead-form { text-align: left; margin-top: 22px; }

.rc-lead-form { display: flex; flex-direction: column; gap: 14px; }
.rc-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .rc-form-row { grid-template-columns: 1fr; } }

.rc-lead-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}
.rc-lead-form input[type="text"],
.rc-lead-form input[type="email"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 14.5px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rc-lead-form input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(183,14,12,0.12);
}

.rc-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
}
.rc-checkbox input { margin-top: 3px; flex-shrink: 0; cursor: pointer; }

.rc-error {
  padding: 10px 14px;
  background: var(--red-soft);
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-size: 13px;
}

/* ── Loading-Overlay ─────────────────────────────────────────────────── */
.rc-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: var(--radius);
  z-index: 10;
}
.rc-loading p { color: var(--muted); font-size: 13.5px; }
.rc-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: rc-spin 0.7s linear infinite;
}

/* ── Trust ───────────────────────────────────────────────────────────── */
.rc-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--muted);
}
.rc-trust svg { color: var(--green); }

/* ── Footer ──────────────────────────────────────────────────────────── */
.rc-footer {
  padding: 22px 24px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.6);
  margin-top: 12px;
}
.rc-footer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.rc-footer a { color: var(--muted); }
.rc-footer a:hover { color: var(--red); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .rc-card { padding: 24px 20px 22px; }
  h1 { font-size: 20px; }
  h2 { font-size: 18px; }
  .rc-question-text { font-size: 17px; }
  .rc-plz-row { flex-direction: column; }
  .rc-plz-row .rc-btn { width: 100%; }
  .rc-answer-grid,
  .rc-answer-grid.cols-2,
  .rc-answer-grid.cols-3,
  .rc-answer-grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
  }
  .rc-answer img { aspect-ratio: 4 / 3; }
  .rc-answer-label { font-size: 13.5px; padding: 10px 12px; }
}
