/* Inhaltsseiten: Anfrageformular (auch eingebettet auf der Fahrzeug-Detailseite), Dankeseite, Rechtstexte, 404.
   Farben, Schrift und Knöpfe aus base.css. Eckig, feine Linien statt Schatten, keine Bewegung. */

[hidden] {
  display: none !important;
}

.inquiry-page,
.inquiry-thanks,
.inquiry-form,
.legal-page,
.not-found {
  --form-line: var(--stein); /* Feldrahmen: 6:1 auf Weiß */
  --form-error: #b3261e; /* 6,5:1 auf Weiß */
  --form-muted: var(--stein);
  --form-focus: var(--graphit);
  --form-selected: #edf1eb; /* heller Wiesenton für die gewählte Fläche */
}

/* ---------- Seitenkopf ---------- */

.inquiry-page,
.inquiry-thanks,
.legal-page {
  padding-top: clamp(2rem, 6vw, 4rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

.inquiry-page h1,
.inquiry-thanks h1,
.legal-page h1,
.not-found h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 1;
  overflow-wrap: break-word;
  hyphens: auto;
}

.inquiry-intro,
.inquiry-thanks > p,
.not-found-text > p {
  max-width: 38em;
  margin: 0;
  font-size: 1.1875rem;
}

/* Auf hellem Grund ein dunkler Fokusrahmen (Abendlicht aus base.css hätte auf Weiß zu wenig Kontrast). */
.inquiry-page a:focus-visible,
.inquiry-thanks a:focus-visible,
.inquiry-form a:focus-visible,
.legal-page a:focus-visible,
.not-found a:focus-visible {
  outline-color: var(--form-focus);
}

/* ---------- Formular ---------- */

.inquiry-form {
  margin-top: 2rem;
}

.form-required-note,
.field-hint,
.form-privacy,
.optional {
  color: var(--form-muted);
  font-size: 0.9375rem;
}

.form-required-note,
.form-privacy {
  margin: 0;
}

.form-field {
  margin: 0;
}

/* Gleichmäßiger Abstand zwischen allen Blöcken des Formulars (nach den Einzelregeln, damit er gewinnt). */
.inquiry-form > * + * {
  margin-top: 1.75rem;
}

.form-field > label,
.form-choice > legend {
  display: block;
  margin-bottom: 0.375rem;
  padding: 0;
  font-weight: 700;
}

.optional {
  font-weight: 400;
}

.required {
  color: var(--form-error);
}

.field-hint {
  margin: 0 0 0.5rem;
}

.inquiry-form input[type='text'],
.inquiry-form input[type='email'],
.inquiry-form input[type='tel'],
.inquiry-form textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin: 0;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--form-line);
  border-radius: 2px;
  background: #ffffff;
  color: var(--graphit);
  /* Mindestens 16 px, sonst zoomt iOS Safari beim Antippen ins Feld. */
  font: inherit;
  font-size: max(1rem, 16px);
  line-height: 1.4;
}

.inquiry-form textarea {
  min-height: 10rem;
  resize: vertical;
}

.inquiry-form input:hover,
.inquiry-form textarea:hover {
  border-color: var(--graphit);
}

.inquiry-form ::placeholder {
  color: var(--form-muted);
  opacity: 1;
}

.inquiry-form input:focus-visible,
.inquiry-form textarea:focus-visible,
.inquiry-form button:focus-visible,
.form-errors:focus {
  outline: 3px solid var(--form-focus);
  outline-offset: 2px;
}

.inquiry-form input:focus-visible,
.inquiry-form textarea:focus-visible {
  border-color: var(--graphit);
}

/* Fehler: rote Linie am Feld und Meldung darüber, nie nur über die Farbe. */
.has-error input,
.has-error textarea {
  border-color: var(--form-error);
  box-shadow: inset 0 0 0 1px var(--form-error);
}

.field-error {
  margin: 0 0 0.5rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--form-error);
  color: var(--form-error);
  font-weight: 700;
}

/* ---------- Anliegen: drei wählbare Flächen ---------- */

.form-choice,
.form-group {
  min-width: 0;
  margin-left: 0;
  margin-right: 0;
  padding: 0;
  border: 0;
}

.choice-list {
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 36rem) {
  .choice-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--form-line);
  border-radius: 2px;
  background: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.choice:hover {
  border-color: var(--graphit);
}

.choice input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--wiese);
  cursor: pointer;
}

.choice input:focus-visible {
  outline: 3px solid var(--form-focus);
  outline-offset: 2px;
}

.choice:has(input:checked) {
  border-color: var(--wiese);
  box-shadow: inset 0 0 0 1px var(--wiese);
  background: var(--form-selected);
}

/* Fokus als Rahmen um die ganze Fläche, wo der Browser das kann. */
@supports selector(:has(*)) {
  .choice:has(input:focus-visible) {
    outline: 3px solid var(--form-focus);
    outline-offset: 2px;
  }

  .choice input:focus-visible {
    outline: none;
  }
}

.form-choice.has-error .choice {
  border-color: var(--form-error);
}

.art-hint {
  max-width: 38em;
  margin: 0.75rem 0 0;
  color: var(--form-muted);
}

