/* ImmosDirekt: gemeinsames Stylesheet für Formulare, Widerruf und Datenschutz.
   Farben aus der bestehenden Seite: Braun #993300 (Links), Blau #3366CC,
   Gelb #FFFF00 (Hervorhebungen) und der hellblaue Streifen blegtext.gif.
   Schrift wie auf der Startseite: Trebuchet MS, keine fremden Schriften. */

:root {
  --text: oklch(0.24 0.012 262);
  --text-leise: oklch(0.43 0.012 262);
  --braun: oklch(0.466 0.145 40.2); /* #993300 */
  --braun-dunkel: oklch(0.39 0.125 40.2);
  --braun-hell: oklch(0.955 0.03 52);
  --blau: oklch(0.532 0.168 262.3); /* #3366CC */
  --blau-hell: oklch(0.977 0.011 249); /* Ton des Streifens, aufgehellt */
  --rand: oklch(0.87 0.022 249);
  --rand-feld: oklch(0.7 0.02 255);
  --gelb: oklch(0.968 0.211 109.8); /* #FFFF00 */
  --weiss: oklch(1 0 0);
  --fehler: oklch(0.5 0.19 27);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--weiss) url("blegtext.gif") repeat-y left top;
  color: var(--text);
  font: 1rem/1.55 "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif;
}

a {
  color: var(--braun);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--braun-dunkel);
}

a[href^="tel:"] {
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--braun);
  outline-offset: 2px;
}

mark {
  background: var(--gelb);
  color: inherit;
  padding: 0 0.15em;
}

.seite {
  max-width: 58rem;
  padding: 1.25rem 1rem 2rem;
}

@media (min-width: 48em) {
  .seite {
    padding: 1.75rem 2rem 3rem 7.5rem;
  }
}

/* Kopf: Name wie auf der Startseite, darunter seine Linkleiste */

.kopf {
  margin-bottom: 1.75rem;
}

.marke {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
}

.marke:hover {
  color: var(--text);
}

.marke-name {
  display: block;
  font-size: clamp(1.75rem, 1.5rem + 1vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
}

.marke-zusatz {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
}

.navi ul {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
}

.navi a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
}

.navi a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(transparent 62%, var(--gelb) 62%, var(--gelb) 92%, transparent 92%);
}

@media (max-width: 47.99em) {
  .navi ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-right: -1rem;
    padding-right: 1rem;
    scrollbar-width: thin;
  }

  .navi li {
    flex: none;
  }
}

/* Titel und Einleitung */

h1 {
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  line-height: 1.15;
  margin: 0 0 0.4rem;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.25;
  margin: 1.75rem 0 0.5rem;
}

