/* Anfrageformulare
   ---------------------------------------------------------------
   Geladen nur auf Seiten mit Formular: die Bloecke nennen das Handle
   "dguv-formular" in ihrer block.json. Alle Werte kommen aus den Tokens
   in base.css, keine eigenen Farben.
   --------------------------------------------------------------- */

.anfrage { position: relative; }
/* hidden muss gewinnen: Regeln wie display:flex an .af-abschluss
   ueberstimmen sonst das Attribut, und der Absende-Button stuende schon in
   Schritt 1. */
.anfrage [hidden] { display: none !important; }

/* Raster mit sechs Spalten: ganze, halbe, Drittel- und Zweidrittelbreite. */
.af-raster {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px 18px;
}
.af-feld { grid-column: span 6; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.af-halb { grid-column: span 3; }
.af-drittel { grid-column: span 2; }
.af-zweidrittel { grid-column: span 4; }
@media (max-width: 620px) {
  .af-halb, .af-drittel, .af-zweidrittel { grid-column: span 6; }
}

/* fieldset bringt Rand und Innenabstand mit. */
.anfrage fieldset { border: 0; min-width: 0; }

.af-feld > label,
.af-feld > legend {
  font-size: 0.9rem; font-weight: 600; color: var(--slate); line-height: 1.4;
}
.af-feld > legend { margin-bottom: 8px; }
.af-pflicht { color: var(--blue); }

.anfrage input[type="text"],
.anfrage input[type="email"],
.anfrage input[type="tel"],
.anfrage select,
.anfrage textarea {
  width: 100%;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 14px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.anfrage textarea { resize: vertical; min-height: 132px; }
.anfrage select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%235A6B7A' d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 14px;
}
.anfrage ::placeholder { color: #8a99a8; opacity: 1; }
.anfrage input:focus-visible,
.anfrage select:focus-visible,
.anfrage textarea:focus-visible {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 123, 249, .18);
}

/* ---------- Auswahl als Kacheln ---------- */
.af-optionen { display: flex; flex-wrap: wrap; gap: 10px; }
.af-option {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--slate);
  font-size: 0.95rem; line-height: 1.35; cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.af-option:hover { border-color: var(--blue); }
.af-option:has(input:checked) { border-color: var(--blue); background: var(--bg-blue-tint); }
.af-option:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(0, 123, 249, .18); }
.af-option input { accent-color: var(--blue); width: 18px; height: 18px; margin: 0; flex-shrink: 0; }

/* Bewertungsskala: fuenf gleich breite Stufen. */
.af-skala .af-optionen { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.af-skala .af-option { flex-direction: column; justify-content: center; text-align: center; gap: 6px; font-size: 0.82rem; }
@media (max-width: 520px) {
  .af-skala .af-optionen { grid-template-columns: 1fr; }
  .af-skala .af-option { flex-direction: row; justify-content: flex-start; text-align: left; }
}

/* Zustimmung: der Text neben dem Haken ist die Beschriftung, keine Kachel. */
.af-zustimmung .af-option {
  border: 0; padding: 0; background: none; align-items: flex-start;
  font-size: 0.9rem; color: var(--muted); cursor: default;
}
.af-zustimmung .af-option:has(input:checked) { background: none; }
.af-zustimmung .af-option input { margin-top: 2px; cursor: pointer; }
.af-zustimmung a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.af-zustimmung a:hover { color: var(--blue-dark); }

/* ---------- Regler ---------- */
.af-regler { display: flex; align-items: center; gap: 18px; }
.af-regler input[type="range"] { flex: 1; accent-color: var(--blue); height: 28px; cursor: pointer; }
.af-regler output {
  min-width: 112px; text-align: center;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--bg-blue-tint); color: var(--blue-dark);
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.95rem;
}
.af-regler-skala {
  display: flex; justify-content: space-between;
  max-width: calc(100% - 130px);
  font-size: 0.78rem; color: var(--muted);
}

/* ---------- Dateiablage ---------- */
.af-ablage {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--muted);
  font-size: 0.92rem; cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.af-ablage i { font-size: 1.6rem; color: var(--blue); }
.af-ablage:hover, .af-ablage.ist-ueber { border-color: var(--blue); background: var(--bg-blue-tint); }
.af-ablage:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(0, 123, 249, .18); }
/* Das Feld liegt unsichtbar ueber der ganzen Flaeche: Klick und Ablegen per
   Ziehen treffen damit das echte Dateifeld. */
.af-ablage input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.af-dateiliste { list-style: none; display: grid; gap: 4px; font-size: 0.88rem; color: var(--slate); }
.af-dateiliste:empty { display: none; }
.af-dateiliste li::before { content: "· "; color: var(--blue); font-weight: 700; }
.af-dateiliste .ist-zu-gross { color: var(--warnung); }

/* ---------- Hinweise und Fehler ---------- */
.af-hilfe { font-size: 0.82rem; color: var(--muted); }
.af-fehler { font-size: 0.85rem; font-weight: 600; color: var(--warnung); }
.af-fehlerhaft input, .af-fehlerhaft select, .af-fehlerhaft textarea { border-color: var(--warnung); }
.af-meldung {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 24px; padding: 14px 18px;
  border-left: 3px solid var(--warnung); background: #fdf3ea;
  color: var(--slate); font-size: 0.95rem;
}
.af-meldung:focus { outline: none; }

/* Honigtopf: fuer Menschen unsichtbar, fuer Screenreader stumm. */
.af-falle { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Schritte ---------- */
.af-fortschritt { display: none; }
.ist-mehrstufig .af-fortschritt {
  list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-bottom: 28px;
}
.ist-mehrstufig .af-fortschritt li {
  padding-top: 10px; border-top: 3px solid var(--line);
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ist-mehrstufig .af-fortschritt li.ist-aktiv { border-color: var(--blue); color: var(--blue); }
.ist-mehrstufig .af-fortschritt li.ist-erledigt { border-color: var(--blue); }

.af-schritt + .af-schritt { margin-top: 40px; }
.ist-mehrstufig .af-schritt + .af-schritt { margin-top: 0; }
.af-schritt-titel {
  display: block; margin-bottom: 22px;
  font-size: 1.2rem; font-weight: 700; color: var(--slate); line-height: 1.3;
}
.af-schritt-titel:focus { outline: none; }
.af-navigation { display: none; }
.ist-mehrstufig .af-navigation { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.ist-mehrstufig .af-navigation .af-weiter { margin-left: auto; }

.af-abschluss { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.ist-mehrstufig .af-abschluss { justify-content: flex-end; }
.af-hinweis { font-size: 0.82rem; color: var(--muted); }
.af-senden[disabled] { opacity: .65; cursor: progress; }
.ist-mehrstufig .af-schritt:last-of-type ~ .af-abschluss { margin-top: 20px; }
