/* Inter wird lokal ausgeliefert — keine Anfrage an fremde Server. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("schrift/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("schrift/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Farb- und Formwerte aus dem PrimeNG-Aura-Thema (Slate), Grün bleibt unseres. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --feld-rand: #cbd5e1;
  --feld-rand-hover: #94a3b8;
  --hover-bg: #f1f5f9;
  --text: #334155;
  --text-stark: #1e293b;
  --muted: #64748b;
  --radius: 8px;
  --radius-klein: 6px;
  --primary: #1f6f4a;
  --primary-hover: #19583b;
  --primary-contrast: #ffffff;
  --warning-bg: #fff4e5;
  --warning-border: #f0b94d;
  --focus: #1f6f4a;
  --feld-schatten: 0 1px 2px 0 rgba(18, 18, 23, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--primary); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar .brand { font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.brand-logo { height: 22px; width: auto; vertical-align: middle; }

.topbar nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

/* Schmales Fenster: Navigation unter den Namen statt daneben abschneiden. */
@media (max-width: 720px) {
  .topbar { gap: 0.5rem 1rem; padding: 0.75rem 1rem; }
  .topbar .brand { flex: 1 0 100%; }
}
.topbar nav a { text-decoration: none; color: var(--text); padding: 0.25rem 0; }
.topbar nav a:hover, .topbar nav a:focus-visible { color: var(--primary); }

.abmelden-form { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.who { color: var(--muted); font-size: 0.9rem; }

main { max-width: 1040px; margin: 0 auto; padding: 2rem 1.5rem; }
main.ohne-kopf { padding-top: 4rem; }

/* Anmeldung: Foto links, weiße Spalte rechts — 60 zu 40. */
main.anmeldeseite { max-width: none; margin: 0; padding: 0; }

.anmeldung-split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  min-height: 100vh;
}

.anmeldung-bild {
  background-image: url("img/anmeldung.jpg");
  background-size: cover;
  background-position: center;
  background-color: #d9d5d0;
}

.anmeldung-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 2rem 1.75rem;
}
.anmeldung-inhalt { width: 100%; max-width: 340px; }

.anmeldung-logo {
  display: block;
  height: 38px;
  width: auto;
  margin: 0 auto 1rem;
}

/* Maße von review.rehathleticum.cloud: eine Zeile, mit dem Fenster mitwachsend. */
.produktname {
  font-size: clamp(1.1rem, 4.4vw, 1.45rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.25;
  white-space: nowrap;
  text-align: center;
  margin: 0 0 1.75rem;
}

.anmeldung-inhalt .lead { margin: -0.75rem 0 1.5rem; font-size: 0.875rem; text-align: center; }
.anmeldung-inhalt .hinweis { margin: 1rem 0 0; text-align: center; }
.anmeldung-inhalt .flash { margin-bottom: 1.25rem; }

button.breit {
  width: 100%;
  border-radius: var(--radius);
  padding: 0.3125rem 0.625rem;
  min-height: 32px;
  font-size: 0.875rem;
  font-weight: 500;
}

.anmeldeform { margin-top: 0.5rem; }
.anmeldeform .field { margin-bottom: 0.6rem; }
/* Höhere Gewichtung als die allgemeine Feldregel weiter unten. */
.anmeldung-inhalt .field input[type="email"],
.anmeldung-inhalt .field input[type="text"] { width: 100%; font-size: 0.875rem; }

/* Schmales Fenster: das Foto tritt zurück, die Anmeldung bekommt die Fläche. */
@media (max-width: 860px) {
  .anmeldung-split { grid-template-columns: 1fr; }
  .anmeldung-bild { display: none; }
  .anmeldung-panel { align-items: flex-start; padding-top: 4rem; }
  .anmeldung-inhalt { max-width: 340px; }
}

.codefeld {
  font-size: 1.75rem;
  letter-spacing: 0.35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 0.6rem 0.5rem !important;
}

h1 {
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}
h2 { font-size: 1.05rem; font-weight: 500; margin: 1.5rem 0 0.75rem; }
.card h2:first-of-type { margin-top: 0; }

.lead { color: var(--muted); margin-top: -0.25rem; }

button, input[type="submit"] {
  background: var(--primary);
  color: var(--primary-contrast);
  border: 1px solid var(--primary);
  border-radius: var(--radius-klein);
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}
button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

button.sekundaer {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--feld-rand);
}
button.sekundaer:hover { background: var(--hover-bg); border-color: var(--feld-rand-hover); color: var(--text-stark); }

