/* ============================================================
   Dynamischer QR-Code, Fassung v2: Kündigen, Melden, AGB, Widerruf (W3)
   Nur vorhandene Variablen aus /styles.css: Größen --fs-xs ... --fs-hero,
   Gewichte --fw-regular und --fw-bold, Farben --accent, --surface, --border usw.
   Keine eigene Schrift, keine eigenen Größen. Klassen mit Präfix "dl-",
   der Entwurfshinweis heißt .dyn-draft (leicht zu entfernen).
   ============================================================ */

/* ---- Seitenkopf ---- */
.dl-hero { padding-bottom: 1rem; }
.dl-hero h1 { text-wrap: balance; overflow-wrap: break-word; }
.dl-hero .hero-sub { max-width: 640px; text-wrap: pretty; font-size: var(--fs-m); }
.dl-main { padding-bottom: 3rem; }
.dl-wrap { max-width: 680px; margin: 0 auto; }
.dl-doc-wrap { max-width: 760px; margin: 0 auto; }
.dl-card { padding: 1.5rem; }
.dl-card + .dl-card { margin-top: 1rem; }
.dl-card-title { font-size: var(--fs-l); margin-bottom: 0.5rem; }
.dl-card .dl-card-lead { margin-bottom: 1.25rem; color: var(--text-muted); font-size: var(--fs-s); line-height: 1.6; }

/* ---- Formulare ---- */
.dl-form .form-group { margin-bottom: 1.1rem; }
.dl-form label { color: var(--text); align-items: baseline; flex-wrap: wrap; }
.dl-form legend { font-size: var(--fs-s); color: var(--text); margin-bottom: 0.5rem; padding: 0; }
.dl-form fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
.dl-hint { font-size: var(--fs-s); color: var(--text-muted); line-height: 1.5; }
.dl-err {
  font-size: var(--fs-s);
  line-height: 1.5;
  color: var(--danger);
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
}
.dl-err[hidden] { display: none; }
.dl-err::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dl-form input[aria-invalid="true"],
.dl-form textarea[aria-invalid="true"],
.dl-form select[aria-invalid="true"] { border-color: var(--danger); }
.dl-form input:not([type="radio"]), .dl-form select { min-height: 48px; }
.dl-form textarea { min-height: 120px; }
.dl-form [hidden], .dl-main [hidden] { display: none !important; }
.dl-form-note { font-size: var(--fs-s); color: var(--text-muted); margin-bottom: 1.25rem; }

/* Auswahlkacheln (Art der Kündigung) */
.dl-choices { display: grid; gap: 0.6rem; }
.dl-form .dl-choice {
  flex-wrap: nowrap;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  min-height: 44px;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  font-size: var(--fs-m);
}
.dl-choice:hover { border-color: var(--border-hover); }
.dl-choice input[type="radio"] {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--accent-strong);
  cursor: pointer;
}
.dl-choice-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.dl-choice-title { font-weight: var(--fw-bold); }
.dl-choice-desc { font-size: var(--fs-s); color: var(--text-muted); line-height: 1.5; font-weight: var(--fw-regular); }
.dl-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.dl-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.dl-submit { width: 100%; min-height: 52px; margin-top: 0.25rem; }
.dl-submit[disabled] { opacity: 0.7; cursor: progress; }
.dl-privacy { margin-top: 1rem; font-size: var(--fs-s); color: var(--text-muted); line-height: 1.6; }
.dl-urgent { margin-top: 0.75rem; font-size: var(--fs-s); color: var(--text-muted); line-height: 1.6; }

/* Statusmeldung (Server, Netz, Ratenbegrenzung) */
.dl-msg { margin: 0 0 1rem; font-size: var(--fs-s); color: var(--text-muted); line-height: 1.5; }
.dl-msg:empty { display: none; }
.dl-msg[data-state="error"] {
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--danger);
  border-radius: 10px;
  color: var(--text);
}

/* ---- Bestätigung ---- */
.dl-result[hidden], .dl-result [hidden] { display: none; }
.dl-result-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.dl-result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.dl-result-icon svg { width: 22px; height: 22px; }
.dl-result-icon .dl-ic-ok { display: none; }
#kuend-confirm[data-state="done"] .dl-ic-ok { display: block; }
#kuend-confirm[data-state="done"] .dl-ic-warn { display: none; }
#kuend-confirm .dl-actions { margin-top: 0.25rem; }
.dl-result h2 { font-size: var(--fs-l); text-wrap: balance; }
.dl-result h2:focus { outline: none; }
.dl-result p { color: var(--text-muted); line-height: 1.65; margin-bottom: 0.9rem; }
.dl-result p.dl-lead-strong { color: var(--text); }
.dl-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0;
  margin: 1.1rem 0 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.dl-facts dt, .dl-facts dd { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); font-size: var(--fs-s); line-height: 1.5; }
