/*
 * XTR3M Web – gemeinsames Design (KV-Rechner, Kundenportal, Partnerportal)
 * Schwarz/Weiß, Akzentgelb für Hauptknöpfe, Archivo/Archivo Black lokal eingebunden (kein CDN).
 * Mobil zuerst: Grundregeln gelten für Telefone, Erweiterungen per min-width.
 */

@font-face { font-family: 'Archivo'; src: url('schriften/archivo-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('schriften/archivo-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('schriften/archivo-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Archivo Black'; src: url('schriften/archivo-black-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --schwarz: #000;
  --g9: #1a1a18;
  --g7: #4a4a45;
  --g6: #5f5d57; /* gedämpfter Text, Kontrast 6,5:1 auf Weiß */
  --g3: #cfccc4; /* Rahmen von Eingabefeldern, 3:1 gegenüber Weiß reicht für Bedienelemente nicht allein – daher zusätzlich Beschriftung */
  --g2: #e8e6df;
  --g1: #f7f7f5;
  --sand: #f2f0e9;
  --weiss: #fff;
  --gelb: #efc12b;
  --gelb-dunkel: #d9ab12;
  --gelb-hell: #fcf1cc;
  --gruen: #2e7d4f;
  --gruen-dunkel: #1f5537;
  --gruen-hell: #e3f1e8;
  --rot: #b3261e;
  --rot-hell: #fbe9e7;
  --braun: #6b4a00;
  --auf-schwarz: #b9b7b0; /* gedämpfter Text auf Schwarz, Kontrast 9:1 */
  --linie-dunkel: #2c2c2a;

  --schrift: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --schrift-fett: 'Archivo Black', 'Archivo', Arial, sans-serif;
  --radius: 10px;
  --radius-gross: 14px;
  --abstand: 16px;
  --fokus: 3px solid var(--schwarz);
  --schatten: 0 1px 2px rgba(0, 0, 0, .06), 0 10px 30px rgba(0, 0, 0, .08);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.5;
  color: var(--g9);
  background: var(--weiss);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 12px; }
h1, h2, h3 { margin: 0; color: var(--schwarz); }

:focus-visible { outline: var(--fokus); outline-offset: 2px; }
.dunkel :focus-visible, .dunkel:focus-visible { outline-color: var(--gelb); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ───────── Seitenrahmen ───────── */
.kopf { border-bottom: 1px solid var(--g2); background: var(--weiss); }
.kopf-innen {
  max-width: 1120px; margin: 0 auto; padding: 12px var(--abstand);
  display: flex; align-items: center; gap: 16px; min-height: 60px;
}
.kopf-logo { height: 28px; width: auto; }
.kopf-titel { margin-left: auto; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--g6); }

.inhalt { max-width: 1120px; margin: 0 auto; padding: 24px var(--abstand) 48px; }
.eingebettet .inhalt { padding-top: 8px; padding-bottom: 16px; }

.fuss {
  max-width: 1120px; margin: 0 auto; padding: 20px var(--abstand) 32px;
  border-top: 1px solid var(--g2); display: flex; flex-wrap: wrap; gap: 8px 20px;
  font-size: 13px; color: var(--g6);
}
.fuss a { color: var(--g6); }
.fuss span { flex: 1 1 100%; }
@media (min-width: 640px) { .fuss span { flex: 0 1 auto; } .fuss .rechts { margin-left: auto; } }

.titel {
  font-family: var(--schrift-fett); font-weight: 400;
  font-size: clamp(27px, 7vw, 40px); line-height: 1.08; letter-spacing: -.3px;
  margin: 0 0 8px;
}
.titel:focus { outline: none; }
.untertitel { font-size: 16px; color: var(--g7); margin: 0 0 24px; max-width: 640px; }
.ueberschrift { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.marke {
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--g6);
}
.dunkel .marke { color: var(--auf-schwarz); }
.klein { font-size: 13.5px; color: var(--g6); }
.dunkel .klein { color: var(--auf-schwarz); }

/* ───────── Karten und Abschnitte ───────── */
.karte {
  background: var(--weiss); border: 1px solid var(--g2); border-radius: var(--radius-gross);
  padding: 18px var(--abstand); margin: 0 0 14px;
}
.karte.dunkel, .dunkel.karte { background: var(--schwarz); border-color: var(--schwarz); color: var(--weiss); }
.dunkel h2, .dunkel h3, .dunkel .betrag-gross { color: var(--weiss); }

.abschnitt { border: 1px solid var(--g2); border-radius: var(--radius-gross); padding: 18px var(--abstand) 20px; margin: 0 0 14px; min-width: 0; }
.abschnitt > legend, .abschnitt-kopf {
  display: flex; align-items: center; gap: 10px; float: left; width: 100%;
  font-size: 17px; font-weight: 700; color: var(--schwarz); padding: 0; margin: 0 0 14px;
}
.abschnitt > legend + * { clear: left; }
.abschnitt > legend > h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin: 0; color: inherit; }
.nummer {
  flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--schwarz); color: var(--weiss);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.optional-hinweis { font-weight: 500; font-size: 13.5px; color: var(--g6); }

/* ───────── Formularfelder ───────── */
.frage { display: block; font-size: 14px; font-weight: 700; color: var(--g7); margin: 18px 0 8px; }
.frage:first-child, legend + .frage { margin-top: 0; }
fieldset.gruppe { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
legend + fieldset.gruppe, fieldset.gruppe:first-child { margin-top: 0; }
fieldset.gruppe > legend { font-size: 14px; font-weight: 700; color: var(--g7); padding: 0; margin: 0 0 8px; }

.felder { display: grid; grid-template-columns: 1fr; gap: 14px; }
.feld { display: flex; flex-direction: column; min-width: 0; }
.feld > label, .feld > .label { font-size: 14px; font-weight: 700; color: var(--g7); margin-bottom: 6px; }
.feld .pflicht { color: var(--rot); font-weight: 700; }
.eingabe, .feld input:not([type=checkbox]):not([type=radio]):not([type=file]), .feld select, .feld textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font-size: 16px;
  border: 1.5px solid var(--g3); border-radius: 8px; background: var(--weiss); color: var(--g9);
  transition: border-color .15s;
}
.feld textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.feld select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--g7) 50%), linear-gradient(135deg, var(--g7) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.feld input:hover, .feld select:hover, .feld textarea:hover { border-color: var(--g7); }
.feld input:focus-visible, .feld select:focus-visible, .feld textarea:focus-visible { outline: var(--fokus); outline-offset: 1px; border-color: var(--schwarz); }
.feld [aria-invalid=true] { border-color: var(--rot) !important; background: var(--rot-hell) !important; }
.feld-hilfe { font-size: 13px; color: var(--g6); margin-top: 6px; }
.feld-fehler, .fehlertext {
  display: flex; gap: 6px; align-items: flex-start; font-size: 14px; font-weight: 500; color: var(--rot); margin-top: 6px;
}
.feld-fehler::before, .fehlertext::before {
  content: '!'; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--rot); color: var(--weiss);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.dunkel .feld-fehler, .dunkel .fehlertext { color: #ffb4a9; }

/* Auswahl als Chips: echte Radio-Buttons, nur optisch als Knöpfe */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 6px 14px;
  border: 1.5px solid var(--g3); border-radius: 8px; background: var(--weiss);
  font-size: 15px; font-weight: 500; line-height: 1.2; color: var(--g9); transition: background .12s, border-color .12s;
}
.chip span small { font-size: 12px; font-weight: 400; color: var(--g6); margin-top: 2px; }
.chip input:hover + span { border-color: var(--g7); }
.chip input:checked + span { background: var(--schwarz); border-color: var(--schwarz); color: var(--weiss); }
.chip input:checked + span small { color: var(--auf-schwarz); }
.chip input:focus-visible + span { outline: var(--fokus); outline-offset: 2px; }
.chip input:disabled { cursor: not-allowed; }
.chip input:disabled + span { opacity: .45; text-decoration: line-through; }
.chips.breit .chip { flex: 1 1 140px; }
.chips.breit .chip span { width: 100%; }

/* Ankreuzfeld */
.ankreuzen { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; cursor: pointer; }
.ankreuzen input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--schwarz); cursor: pointer; }
.dunkel .ankreuzen input { accent-color: var(--gelb); }
.ankreuzen a { font-weight: 700; }
.feld > label.ankreuzen { font-size: 14.5px; font-weight: 400; color: var(--g9); margin: 0; }
.dunkel .feld > label.ankreuzen { color: var(--weiss); }

