/*
 * Layout und Komponenten der Webseite.
 * Farben ausschließlich aus brand.css (CSS-Variablen) → hell/dunkel automatisch
 * über prefers-color-scheme. Systemschriften, damit keine Schrift von Dritten geladen wird.
 */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; padding-block: 2rem 3rem; }

.wrap { width: 100%; max-width: 64rem; margin-inline: auto; padding-inline: 1rem; }

a { color: var(--brand); text-underline-offset: 0.15em; }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; color: var(--heading); letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 0.75rem; }
h2 { font-size: 1.4rem; margin-top: 2.25rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; }

code, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: 0.5rem 1rem; z-index: 10; }

/* Kopf */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.header-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding-block: 0.75rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; font-size: 1.15rem; }
.brand strong { color: var(--brand); }
.brand img { border-radius: 8px; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--muted); text-decoration: none; padding: 0.25rem 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--brand); }
nav { margin-left: auto; }

@media (max-width: 40rem) {
  nav { order: 3; width: 100%; margin-left: 0; }
  .header-inner > .btn { margin-left: auto; }
}

/* Fuß */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 0.92rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 1.25rem; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--brand);
  color: var(--on-brand);
  text-decoration: none;
  font-weight: 600;
  padding: 0.7rem 1.3rem;
  border-radius: 8px;
  border: 2px solid var(--brand);
}
.btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); }
.btn-outline { background: transparent; color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); color: var(--brand-strong); }
.btn-small { padding: 0.35rem 0.9rem; font-size: 0.95rem; }
/* Haupt-Aktion wie auf himmelfreund.de: Orange mit Navy-Schrift */
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { filter: brightness(1.06); background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* Header-Knopf in Navy (wie „Kundenbereich“ auf himmelfreund.de) */
.header-inner > .btn { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
@media (prefers-color-scheme: dark) {
  .header-inner > .btn { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Startseite */
.hero {
  background: var(--brand-soft);
  border-radius: 20px;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  margin-top: 0.5rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); max-width: 40rem; }
.hero .lead { font-size: 1.15rem; max-width: 42rem; margin-bottom: 0; }
.kicker { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.82rem; font-weight: 700; color: var(--brand); margin: 0 0 0.5rem; }

.section { margin-top: 3.5rem; }
.section > h2 { margin-top: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.section-lead { color: var(--muted); max-width: 44rem; }

/* Symbol in Karten (Inline-SVG, Farbe über currentColor) */
.icon { width: 2.4rem; height: 2.4rem; border-radius: 10px; display: grid; place-items: center;
        background: var(--brand-soft); color: var(--brand); margin-bottom: 0.75rem; }
.icon svg { width: 1.35rem; height: 1.35rem; }

/* Hervorgehobener Abschnitt MCP: Text + kleine Grafik (rein CSS, kein Bild) */
.feature-mcp {
  display: grid; gap: 2rem; align-items: center;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  border: 2px solid var(--brand); border-radius: 20px; padding: clamp(1.5rem, 4vw, 2.5rem);
}
.feature-mcp h2 { margin-top: 0; }
.feature-visual { display: flex; flex-direction: column; align-items: center; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 0.5rem 1.1rem; font-weight: 600; color: var(--heading); }
.chip-brand { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.link-line { width: 2px; height: 1.75rem; background: repeating-linear-gradient(var(--brand) 0 4px, transparent 4px 8px); }
@media (max-width: 48rem) { .feature-mcp { grid-template-columns: 1fr; } }

/* Vergleichstabelle (Seite „Warum“): Häkchen bzw. Strich vor dem Text */
table.compare td.yes::before { content: "✓ "; color: var(--ok); font-weight: 700; }
table.compare td.no { color: var(--muted); }
table.compare td.no::before { content: "– "; }
table.compare th:nth-child(2) { color: var(--brand); }
@media (max-width: 40rem) {
  table.compare td.yes::before { content: attr(data-label) ": ✓ "; }
  table.compare td.no::before { content: attr(data-label) ": "; }
}

/* Fakten-Karten mit Listen */
.facts .card ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.facts .card li { margin-bottom: 0.3rem; }
.about { grid-template-columns: 1fr; border-width: 1px; border-color: var(--border); }
.about h3 { margin-top: 0; }

/* Funktionsliste (Seite E-Mail): Begriff + Erklärung, zweispaltig ab Tablet */
.feature-list { display: grid; gap: 1.25rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); margin: 1.5rem 0 0; }
.feature-list > div { border-top: 2px solid var(--brand-soft); padding-top: 0.85rem; }
.feature-list dt { font-weight: 700; color: var(--heading); margin-bottom: 0.25rem; }
.feature-list dt::after { content: " ›"; color: var(--brand); }
.feature-list dd { margin: 0; color: var(--muted); }

/* Reiter ohne JavaScript (Pakete: Privat | Business | Kirche)
   Versteckte Radio-Knöpfe steuern, welches Feld sichtbar ist. Regeln für bis zu 5 Reiter –
   MAX_REITER in build.py muss dazu passen. Pfeiltasten wechseln den Reiter (Radio-Verhalten). */
.tab-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tab-labels { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.3rem; margin-top: 1rem;
              background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.tab-labels label { cursor: pointer; padding: 0.45rem 1.2rem; border-radius: 999px; font-weight: 600;
                    color: var(--muted); border: 1px solid transparent; }
.tab-labels label:hover { color: var(--heading); }
.tab-panel { display: none; }
.tab-panel .plan-group { position: absolute; left: -9999px; }  /* Überschrift nur für Screenreader/ohne CSS */
#reiter-0:checked ~ .tab-panel-0 { display: block; }
#reiter-0:checked ~ .tab-labels label[for="reiter-0"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
#reiter-0:focus-visible ~ .tab-labels label[for="reiter-0"] { outline: 3px solid var(--brand); outline-offset: 2px; }
#reiter-1:checked ~ .tab-panel-1 { display: block; }
#reiter-1:checked ~ .tab-labels label[for="reiter-1"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
#reiter-1:focus-visible ~ .tab-labels label[for="reiter-1"] { outline: 3px solid var(--brand); outline-offset: 2px; }
#reiter-2:checked ~ .tab-panel-2 { display: block; }
#reiter-2:checked ~ .tab-labels label[for="reiter-2"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
#reiter-2:focus-visible ~ .tab-labels label[for="reiter-2"] { outline: 3px solid var(--brand); outline-offset: 2px; }
#reiter-3:checked ~ .tab-panel-3 { display: block; }
#reiter-3:checked ~ .tab-labels label[for="reiter-3"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
#reiter-3:focus-visible ~ .tab-labels label[for="reiter-3"] { outline: 3px solid var(--brand); outline-offset: 2px; }
#reiter-4:checked ~ .tab-panel-4 { display: block; }
#reiter-4:checked ~ .tab-labels label[for="reiter-4"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
#reiter-4:focus-visible ~ .tab-labels label[for="reiter-4"] { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Pakete */
.plans { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-top: 1.5rem; }
.plan { border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; background: var(--bg); display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--brand); }
.plan h3, .plan h4 { margin: 0; font-size: 1.15rem; color: var(--heading); }
.price { font-size: 2rem; font-weight: 700; color: var(--heading); margin: 0.5rem 0 0; }
.price small { display: block; font-size: 0.92rem; font-weight: 400; color: var(--muted); margin-top: 0.15rem; }
.plan ul { padding-left: 1.2rem; margin: 1rem 0 1.5rem; flex: 1; }
.plan li { margin-bottom: 0.35rem; }
.plan-group { margin: 2.25rem 0 0; font-size: 1.3rem; }
.price-detail { margin: 0.2rem 0 0; font-size: 0.88rem; color: var(--muted); }
.price-note { color: var(--muted); font-size: 0.92rem; margin-top: 1rem; }

/* Abschluss-Band „Startklar?“ */
.cta-band {
  margin-top: 3.5rem;
  background: var(--brand-strong);
  color: #e9edf5;
  border-radius: 20px;
  padding: clamp(1.5rem, 5vw, 3rem);
}
.cta-band h2 { color: #fff; margin-top: 0; }
.cta-band a:not(.btn) { color: #fff; }
.cta-band .btn-outline { color: #fff; border-color: #fff; }
.cta-band .btn-outline:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
@media (prefers-color-scheme: dark) {
  .cta-band { background: var(--brand-soft); border: 1px solid var(--border); }
}

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-top: 1.5rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}
.card h2, .card h3 { margin-top: 0; font-size: 1.1rem; }
.card p { margin-bottom: 0; color: var(--muted); }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--brand); }
a.card h3 { color: var(--brand); }

/* Hinweis- und Platzhalterkästen */
.note, .placeholder {
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  margin-block: 1.25rem;
}
.placeholder { border-left-color: var(--warn); }
.note > :first-child, .placeholder > :first-child { margin-top: 0; }
.note > :last-child, .placeholder > :last-child { margin-bottom: 0; }

/* Tabellen (Serverdaten) – auf schmalen Bildschirmen horizontal scrollbar */
.table-wrap { overflow-x: auto; margin-block: 1rem; }
table { border-collapse: collapse; width: 100%; min-width: 28rem; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface); font-weight: 600; }
/* Servernamen in Tabellen nicht mitten im Wort umbrechen; die Tabelle scrollt stattdessen. */
td code { white-space: nowrap; overflow-wrap: normal; }

/* Schmale Bildschirme: Tabellenzeilen als Karten, Spaltenname aus data-label (setzt build.py) */
@media (max-width: 40rem) {
  table { min-width: 0; }
  thead { position: absolute; left: -9999px; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.75rem; padding: 0.35rem 0; }
  td { border: 0; padding: 0.25rem 0.85rem; }
  td::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.9rem; }
  td:first-child { font-weight: 600; }
  td:first-child::before { content: none; }
  td code { white-space: normal; overflow-wrap: anywhere; }
}

/* Anleitungsschritte */
ol.steps { padding-left: 1.4rem; }
ol.steps > li { margin-bottom: 0.6rem; padding-left: 0.25rem; }

/* FAQ */
details { border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 1rem; margin-block: 0.6rem; background: var(--bg); }
details[open] { background: var(--surface); }
summary { cursor: pointer; font-weight: 600; }
details > :not(summary) { margin-bottom: 0.25rem; }

/* Status */
.status-list { list-style: none; padding: 0; }
.status-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.badge { font-weight: 600; white-space: nowrap; }
.badge-ok { color: var(--ok); }
.badge-unknown { color: var(--muted); }

.breadcrumb { font-size: 0.92rem; color: var(--muted); margin-bottom: 0.5rem; }
.breadcrumb a { color: var(--muted); }

/* ---------------------------------------------------------------------------
   Vorab-Version (build.py): Hinweisleiste und „bald verfügbar“
   Hinweisleiste erscheint, solange die Pakete nicht freigegeben sind; „bald verfügbar“
   ersetzt Links auf Dienste, die noch nicht laufen (BALD_VERFUEGBAR in build.py).
   --------------------------------------------------------------------------- */
.vorab { background: var(--brand-soft); border-bottom: 1px solid var(--line, rgba(0, 0, 0, 0.08)); }
.vorab p { margin: 0; padding: 0.6rem 0; font-size: 0.95rem; }
.soon {
  display: inline-block; margin-left: 0.25em; padding: 0.05em 0.5em; border-radius: 999px;
  font-size: 0.75em; font-weight: 600; vertical-align: middle; white-space: nowrap;
  background: var(--brand-soft); color: var(--brand-strong);
}
.btn-soon { opacity: 0.6; cursor: default; pointer-events: none; }
.btn-soon small { font-weight: 400; }
/* Auf dem Handy den deaktivierten Webmail-Knopf im Kopf weglassen (kostet eine ganze Zeile) */
@media (max-width: 40rem) { .header-inner > .btn-soon { display: none; } }