.dl-facts dt { color: var(--text-muted); }
.dl-facts dd { color: var(--text); font-weight: var(--fw-bold); overflow-wrap: anywhere; min-width: 0; }
.dl-facts dd.dl-plain { font-weight: var(--fw-regular); white-space: pre-line; }
.dl-facts dt:nth-last-of-type(1), .dl-facts dd:nth-last-of-type(1) { border-bottom: 0; }
.dl-facts [hidden] { display: none; }
.dl-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.dl-actions .btn { min-height: 48px; }
.dl-print-only { display: none; }

/* ---- Hinweisleisten ---- */
.dyn-draft {
  max-width: 760px;
  margin: 0 auto 1.5rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  font-size: var(--fs-s);
  line-height: 1.6;
  color: var(--text);
}
.dyn-draft strong { display: block; margin-bottom: 0.2rem; font-size: var(--fs-m); }
/* Englische Rechtsseiten (/en/dynamischer-qr-code/agb.html, widerruf.html, datenschutz-pakete.html): Hinweis direkt unter
   der Überschrift, dass der Text eine Übersetzung ist und die deutsche Fassung gilt. */
.dyn-translation-note {
  max-width: 640px;
  margin: 0.9rem auto 1rem;
  padding: 0.7rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius);
  font-size: var(--fs-s);
  line-height: 1.6;
  color: var(--text);
  text-align: start;
  overflow-wrap: anywhere;
}
.dyn-translation-note a { color: var(--text); font-weight: var(--fw-bold); text-decoration: underline; }
.dyn-translation-note a:hover, .dyn-translation-note a:focus-visible { color: var(--accent); }
.dyn-open { background: var(--accent-soft); border-radius: 4px; padding: 0 0.2em; }

/* ---- Rechtstexte ---- */
.dl-meta { color: var(--text-muted); font-size: var(--fs-s); margin-bottom: 1.5rem; }
.dl-toc { padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.dl-toc h2 { font-size: var(--fs-m); margin-bottom: 0.75rem; }
.dl-toc ol { list-style: none; columns: 2; column-gap: 2rem; }
.dl-toc li { break-inside: avoid; }
.dl-toc a {
  display: block;
  padding: 0.5rem 0;
  min-height: 44px;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
}
.dl-toc a:hover { color: var(--accent); }
.dl-doc { padding: 1.75rem; }
.dl-doc h2 { font-size: var(--fs-l); margin: 2rem 0 0.75rem; line-height: 1.3; text-wrap: balance; }
.dl-doc h2:first-child { margin-top: 0; }
.dl-doc h3 { font-size: var(--fs-m); margin: 1.5rem 0 0.5rem; }
.dl-doc p, .dl-doc li { color: var(--text); line-height: 1.7; }
.dl-doc p { margin-bottom: 0.85rem; max-width: 70ch; }
.dl-doc ul, .dl-doc ol.dl-list { margin: 0 0 0.85rem 1.5rem; max-width: 70ch; }
.dl-doc ol.dl-list { list-style: lower-alpha; }
.dl-doc li { margin-bottom: 0.35rem; padding-left: 0.2rem; }
.dl-doc code { background: var(--code-bg); border-radius: 4px; padding: 0.05em 0.35em; overflow-wrap: anywhere; font-size: var(--fs-s); }
.dl-doc a { overflow-wrap: anywhere; }
.dl-doc hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.dl-doc address { font-style: normal; line-height: 1.7; margin-bottom: 0.85rem; }
.dl-sheet {
  margin: 1rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--surface-2);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius);
}
.dl-sheet p { margin-bottom: 0.9rem; }
.dl-sheet .dl-line { display: block; margin-top: 0.15rem; min-height: 1.7em; border-bottom: 1px solid var(--text-dim); }
.dl-back { margin-top: 1.5rem; font-size: var(--fs-s); }
.dl-back a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dl-back a:hover { color: var(--accent); }
.dl-note-links { margin-top: 1.25rem; font-size: var(--fs-s); color: var(--text-muted); line-height: 1.7; }

/* ---- Fußzeile: Vertragslinks (wie auf der Produktseite) ---- */
.dyn-footer-legal {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
}

/* ---- Fokus sichtbar ---- */
.dl-submit:focus-visible,
.dl-actions .btn:focus-visible,
.dl-toc a:focus-visible,
.dl-back a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- Breiten ---- */
@media (max-width: 768px) {
  .dl-toc ol { columns: 1; }
}
@media (max-width: 640px) {
  .dl-card { padding: 1rem; }
  .dl-doc { padding: 1.1rem; }
  .dl-toc { padding: 1rem; }
  .dl-sheet { padding: 1rem; }
  .dl-facts { grid-template-columns: minmax(0, 1fr); }
  .dl-facts dt { padding-bottom: 0; border-bottom: 0; }
  .dl-facts dd { padding-top: 0.15rem; }
  .dl-actions .btn { width: 100%; }
  .dl-result h2 { font-size: var(--fs-m); }
}
@media (max-width: 420px) {
  .dl-hero h1 { font-size: var(--fs-l); }
}

