/* ============================================================================
   Notaly — zentraler Styleguide für App-WebViews & Rechtstexte
   AGB · Datenschutz · Impressum · Über Notaly · FAQ · Preise · Über die App.
   Ziel: wie native App-Screens. Font = Roboto (identisch zur App, self-hosted),
   KEIN eigener Display-Stil. Keine Kopfleiste (App bringt native Titelleiste mit).
   Fällt exakt in die Breite: kein horizontaler Scroll/Zoom.

   Wichtig (Rechts-Hashing, legal_text.py): der Zustimmungs-Hash zählt nur den
   SICHTBAREN Text. Diese Datei ändert nur Darstellung → kein neuer Legal-Stand,
   keine erneute Zustimmung. Font-Pfade relativ zu dieser Datei (assets/css/ → app/static/).
   ============================================================================ */

@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("../../../static/fonts/roboto-400.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 400; font-display: swap; src: url("../../../static/fonts/roboto-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("../../../static/fonts/roboto-500.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url("../../../static/fonts/roboto-700.woff2") format("woff2"); }

:root {
  --ink: #2b2620;
  --ink-2: #17130d;
  --muted: #6f665b;
  --paper: #ffffff;
  --ivory: #f8f6f0;
  --line: #eae5da;
  --line-2: #ddd6c8;
  --yellow: #ffbc2c;
  --teal: #2a6f66;
  --amber-bg: #fdf6e3;
  --amber-line: #ecd9a6;
  --teal-bg: #eef4f2;
  --teal-line: #cfe0da;
  --r-sm: 0.6rem;
  --r-md: 0.9rem;
  --font-display: Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body.notaly-webview {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;               /* passt exakt in die Breite: kein H-Scroll/Zoom */
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
.notaly-webview img, .notaly-webview table, .notaly-webview pre { max-width: 100%; }

/* ---------------- Kopfleiste (Marke) ----------------
   Nur Logo-Bild (alt) + CSS-Wortmarke → kein zusätzlicher gehashter Text. */
.wv-topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center;
  gap: 0.6rem;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
}
.wv-logo { width: 2rem; height: 2rem; border-radius: 0.5rem; border: 1px solid var(--line-2); background: #fff; object-fit: cover; display: block; }
.wv-brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; }
.wv-brand::after { content: "Notaly"; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.01em; color: var(--ink); }
.notaly-webview.wv-embed .wv-topbar { display: none; }  /* in-App bringt native Titelleiste mit */

/* ---------------- Lesespalte ---------------- */
.wv-main { max-width: 46rem; margin-inline: auto; padding: clamp(1.4rem, 4vw, 2.6rem) clamp(1rem, 4vw, 2rem) 1rem; }

/* Titel + Abschnitte */
.wv-main h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em;
  font-size: clamp(1.5rem, 4vw, 1.95rem); line-height: 1.2; margin: 0 0 0.35rem;
}
.wv-main h1 + p { margin-top: 0.35rem; }
.wv-main h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.15rem, 2.6vw, 1.35rem); line-height: 1.3; color: var(--ink);
  margin: 0 0 0.6rem;
}
.wv-main h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.02rem; line-height: 1.35; margin: 1.4rem 0 0.4rem;
}
.wv-main p { margin: 0.7rem 0; }
.wv-main ul, .wv-main ol { margin: 0.7rem 0; padding-left: 1.3rem; }
.wv-main li { margin: 0.4rem 0; }
.wv-main a { color: var(--teal); text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
.wv-main a:hover { color: #1f554d; }
.wv-main strong { color: var(--ink); }

/* Abschnitt = Dokument-Block mit Haarlinie statt schwerer Karte */
.wv-main section { margin: 0; padding: 1.8rem 0; border-top: 1px solid var(--line); }
.wv-main section:first-of-type { border-top: 0; padding-top: 0.4rem; }

/* „Stand: …" u. ä. */
.muted { color: var(--muted) !important; }
.wv-main .muted { font-size: 0.92rem; }
.legal { color: var(--muted); font-size: 0.9rem; margin-top: 0.6rem; }

/* Monospace (E-Mail, URLs, IDs) — bricht lange Strings */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.94em; word-break: break-word; overflow-wrap: anywhere; }

/* ---------------- Callouts ----------------
   .box  = neutraler Hinweis (Gelb-Akzent links)
   .note / .box-warn = wichtiger Hinweis (warm/amber)
   .info = institutioneller Hinweis (teal) */
.box, .note, .box-warn, .info {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 1rem 1.15rem; margin: 1rem 0; background: var(--ivory);
  border-left: 3px solid var(--yellow);
}
.box > :first-child, .note > :first-child, .box-warn > :first-child, .info > :first-child { margin-top: 0; }
.box > :last-child, .note > :last-child, .box-warn > :last-child, .info > :last-child { margin-bottom: 0; }
.note, .box-warn { background: var(--amber-bg); border-color: var(--amber-line); border-left-color: #e0a723; }
.info { background: var(--teal-bg); border-color: var(--teal-line); border-left-color: var(--teal); }

/* ---------------- Impressum: Angaben-Raster ---------------- */
.grid { display: grid; gap: 1.1rem; }
.kvs { display: grid; gap: 0.7rem; }
.kv { display: grid; gap: 0.15rem; }
.kv b { font-weight: 700; }
address { font-style: normal; white-space: pre-line; color: var(--muted); }

/* ---------------- Tabellen (Datenschutz) ---------------- */
.wv-main table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 1rem 0; font-size: 0.94rem; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.wv-main th, .wv-main td { padding: 0.7rem 0.85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.wv-main thead th, .wv-main tr:first-child th { background: var(--ivory); font-family: var(--font-body); font-weight: 800; font-size: 0.82rem; letter-spacing: 0.02em; }
.wv-main tr:last-child td, .wv-main tr:last-child th { border-bottom: 0; }
.wv-table-scroll { overflow-x: auto; }

/* ---------------- Fußzeile ---------------- */
.wv-footer { max-width: 46rem; margin: 1rem auto 0; padding: 1.2rem clamp(1rem, 4vw, 2rem) 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; justify-content: space-between; }
.wv-footer a { color: var(--muted); text-decoration: none; }
.wv-footer a:hover { color: var(--teal); text-decoration: underline; }
.wv-footer nav a { margin-left: 0.9rem; }

.skip-link { position: absolute; left: -9999px; z-index: 9999; padding: 0.5rem 1rem; background: var(--teal); color: #fff; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }
.preview-flag { position: fixed; bottom: 0.75rem; right: 0.75rem; z-index: 3000; font-size: 0.7rem; font-weight: 700; color: #fff; background: rgba(43, 38, 32, 0.9); border-radius: 999px; padding: 0.28rem 0.7rem; }

/* ============================================================================
   Bausteine für FAQ / Preise / Über die App  (ersetzen Bootstrap komplett:
   kein CDN mehr nötig — vgl. Datenschutz §16 „jsDelivr“).
   ============================================================================ */

.wv-main--wide { max-width: 60rem; }
.wv-kicker { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.5rem; }
.wv-lead { font-size: 1.06rem; color: var(--muted); }

/* Grid-Helfer */
.wv-grid { display: grid; gap: 1rem; }
@media (min-width: 40rem) { .wv-grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 34rem) { .wv-grid-4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 58rem) { .wv-grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Karte */
.wv-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.25rem 1.15rem; height: 100%; }
.wv-card h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 620; margin: 0 0 0.4rem; }
.wv-card p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* Schritt-Zeilen */
.wv-step { display: flex; gap: 0.9rem; margin-bottom: 1.3rem; }
.wv-step:last-child { margin-bottom: 0; }
.wv-step-n { flex: 0 0 auto; width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 1.5px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; }
.wv-step h3 { margin: 0.15rem 0 0.25rem; font-size: 1.04rem; font-family: var(--font-display); font-weight: 620; }
.wv-step p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* FAQ — nativ <details>/<summary>, kein JS */
.wv-faq details { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 0.55rem; background: #fff; overflow: hidden; }
.wv-faq summary { list-style: none; cursor: pointer; padding: 0.9rem 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 0.75rem; }
.wv-faq summary::-webkit-details-marker { display: none; }
.wv-faq summary::after { content: ""; margin-left: auto; flex: 0 0 auto; width: 0.5rem; height: 0.5rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.18s ease; }
.wv-faq details[open] summary { background: var(--ivory); }
.wv-faq details[open] summary::after { transform: rotate(-135deg); }
.wv-faq summary:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.wv-faq-body { padding: 0.4rem 1.05rem 1.05rem; color: var(--muted); }
.wv-faq-body > :first-child { margin-top: 0; }
.wv-faq-body > :last-child { margin-bottom: 0; }
.wv-faq-body ul { margin: 0.6rem 0; padding-left: 1.2rem; }
@media (prefers-reduced-motion: reduce) { .wv-faq summary::after { transition: none; } }

/* Preise */
.wv-price { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.15rem 1rem 1rem; height: 100%; }
.wv-price--featured { border-color: var(--ink); }
.wv-price-badge { position: absolute; top: 0; right: 0; padding: 0.2rem 0.55rem; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; background: var(--ink); color: #fff; border-radius: 0 var(--r-md) 0 0.45rem; }
.wv-price h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; margin: 0 0 0.55rem; }
.wv-price-amount { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; line-height: 1.1; margin: 0; }
.wv-price-note { font-size: 0.85rem; color: var(--muted); margin: 0.25rem 0 0; }
.wv-price-hint { margin: 0.75rem 0 0; padding-top: 0.6rem; border-top: 1px solid var(--line); font-size: 0.76rem; color: var(--muted); }

/* Rhythmus-Umschalter */
.wv-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.wv-toggle button { appearance: none; border: 0; background: #fff; color: var(--ink); font: inherit; font-weight: 700; font-size: 0.88rem; padding: 0.45rem 0.9rem; cursor: pointer; }
.wv-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.wv-toggle button + button { border-left: 1px solid var(--line-2); }

/* Häkchen-Liste (wie auf der Website) */
.wv-main ul.ticks { list-style: none; padding-left: 0; }
.wv-main ul.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: 0.55rem; }
.wv-main ul.ticks li::before { content: "\2713"; position: absolute; left: 0; top: 0.02em; font-weight: 800; color: var(--teal); }

/* CTA-Kasten */
.wv-cta { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ivory); padding: 1.6rem 1.35rem; text-align: center; }
.wv-cta h2 { margin: 0 0 0.5rem; }
.wv-cta p { margin: 0; color: var(--muted); }

/* ---------------- Print ---------------- */
@media print {
  .wv-topbar, .preview-flag, .skip-link { display: none; }
  .wv-main section { border-top: 1px solid #ddd; }
  body.notaly-webview { color: #000; }
  .box, .note, .box-warn, .info { border: 1px solid #ccc; }
}