.unterzeile {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.einleitung {
  max-width: 46rem;
  margin-bottom: 1.5rem;
}

.einleitung p {
  margin: 0 0 0.75rem;
}

.text {
  max-width: 46rem;
}

.pflicht-legende {
  font-size: 0.9375rem;
  color: var(--text-leise);
}

.pflicht {
  color: var(--braun);
}

/* Abschnitte mit großen blauen Ziffern, angelehnt an die Buchstaben der Startseite */

.abschnitt {
  min-width: 0;
  margin: 0 0 1.25rem;
  padding: 1rem 1rem 1.25rem;
  background: var(--blau-hell);
  border: 1px solid var(--rand);
  border-radius: 6px;
}

@media (min-width: 48em) {
  .abschnitt {
    padding: 1.25rem 1.5rem 1.5rem;
  }
}

.abschnitt > legend {
  float: left;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.abschnitt > legend + * {
  clear: both;
}

.nr {
  min-width: 1.3ch;
  color: var(--blau);
  font-size: 2.25rem;
  line-height: 1;
}

/* Felder */

.feld {
  margin: 0 0 1rem;
}

.feld:last-child {
  margin-bottom: 0;
}

.feld > label:not(.wahl),
.feld-titel {
  display: block;
  margin-top: 0;
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.hilfe {
  display: block;
  margin-top: 0.1rem;
  color: var(--text-leise);
  font-size: 0.9375rem;
  font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  background: var(--weiss);
  border: 1px solid var(--rand-feld);
  border-radius: 4px;
  color: inherit;
  font: inherit;
}

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

input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--braun);
  outline-offset: 1px;
  border-color: var(--braun);
}

input:user-invalid,
textarea:user-invalid {
  border-color: var(--fehler);
  box-shadow: inset 3px 0 0 var(--fehler);
}

.raster {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 40em) {
  .raster {
    grid-template-columns: 1fr 1fr;
  }

  .raster .breit {
    grid-column: 1 / -1;
  }
}

.plz-ort {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.75rem;
}

.mit-einheit {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mit-einheit input,
.schmal input {
  max-width: 13rem;
}

/* Zeilen mit Ankreuzfeldern (Fassade, Heizung, Fenster …) */

.zeile {
  display: grid;
  gap: 0.4rem 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rand);
}

.zeile:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.zeile-titel {
  font-weight: 700;
}

@media (min-width: 48em) {
  .zeile {
    grid-template-columns: 11rem 1fr;
    align-items: start;
  }

  .zeile-titel {
    padding-top: 0.6rem;
  }
}

.wahlen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.wahlen input[type="text"] {
  flex: 1 1 12rem;
  width: auto;
}

.wahl {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.35rem 0.8rem;
  background: var(--weiss);
  border: 1px solid var(--rand-feld);
  border-radius: 4px;
  cursor: pointer;
}

.wahl:hover {
  border-color: var(--braun);
}

.wahl:has(input:checked) {
  background: var(--braun-hell);
  border-color: var(--braun);
}

.wahl input,
.zelle-wahl input {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  flex: none;
  accent-color: var(--braun);
}

.wahl-fett {
  font-weight: 700;
}

/* Tabellen (Geschosse, Mieterträge, Sanitär, Fußböden).
   Breit: echte Tabelle. Schmal: jede Zeile wird eine Karte, die
   Spaltenköpfe stehen dann an jedem Feld. */

.matrix {
  margin: 0.25rem 0 0;
}

.matrix table {
  width: 100%;
  border-collapse: collapse;
}

.matrix th,
.matrix td {
  padding: 0.3rem;
  text-align: center;
  vertical-align: middle;
}

.matrix thead th {
  font-size: 0.9375rem;
  font-weight: 700;
}

.matrix tbody tr + tr {
  border-top: 1px solid var(--rand);
}

.matrix tbody th {
  padding-left: 0;
  text-align: left;
  font-weight: 700;
}

.matrix td input[type="text"] {
  min-width: 4rem;
}

.zelle-wahl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 4px;
  cursor: pointer;
}

.zelle-wahl:hover {
  background: var(--braun-hell);
}

.zelle-links {
  justify-content: flex-start;
}

.zelle-wahl:has(input:checked) {
  background: var(--braun-hell);
}

.m-kopf,
.unsichtbar {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 47.99em) {
  .matrix thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .matrix table,
  .matrix tbody {
    display: block;
  }

  .matrix tr {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.75rem, 1fr));
    gap: 0.5rem;
    padding: 0.75rem 0;
  }

  .matrix-zahlen tr {
    grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr));
  }

  .matrix tbody tr:first-child {
    padding-top: 0;
  }

  .matrix tbody th {
    grid-column: 1 / -1;
    padding: 0;
  }

  .matrix td {
    display: block;
    padding: 0;
    text-align: left;
  }

  .m-kopf {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.875rem;
  }

  .zelle-wahl {
    justify-content: flex-start;
    padding: 0.35rem 0.6rem;
    background: var(--weiss);
    border: 1px solid var(--rand-feld);
  }

  .zelle-wahl .m-kopf {
    display: inline;
    margin: 0;
    font-size: 1rem;
  }

  .zelle-wahl:has(input:checked) {
    border-color: var(--braun);
  }
}

/* Vereinbarung, Datenschutzhinweis, Knöpfe */

.raster + .vereinbarung {
  margin-top: 1rem;
}

.vereinbarung p {
  max-width: 46rem;
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
}

.bestaetigung {
  margin-top: 1rem;
}

.abschluss {
  margin: 1.5rem 0 0;
}