/* Angaben zum angebotenen Fahrzeug (Ankauf) */
.form-group {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.form-group > legend {
  float: left;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 1.5rem;
  font-stretch: 75%;
  font-weight: 800;
  line-height: 1.1;
}

.form-group > legend + * {
  clear: left;
}

.form-group > .form-field + .form-field {
  margin-top: 1.25rem;
}

/* Fahrzeugbezug */
.inquiry-vehicle {
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--wiese);
  background: var(--alu);
}

.inquiry-vehicle p {
  margin: 0;
}

.inquiry-vehicle a {
  font-weight: 700;
  text-underline-offset: 0.2em;
}

/* ---------- Hinweise und Fehlerzusammenfassung ---------- */

.form-errors,
.form-alert {
  padding: 1.25rem 1.5rem;
  border: 2px solid var(--form-error);
  border-left-width: 6px;
  background: #ffffff;
}

.form-errors h2 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
}

.form-errors ul,
.contact-alternatives {
  margin: 0;
  padding-left: 1.25rem;
}

.form-errors li + li,
.contact-alternatives li + li {
  margin-top: 0.25rem;
}

.form-errors a {
  color: var(--form-error);
  font-weight: 700;
  text-underline-offset: 0.2em;
}

.form-alert {
  margin: 1.75rem 0 0;
}

.form-alert p {
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.form-note {
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--abendlicht);
  background: var(--alu);
}

.form-note p {
  margin: 0 0 0.5rem;
}

/* Live-Region: muss auch leer im Accessibility-Tree bleiben, sonst sagen Screenreader Änderungen nicht an.
   Deshalb kein display:none und kein visibility:hidden, nur ohne Abstand. */
.turnstile-status:empty {
  margin: 0;
}

.turnstile-status {
  margin: 0.5rem 0 0;
  font-weight: 700;
}

.form-turnstile .form-note {
  margin-top: 0.75rem;
}

/* Honeypot: für Menschen unsichtbar, für Bots ein normales Feld. Nicht display:none. */
.form-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-privacy {
  max-width: 38em;
}

.form-privacy a {
  color: inherit;
}

/* ---------- Absenden: wie .btn .btn-primary aus base.css ---------- */

.inquiry-form .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--wiese);
  border-radius: 2px;
  background: var(--wiese);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (min-width: 36rem) {
  .inquiry-form .button {
    width: auto;
    min-width: 14rem;
  }
}

.inquiry-form .button:hover {
  background: var(--wiese-hell);
  border-color: var(--wiese-hell);
}

.inquiry-form .button:focus-visible {
  outline-offset: 3px;
}

.inquiry-form .button[aria-disabled='true'] {
  opacity: 0.7;
  cursor: progress;
}

/* ---------- Dankeseite ---------- */

.thanks-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.thanks-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--graphit);
  border-radius: 2px;
  font-weight: 700;
  text-decoration: none;
}

.thanks-links a:hover {
  background: var(--alu);
}

.thanks-links li:first-child a {
  background: var(--wiese);
  border-color: var(--wiese);
  color: #ffffff;
}

.thanks-links li:first-child a:hover {
  background: var(--wiese-hell);
  border-color: var(--wiese-hell);
}

/* ---------- Rechtstexte aus dem CMS ---------- */

.rich-text {
  max-width: 68ch;
  overflow-wrap: break-word;
  hyphens: auto;
}

.rich-text > :first-child {
  margin-top: 0;
}

.rich-text p,
.rich-text ul,
.rich-text ol {
  margin: 0 0 1rem;
}

.rich-text ul,
.rich-text ol {
  padding-left: 1.25rem;
}

.rich-text li + li {
  margin-top: 0.25rem;
}

.rich-text h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  line-height: 1.1;
}

.rich-text h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.3125rem;
  line-height: 1.15;
}

.rich-text h4 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.rich-text a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.rich-text a:hover {
  text-decoration-thickness: 2px;
}

.rich-text strong,
.rich-text b {
  font-weight: 700;
}

.rich-text blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--line);
  color: var(--stein);
}

.rich-text hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Breite Tabellen scrollen in sich, nicht die ganze Seite. */
.rich-text table {
  display: block;
  max-width: 100%;
  margin: 0 0 1rem;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.rich-text th,
.rich-text td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.rich-text th {
  background: var(--alu);
  font-weight: 700;
}

/* ---------- 404 ---------- */

.not-found {
  display: grid;
  gap: 1.5rem;
  max-width: 60rem;
  padding-top: clamp(2rem, 6vw, 4.5rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

.not-found-illustration {
  order: -1;
  width: min(100%, 15rem);
  height: auto;
  mix-blend-mode: multiply;
}

.not-found-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.not-found-text > .not-found-home {
  margin: 1.25rem 0 0;
  font-size: 1rem;
}

.not-found-home a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 700;
  text-underline-offset: 0.2em;
}

@media (min-width: 48rem) {
  .not-found {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    column-gap: 3rem;
  }

  .not-found-illustration {
    order: 0;
    width: 100%;
    max-width: 26rem;
    justify-self: end;
  }
}

/* Impressum: fester Vermerk des Erstellers unter dem Text vom Rechtstexte-Dienst */
.legal-credit {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}
