:root {
  --bg: #0b0f17;
  --panel: #111827;
  --panel-2: #0f1524;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --accent-2: #7dd3fc;
  --ok: #34d399;
  --bad: #ef4444;
  --warn: #fbbf24;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(900px 500px at 50% -10%, #17223b 0%, var(--bg) 60%);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

/* Topbar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: rgba(17,24,39,0.6); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 26px; }
.brand h1 { font-size: 17px; margin: 0; }
.brand p { font-size: 12px; margin: 2px 0 0; color: var(--muted); }

/* Fortschritt */
.progress { position: relative; height: 26px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: 0.25; transition: width .3s; }
.progress-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }

/* Wizard: eine Frage pro Bildschirm */
.wizard { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }
.step { display: flex; flex-direction: column; gap: 16px; }
.hidden { display: none !important; }
h2 { margin: 0; font-size: 22px; }
.lead { margin: 0; color: var(--muted); }
.lead b { color: var(--text); }

.how { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

/* Hinweis-Boxen */
.disclaimer {
  background: #2a2410; border: 1px solid #4a3f17; color: #fde68a;
  border-radius: var(--radius); padding: 12px 14px; font-size: 14px;
}
.disclaimer.small { font-size: 12.5px; }
.privacy {
  background: #0c2431; border: 1px solid #164e63; color: #bae6fd;
  border-radius: var(--radius); padding: 12px 14px; font-size: 14px;
}

/* Buttons – große Touch-Ziele */
.btn {
  border: 1px solid var(--border); background: #1b2536; color: var(--text);
  padding: 12px 16px; border-radius: 12px; cursor: pointer; font: inherit;
  font-size: 16px; min-height: 48px; text-align: center;
}
.btn:hover { border-color: #3b4759; }
.btn-primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border: none; color: #06202e; font-weight: 700; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost { background: transparent; }
.btn-big { width: 100%; font-size: 18px; min-height: 56px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* Foto & Zuschnitt */
.foto-block { display: flex; flex-direction: column; gap: 10px; }
.foto-block label.btn { display: flex; align-items: center; justify-content: center; }
.crop-block { display: flex; flex-direction: column; gap: 12px; }
.crop-hint {
  margin: 0; font-size: 14px; background: #0c2431; border: 1px solid #164e63;
  color: #bae6fd; border-radius: var(--radius); padding: 10px 12px;
}
.crop-wrap { display: flex; justify-content: center; }
#cropCanvas { border-radius: 10px; border: 1px solid var(--border); max-width: 100%; }
.status { margin: 0; font-size: 14px; color: var(--accent-2); }
.status.error { color: var(--bad); }
.dots::after { content: ''; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* Felder-Formular */
.felder-block { display: flex; flex-direction: column; gap: 14px; }
.felder-hint { margin: 0; font-size: 14px; color: var(--muted); }
.felder-form { display: flex; flex-direction: column; gap: 10px; }
.feld-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; }
.feld-code {
  font-weight: 700; font-size: 15px; text-align: center; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 4px;
}
.feld-input { display: flex; flex-direction: column; gap: 3px; }
.feld-input label { font-size: 12.5px; color: var(--muted); }
input, select {
  background: #0b1220; color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; font: inherit; font-size: 17px; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
input.unsicher { border-color: var(--warn); background: #1c170a; }
.unsicher-hint { font-size: 12px; color: var(--warn); }

/* Gebremst-Frage + Hilfe-Details */
.gebremst { display: flex; flex-direction: column; gap: 8px; }
.gebremst .frage { font-weight: 600; }
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-row label {
  flex: 1; min-width: 140px; display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; cursor: pointer; font-size: 15px;
}
.radio-row label:has(input:checked) { border-color: var(--accent); background: #0c2431; }
.hilfe {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; font-size: 14px;
}
.hilfe summary { cursor: pointer; font-weight: 600; }
.hilfe p, .hilfe ul { color: var(--muted); }
.karte-hilfe b { color: var(--text); }

/* Führerschein-Auswahl */
.klasse-liste { display: flex; flex-direction: column; gap: 10px; }
.klasse-item {
  display: flex; align-items: center; gap: 12px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer;
}
.klasse-item:has(input:checked) { border-color: var(--accent); background: #0c2431; }
.klasse-item .kl-label { font-weight: 700; font-size: 17px; min-width: 44px; }
.klasse-item .kl-hint { font-size: 13px; color: var(--muted); }

/* Ergebnis */
.ampel {
  font-size: 40px; text-align: center; border-radius: var(--radius); padding: 14px;
  font-weight: 800; letter-spacing: 0.5px;
}
.ampel-gruen { background: #052e1a; border: 1px solid #14532d; color: var(--ok); }
.ampel-rot { background: #310c0c; border: 1px solid #7f1d1d; color: var(--bad); }
.ampel-grau { background: var(--panel); border: 1px solid var(--border); color: var(--muted); }
.kernzahl { text-align: center; font-size: 44px; font-weight: 800; }
.kernzahl small { display: block; font-size: 14px; color: var(--muted); font-weight: 400; }
.kernsatz { margin: 0; text-align: center; font-size: 17px; }
.fs-status { font-size: 14.5px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.warnungen { display: flex; flex-direction: column; gap: 6px; }
.warn { font-size: 13.5px; color: var(--warn); background: #2a2410; border: 1px solid #4a3f17; padding: 8px 12px; border-radius: 10px; }
.ausweg {
  background: #0c2431; border: 1px solid #164e63; border-radius: var(--radius);
  padding: 14px 16px;
}
.ausweg h3 { margin: 0 0 6px; font-size: 15px; color: var(--accent-2); }
.ausweg p { margin: 0; font-size: 14.5px; }
.rechnung ol { margin: 8px 0 4px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex;
  align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal.hidden { display: none; }
.modal-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; width: min(520px, 100%); }
.modal-card h2 { margin: 0 0 14px; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13px; }
.field span small { color: var(--muted); font-weight: normal; }
.hint { font-size: 12px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* Rechtsseiten (Impressum, Datenschutz) */
.legal { max-width: 640px; margin: 0 auto; padding: 20px 16px 40px; }
.legal .back { display: inline-block; margin-bottom: 16px; color: var(--muted); text-decoration: none; font-size: 14px; }
.legal .back:hover { color: var(--accent-2); }
.legal h1 { font-size: 24px; margin: 0 0 4px; }
.legal .stand { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.legal h2 { font-size: 17px; margin: 26px 0 8px; color: var(--accent-2); }
.legal h3 { font-size: 15px; margin: 16px 0 6px; color: var(--text); }
.legal p, .legal li { font-size: 15px; }
.legal ul, .legal ol { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.legal a { color: var(--accent-2); }
.legal address { font-style: normal; }
.legal .privacy { margin-bottom: 4px; }
.legal .privacy ul { margin: 8px 0 0; }

/* Footer */
.site-footer { max-width: 560px; margin: 0 auto; padding: 18px 16px 30px; text-align: center; font-size: 13px; color: var(--muted); }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent-2); }

/* KI-Transparenzhinweis (Art. 50 KI-VO) */
.ki-hinweis {
  font-size: 13px; color: #bae6fd; background: #0c2431; border: 1px solid #164e63;
  border-radius: 10px; padding: 8px 12px;
}

@media (min-width: 700px) {
  .wizard { padding-top: 32px; }
  h2 { font-size: 26px; }
}