.datenschutz-hinweis {
  max-width: 46rem;
  margin: 0 0 1rem;
  color: var(--text-leise);
  font-size: 0.9375rem;
}

.knoepfe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.knopf {
  min-height: 48px;
  padding: 0.7rem 1.6rem;
  border: 2px solid var(--braun);
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.knopf-haupt {
  background: var(--braun);
  color: var(--weiss);
}

.knopf-haupt:hover {
  background: var(--braun-dunkel);
  border-color: var(--braun-dunkel);
}

.knopf-neben {
  background: var(--weiss);
  color: var(--braun);
}

.knopf-neben:hover {
  background: var(--braun-hell);
}

/* Druckformulare: Linien für Ort, Datum und Unterschrift */

.unterschrift {
  display: grid;
  gap: 1.75rem 2rem;
  margin: 2rem 0 1.5rem;
}

@media (min-width: 40em) {
  .unterschrift {
    grid-template-columns: 1fr 1.4fr;
  }
}

.unterschrift .linie {
  height: 2.75rem;
  border-bottom: 1px solid var(--text);
}

.unterschrift .unter {
  margin-top: 0.3rem;
  font-size: 0.875rem;
}

.nur-druck {
  display: none;
}

.kleingedruckt {
  max-width: 46rem;
  color: var(--text-leise);
  font-size: 0.875rem;
}

/* Kontakt und Impressum */

.abschnitt-titel {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.angaben {
  display: grid;
  gap: 0.2rem 1.5rem;
  margin: 0;
}

.angaben dt {
  font-weight: 700;
}

.angaben dd {
  margin: 0 0 0.6rem;
}

.angaben a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (min-width: 40em) {
  .angaben {
    grid-template-columns: 10rem 1fr;
    align-items: center;
    row-gap: 0.5rem;
  }

  .angaben dd:not(:has(a)) {
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .angaben dd {
    margin: 0;
  }

  .angaben dt:first-of-type {
    align-self: start;
  }
}

/* Fuß */

.fuss {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rand);
  font-size: 0.9375rem;
}

.fuss p {
  margin: 0.2rem 0;
}

/* Druck: ein sauberes A4-Blatt ohne Linkleiste und Knöpfe */

@media print {
  @page {
    size: A4;
    margin: 14mm 15mm;
  }

  body {
    background: none;
    font-size: 10pt;
  }

  .seite {
    max-width: none;
    padding: 0;
  }

  .navi,
  .knoepfe,
  .nur-bildschirm {
    display: none !important;
  }

  .nur-druck {
    display: grid;
  }

  .kopf {
    margin-bottom: 1rem;
  }

  .pflicht-legende,
  .datenschutz-hinweis {
    display: none;
  }

  .einleitung {
    margin-bottom: 0.75rem;
  }

  .abschnitt {
    margin: 0 0 0.5rem;
    padding: 0.4rem 0 0.5rem;
    background: none;
    border: 0;
    border-top: 1px solid var(--rand-feld);
    border-radius: 0;
  }

  .abschnitt > legend {
    margin-bottom: 0.4rem;
    break-after: avoid;
  }

  .nr {
    font-size: 1.5rem;
  }

  .feld {
    margin-bottom: 0.5rem;
  }

  .zeile {
    padding: 0.3rem 0;
    break-inside: avoid;
  }

  textarea {
    height: 4.5rem;
    min-height: 0;
  }

  .unterschrift {
    margin: 1.25rem 0 0.75rem;
  }

  .fuss {
    margin-top: 1rem;
    padding-top: 0.5rem;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  mark {
    background: none;
    font-weight: 700;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea {
    min-height: 0;
    padding: 0.15rem 0;
    border: 0;
    border-bottom: 1px solid var(--rand-feld);
    border-radius: 0;
  }

  .wahl,
  .zelle-wahl {
    min-height: 0;
    padding: 0.1rem 0.3rem 0.1rem 0;
    background: none;
    border: 0;
  }

  .matrix tr {
    break-inside: avoid;
  }

  .matrix th,
  .matrix td {
    padding: 0.1rem 0.3rem;
  }

  .zelle-wahl {
    min-height: 0;
  }
}