/* ---- Hinweis mit Knopf (Widerrufsbelehrung: Widerruf direkt erklären) ---- */
.dl-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.1rem 1.5rem;
  margin-bottom: 1.5rem;
}
.dl-cta-text { margin: 0; color: var(--text); line-height: 1.5; flex: 1 1 260px; }
.dl-cta .btn { min-height: 48px; }

/* ---- Preisübersicht in den AGB (Werte kommen aus /api/dyn/config) ---- */
.dl-prices-wrap { margin: 1rem 0 1.25rem; max-width: 70ch; }
.dl-doc .dl-prices-fallback { color: var(--text-muted); margin: 0; }
.dl-prices { padding: 1rem 1.25rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.dl-prices-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.25rem; }
.dl-doc .dl-prices-title { margin: 0; font-size: var(--fs-m); }
.dl-cur { display: inline-flex; gap: 0.4rem; }
.dl-cur-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0.9rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--fs-s);
  cursor: pointer;
}
.dl-cur-btn:hover { border-color: var(--border-hover); }
.dl-cur-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: var(--fw-bold); }
.dl-cur-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dl-doc .dl-prices-list { list-style: none; margin: 0; padding: 0; max-width: none; }
.dl-doc .dl-prices-list li {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.2rem 1rem;
  margin: 0;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
}
.dl-prices-list li[hidden] { display: none; }
.dl-pl-name { grid-column: 1 / -1; font-weight: var(--fw-bold); color: var(--text); }
.dl-pl-cell { display: flex; flex-direction: column; min-width: 0; }
.dl-pl-label { font-size: var(--fs-s); color: var(--text-muted); line-height: 1.4; overflow-wrap: anywhere; }
.dl-pl-val { color: var(--text); font-weight: var(--fw-bold); line-height: 1.5; overflow-wrap: anywhere; }
.dl-doc .dl-prices-note { margin: 0.5rem 0 0; font-size: var(--fs-s); color: var(--text-muted); line-height: 1.5; }

@media (max-width: 640px) {
  .dl-doc .dl-prices-list li { display: block; padding: 0.75rem 0; }
  .dl-pl-name { display: block; margin-bottom: 0.25rem; }
  .dl-pl-cell { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.2rem 0; }
  .dl-pl-val { text-align: right; white-space: nowrap; }
  .dl-prices { padding: 0.9rem 1rem; }
}

/* ---- Druckansicht: nur die Bestätigung, schwarz auf weiß ---- */
@media print {
  :root, :root[data-theme="light"] {
    --bg: #fff; --surface: #fff; --surface-2: #fff; --border: #999; --border-hover: #999;
    --text: #000; --text-muted: #000; --text-dim: #000; --accent: #000; --accent-soft: transparent;
    --bg-gradient-1: transparent; --bg-gradient-2: transparent; --code-bg: transparent;
  }
  body { background: #fff; background-image: none; min-height: 0; }
  .skip-link, #cookie-banner, .header, .footer, .hero, .dl-form-section, .dl-actions, .dl-noprint, .dl-back, .dl-toc, .dl-cta, .dl-cur { display: none !important; }
  .dl-print-only { display: block; margin-bottom: 1rem; }
  .dl-print-only strong { display: block; font-size: var(--fs-l); }
  .dl-main { padding: 0; }
  .card, .dl-card, .dl-doc { box-shadow: none; border: 0; padding: 0; background: #fff; }
  .dl-facts { border-color: #999; }
  .dl-result-icon { display: none; }
  a { color: #000; text-decoration: none; }
}

/* ---- Zeitpunkt (Kündigung): Datumsfeld wie die übrigen Eingabefelder ---- */
.dl-form input[type="date"] {
  width: 100%;
  min-height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  color: var(--text);
  font-size: var(--fs-m);
  font-family: inherit;
}
.dl-form .dl-when-date { margin: 0.75rem 0 0; max-width: 100%; }
.dl-form .dl-when-date[hidden] { display: none; }
.dl-form #kuend-when-set .dl-hint { margin-top: 0.6rem; }

/* ---- Kopfzeile mit dem Menüpunkt „Dynamische QR-Codes“ (18.11.2026) ----
   Dieselbe Regel wie in dyn.css, Begründung dort. Diese Datei laden die Rechtsseiten, Kündigen und Melden. */
@media (min-width: 768px) and (max-width: 819px) {
  .header #main-nav:has(a.nav-dyn) a { padding-left: 0.4rem; padding-right: 0.4rem; }
}