button.entfernen {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--feld-rand);
  padding: 0.25rem 0.6rem;
  font-size: 0.875rem;
}
button.entfernen:hover { color: #b3261e; border-color: #b3261e; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1.5rem;
}

.rechner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

/* Schritt 1 und 2 untereinander, das Ergebnis bleibt daneben in Sichtweite. */
.spalte { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }

@media (max-width: 860px) {
  .rechner { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field label { font-weight: 500; font-size: 0.9rem; }
.field input[type="text"], .field input[type="number"], .field input[type="email"],
.field select, .suche input[type="search"], .anzahl-feld, .inline-form input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--feld-rand);
  border-radius: var(--radius-klein);
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--feld-schatten);
  max-width: 100%;
}
.field input:hover, .field select:hover, .suche input:hover,
.anzahl-feld:hover, .inline-form input:hover { border-color: var(--feld-rand-hover); }
.field input:focus, .field select:focus, .suche input:focus,
.anzahl-feld:focus, .inline-form input:focus { border-color: var(--primary); }
::placeholder { color: var(--muted); }

.zeile { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.zeile .field { margin-bottom: 0; }
.zeile button { margin-bottom: 0; }
.field-breit { flex: 1 1 320px; min-width: 0; }
.field-schmal { width: 6.5rem; flex: 0 0 auto; }

fieldset.vertrag {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
}
fieldset.vertrag legend { font-weight: 500; font-size: 0.9rem; padding: 0 0.35rem; }
.radio { display: inline-flex; align-items: center; gap: 0.4rem; margin-right: 1.25rem; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); }
th { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.rechts { text-align: right; }

.gewaehlt { margin-top: 0.25rem; }
.gewaehlt tbody:empty { display: none; }
.anzahl-feld { width: 3.75rem; padding: 0.35rem 0.5rem; text-align: right; }

h3 { font-size: 0.85rem; font-weight: 500; margin: 1.5rem 0 0.6rem; color: var(--muted); }

.knopfreihe { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.schnellknopf {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  line-height: 1.2;
}
.schnellknopf:hover { border-color: var(--primary); background: #f2f8f5; }
.schnell-kuerzel { font-weight: 500; }
.schnell-preis { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.suche { margin-top: 1.25rem; }
.suche input[type="search"] { width: 100%; }
#treffer-anzahl { margin: 0.5rem 0 0.35rem; }

.treffer {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.treffer:empty { display: none; }

.treffer-zeile {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.95rem;
}
.treffer-zeile:last-child { border-bottom: none; }
.treffer-zeile:hover, .treffer-zeile.aktiv { background: #f2f8f5; }
.treffer-nummer { color: var(--muted); font-variant-numeric: tabular-nums; }
.treffer-preis { font-variant-numeric: tabular-nums; white-space: nowrap; }

.liste {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.liste th { background: #fafafa; letter-spacing: 0.02em; }

.hinweis { color: var(--muted); font-size: 0.875rem; }

.ergebnis { position: sticky; top: 1.5rem; }
.betragslabel { color: var(--muted); font-size: 0.9rem; margin: 0.75rem 0 0; }
.betrag {
  font-size: 2.75rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0.1rem 0 1rem;
  line-height: 1.1;
}
.betrag .waehrung { font-size: 1.5rem; font-weight: 500; }

.aufstellung {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  margin: 0 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}
.aufstellung dt { color: var(--muted); }
.aufstellung dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.posten {
  list-style: none;
  margin: -0.75rem 0 1rem;
  padding: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.posten:empty { display: none; }
.posten li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.15rem 0 0.15rem 0.85rem;
  border-left: 2px solid var(--border);
}
.posten-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.posten-betrag { font-variant-numeric: tabular-nums; }

.warnung {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: #8a5a00;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
}

.kopieren { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.kopiert { color: var(--primary); font-size: 0.9rem; font-weight: 500; margin: 0.5rem 0 0; }

.reihenfolge { display: flex; gap: 0.3rem; }
.reihenfolge button { padding: 0.25rem 0.55rem; line-height: 1; }
.reihenfolge button:disabled { opacity: 0.35; cursor: not-allowed; }

.inline-form { display: flex; align-items: center; gap: 0.4rem; }
.inline-form input { width: 6rem; padding: 0.4rem 0.55rem; }
.inline-form button { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

.neu { margin-top: 1.5rem; }
.filter { margin-bottom: 1.25rem; }
.aktualisieren { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.flash {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 8px;
}

.quelle { color: var(--muted); font-size: 0.85rem; margin-top: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