/* Zähler (− 2 +) */
.zaehler { display: inline-flex; align-items: stretch; border: 1.5px solid var(--g3); border-radius: 8px; overflow: hidden; background: var(--weiss); }
.zaehler button { width: 46px; min-height: 44px; border: 0; background: var(--weiss); font-size: 22px; line-height: 1; color: var(--schwarz); }
.zaehler button:hover { background: var(--g1); }
.zaehler button:disabled { color: var(--g3); cursor: default; background: var(--weiss); }
.zaehler input { width: 52px; border: 0; border-left: 1px solid var(--g2); border-right: 1px solid var(--g2); text-align: center; font-size: 17px; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.zaehler input::-webkit-outer-spin-button, .zaehler input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.zaehler:focus-within { outline: var(--fokus); outline-offset: 2px; }
.zaehler :focus-visible { outline: none; background: var(--gelb-hell); }

/* Honeypot: für Menschen und Screenreader unsichtbar, für einfache Bots ein normales Feld */
.hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ───────── Knöpfe ───────── */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--radius);
  border: 1.5px solid var(--g3); background: var(--weiss); color: var(--schwarz);
  font-size: 15.5px; font-weight: 700; text-decoration: none; text-align: center; line-height: 1.2;
  transition: background .15s, border-color .15s, transform .05s;
}
.knopf:hover { border-color: var(--schwarz); text-decoration: none; }
.knopf:active { transform: translateY(1px); }
.knopf.voll { width: 100%; }
.knopf.gross { min-height: 54px; font-size: 16.5px; }
.knopf.klein { min-height: 40px; padding: 0 14px; font-size: 14px; }
.knopf-gelb { background: var(--gelb); border-color: var(--gelb); color: var(--schwarz); }
.knopf-gelb:hover { background: var(--gelb-dunkel); border-color: var(--gelb-dunkel); }
.knopf-schwarz { background: var(--schwarz); border-color: var(--schwarz); color: var(--weiss); }
.knopf-schwarz:hover { background: var(--g9); }
.dunkel .knopf-rand { background: transparent; color: var(--weiss); border-color: #5a5a55; }
.dunkel .knopf-rand:hover { border-color: var(--weiss); }
.knopf-text { border: 0; background: none; padding: 0 4px; min-height: 40px; color: var(--g7); text-decoration: underline; font-weight: 700; }
.knopf-text:hover { color: var(--schwarz); }
.knopf[disabled], .knopf[aria-disabled=true] { background: var(--g2); border-color: var(--g2); color: var(--g6); cursor: not-allowed; transform: none; }
.dunkel .knopf[disabled] { background: #3a3a38; border-color: #3a3a38; color: var(--auf-schwarz); }
.knopf[aria-busy=true] { cursor: progress; }
.knopf .kreisel, .kreisel {
  width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent;
  animation: drehen .8s linear infinite; flex: none;
}
@keyframes drehen { to { transform: rotate(360deg); } }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; }

/* ───────── Hinweise ───────── */
.hinweis {
  display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius-gross);
  padding: 14px var(--abstand); margin: 0 0 14px; font-size: 15px; background: var(--sand); color: var(--g9);
}
.hinweis > .symbol { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--g7); color: var(--weiss); font-weight: 700; font-size: 14px; }
.hinweis > div { min-width: 0; }
.hinweis b, .hinweis strong { display: block; font-size: 16px; margin-bottom: 2px; }
.hinweis p:last-child { margin-bottom: 0; }
.hinweis.erfolg { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.hinweis.erfolg > .symbol { background: var(--gruen); }
.hinweis.fehler { background: var(--rot-hell); color: #7a1a14; }
.hinweis.fehler > .symbol { background: var(--rot); }
.hinweis.warnung { background: var(--gelb-hell); color: #4d3700; }
.hinweis.warnung > .symbol { background: var(--braun); }
.hinweis ul { margin: 6px 0 0; padding-left: 18px; }
.hinweis a { font-weight: 700; }

.pille {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px; border-radius: 13px;
  font-size: 12.5px; font-weight: 700; background: var(--g2); color: var(--g7); white-space: nowrap;
}
.pille.gruen { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.pille.gelb { background: var(--gelb-hell); color: #5c4400; }
.pille.rot { background: var(--rot-hell); color: #7a1a14; }
.pille.schwarz { background: var(--schwarz); color: var(--weiss); }

.attrappe-band {
  background: repeating-linear-gradient(-45deg, var(--gelb), var(--gelb) 12px, #f5d36a 12px, #f5d36a 24px);
  color: var(--schwarz); text-align: center; font-size: 13px; font-weight: 700; padding: 6px var(--abstand);
}

/* ───────── Tabellen (KV, Angebot, Partnerpaket) ───────── */
.tabelle { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabelle caption { text-align: left; }
.tabelle th, .tabelle td { padding: 10px 0; border-top: 1px solid var(--g2); text-align: left; vertical-align: top; }
.tabelle thead th { border-top: 0; font-size: 11.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--g6); padding-top: 0; }
.tabelle .zahl { text-align: right; white-space: nowrap; padding-left: 14px; font-variant-numeric: tabular-nums; }
.tabelle .fett, .tabelle tr.summe td, .tabelle tr.summe th { font-weight: 700; }
.tabelle tr.summe th, .tabelle tr.summe td { border-top: 2px solid var(--schwarz); }
.tabelle .detail { display: block; font-size: 13px; color: var(--g6); margin-top: 2px; }
.dunkel .tabelle th, .dunkel .tabelle td { border-top-color: var(--linie-dunkel); }
.dunkel .tabelle .detail { color: var(--auf-schwarz); }

.betrag-gross { font-family: var(--schrift-fett); font-size: 34px; line-height: 1.1; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }

/* ───────── Termin-Auswahl ───────── */
.tage { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin: 0 -2px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.tage .chip { flex: none; scroll-snap-align: start; }
.tage .chip span { align-items: center; min-width: 74px; padding: 8px 10px; }
.tage .chip span b { font-size: 15px; }
.zeiten { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 6px; }
.zeiten .chip span { width: 100%; align-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.terminart { margin-top: 14px; }

/* ───────── Ladezustand / Seitenmeldung ───────── */
.laden { display: flex; align-items: center; gap: 12px; padding: 40px 0; color: var(--g6); font-size: 15px; }
.seitenmeldung { max-width: 620px; margin: 24px auto; text-align: left; }
.seitenmeldung .titel { font-size: clamp(24px, 6vw, 34px); }

/* ───────── größere Bildschirme ───────── */
@media (min-width: 640px) {
  :root { --abstand: 24px; }
  .felder.zwei { grid-template-columns: 1fr 1fr; }
  .felder .ganz { grid-column: 1 / -1; }
  .abschnitt { padding: 22px 24px 24px; }
}

@media print {
  .kopf, .fuss, .knopf, .attrappe-band { display: none !important; }
  .karte { break-inside: avoid; }
}
