/* ============================================================
   E-Rechnung-Check – Tool-Styling (gescopet auf .erechnung-tool)
   1:1 aus input/eRechnung/styles.css. Aenderungen:
   (a) jeder Selektor auf .erechnung-tool begrenzt -> SFK-Header/-Footer
       bleiben unberuehrt; (b) body/:root -> .erechnung-tool;
   (c) Font Arial -> Open Sans (Projekt-Font); (d) das innere Tool-<main>
       ist im Markup ein <div class="et-main"> (nur 1 gueltiges Landmark),
       daher zielt die fruehere main-Regel jetzt auf .et-main.
   ============================================================ */
  .erechnung-tool {
    color-scheme: light;
    --blau:      #285589;
    --blau-hell: #eaf1f8;
    --grau:      #909692;
    --grau-text: #55595a;
    --gelb:      #F2A91C;
    --gelb-hell: #fdf3dd;
    --ground:    #ffffff;
    --paper:     #eef2f5;
    --ink:       #23282b;
    --line:      #dfe4e8;
    --card:      #ffffff;
    --gruen:     #2e8b57;
    --gruen-hell:#e7f4ec;
    --rot:       #c0392b;
    --rot-hell:  #fbe9e7;
    --shadow:    0 1px 3px rgba(29,63,104,.08), 0 10px 30px rgba(29,63,104,.07);
  }
  .erechnung-tool, .erechnung-tool * { box-sizing: border-box; }
  .erechnung-tool {
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    background: var(--paper); color: var(--ink); line-height: 1.5;
    margin: 0; padding: 32px 20px; -webkit-font-smoothing: antialiased;
  }
  .erechnung-tool .sheet {
    max-width: 820px; margin: 0 auto; background: var(--ground);
    box-shadow: var(--shadow); border-radius: 6px; overflow: hidden; border: 1px solid var(--line);
  }
  .erechnung-tool header { background: var(--ground); padding: 26px 40px 22px; border-bottom: 3px solid var(--blau); }
  .erechnung-tool .logo { height: 54px; width: auto; display: block; margin: 0 0 18px; }
  .erechnung-tool .eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gelb); margin: 0 0 8px; font-weight: 700; }
  .erechnung-tool header h1 { font-size: 27px; line-height: 1.18; margin: 0; font-weight: 700; color: var(--blau); text-wrap: balance; }
  .erechnung-tool .accent { height: 5px; width: 64px; background: var(--gelb); border-radius: 3px; margin: 15px 0 0; }
  .erechnung-tool .meta { margin: 13px 0 0; font-size: 13px; color: var(--grau-text); }

  .erechnung-tool .et-main { padding: 30px 40px 12px; }
  .erechnung-tool section { margin: 0 0 26px; }
  .erechnung-tool h2 {
    font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--blau);
    font-weight: 700; margin: 0 0 12px; padding-bottom: 7px; border-bottom: 2px solid var(--line);
  }
  .erechnung-tool .h2num {
    display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
    background: var(--blau); color: #fff; font-size: 11px; margin-right: 9px; vertical-align: middle;
  }
  .erechnung-tool p { margin: 0 0 12px; }

  .erechnung-tool .intro { background: var(--blau-hell); border-left: 4px solid var(--blau); border-radius: 4px; padding: 14px 18px; font-size: 14.5px; margin-bottom: 26px; }

  /* Teil „Betroffenheit“ */
  .erechnung-tool .elig { background: var(--gelb-hell); border: 1px solid var(--gelb); border-radius: 6px; padding: 15px 18px; }
  .erechnung-tool .elig .pre { font-size: 14px; margin: 0 0 12px; }
  .erechnung-tool .elig .pre b { color: var(--blau); }
  .erechnung-tool .precheck { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--blau); color: #fff; padding: 2px 9px; border-radius: 20px; margin-left: 4px; }
  .erechnung-tool .verdict {
    margin: 13px 0 0; padding: 11px 14px; border-radius: 4px; font-size: 13.5px;
    background: #fff; border-left: 4px solid var(--grau);
  }
  .erechnung-tool .verdict.ja { border-left-color: var(--blau); }
  .erechnung-tool .verdict.frag { border-left-color: var(--gelb); }
  .erechnung-tool .verdict b { color: var(--blau); }

  /* Checkbox-Items */
  .erechnung-tool .item {
    display: flex; align-items: flex-start; gap: 12px; padding: 9px 0;
    border-top: 1px dashed var(--line); font-size: 14px; cursor: pointer; user-select: none;
  }
  .erechnung-tool .item:first-of-type { border-top: none; }
  .erechnung-tool .item input { position: absolute; opacity: 0; width: 0; height: 0; }
  .erechnung-tool .box {
    flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; border: 2px solid var(--blau);
    border-radius: 4px; background: #fff; position: relative; transition: background .12s;
  }
  .erechnung-tool .item input:checked + .box { background: var(--blau); }
  .erechnung-tool .box::after {
    content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px;
    border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0);
    transition: transform .12s;
  }
  .erechnung-tool .item input:checked + .box::after { transform: rotate(45deg) scale(1); }
  .erechnung-tool .item input:focus-visible + .box { outline: 2px solid var(--gelb); outline-offset: 2px; }
  .erechnung-tool .item .txt { flex: 1; }
  .erechnung-tool .hint { display: block; font-size: 12.5px; color: var(--grau-text); margin-top: 3px; }

  /* Begriffserklärung beim Überfahren */
  .erechnung-tool .erkl { position: relative; border-bottom: 1px dotted var(--blau); cursor: help; }
  .erechnung-tool .erkl .bubble {
    position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 6;
    width: min(290px, 68vw); background: var(--blau); color: #fff;
    font-size: 12.5px; font-weight: 400; line-height: 1.45; text-align: left;
    padding: 11px 14px; border-radius: 6px; box-shadow: 0 8px 24px rgba(29,63,104,.3);
    opacity: 0; visibility: hidden; transform: translateY(4px);
    transition: opacity .13s, transform .13s, visibility .13s;
  }
  .erechnung-tool .erkl .bubble::after {
    content: ""; position: absolute; top: 100%; left: 20px;
    border: 7px solid transparent; border-top-color: var(--blau);
  }
  .erechnung-tool .erkl:hover .bubble, .erechnung-tool .erkl:focus .bubble, .erechnung-tool .erkl.offen .bubble {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
  .erechnung-tool .erkl:focus-visible { outline: 2px solid var(--gelb); outline-offset: 2px; border-radius: 2px; }

  /* Handlungsvorschlag direkt unter dem Punkt */
  .erechnung-tool .tipp {
    margin: 0 0 11px 32px; padding: 10px 14px; font-size: 13px; line-height: 1.45;
    background: var(--gelb-hell); border-left: 3px solid var(--gelb);
    border-radius: 0 4px 4px 0; color: var(--grau-text);
  }
  .erechnung-tool .tipp.kanzlei { background: var(--blau-hell); border-left-color: var(--blau); }
  .erechnung-tool .tipp .lbl {
    display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
    font-weight: 700; color: #9a6c07; margin-bottom: 3px;
  }
  .erechnung-tool .tipp.kanzlei .lbl { color: var(--blau); }
  .erechnung-tool .tipp .tag {
    display: inline-block; margin-top: 7px; font-size: 11.5px; font-weight: 700;
    background: #fff; color: var(--blau); padding: 3px 9px; border-radius: 3px; border: 1px solid #c9dcee;
  }

  /* Auswertung */
  .erechnung-tool .score-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .erechnung-tool .score-live { font-size: 14px; color: var(--grau-text); }
  .erechnung-tool .score-live b { color: var(--blau); font-size: 20px; font-variant-numeric: tabular-nums; }
  .erechnung-tool .tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .erechnung-tool .tier { border-radius: 6px; padding: 13px 15px; border-top: 4px solid var(--grau); background: var(--card); border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .erechnung-tool .tier.g { border-top-color: var(--gruen); }
  .erechnung-tool .tier.y { border-top-color: var(--gelb); }
  .erechnung-tool .tier.r { border-top-color: var(--rot); }
  .erechnung-tool .tier b { font-size: 14px; }
  .erechnung-tool .tier .rng { font-weight: 700; }
  .erechnung-tool .tier.g .rng { color: var(--gruen); }
  .erechnung-tool .tier.y .rng { color: #b9820f; }
  .erechnung-tool .tier.r .rng { color: var(--rot); }
  .erechnung-tool .tier p { font-size: 12.5px; color: var(--grau-text); margin: 6px 0 0; }
  .erechnung-tool .tier.active { box-shadow: 0 0 0 2px currentColor inset; }
  .erechnung-tool .tier.g.active { color: var(--gruen); }
  .erechnung-tool .tier.y.active { color: var(--gelb); }
  .erechnung-tool .tier.r.active { color: var(--rot); }
  .erechnung-tool .tier.active b, .erechnung-tool .tier.active p { color: var(--ink); }

  .erechnung-tool .alles-gut {
    margin-top: 18px;
    background: var(--gruen-hell); border: 1px solid #bfe0cc; border-left: 4px solid var(--gruen);
    border-radius: 5px; padding: 14px 16px; font-size: 13.5px;
  }
  .erechnung-tool .alles-gut b { color: var(--gruen); }

  /* Download + Erinnerung */
  .erechnung-tool .mitnehmen {
    margin-top: 18px; background: var(--card); border: 1px solid var(--line);
    border-radius: 6px; padding: 16px 18px;
  }
  .erechnung-tool .mitnehmen h3 { margin: 0 0 4px; font-size: 15px; color: var(--blau); }
  .erechnung-tool .mitnehmen .sub { font-size: 12.5px; color: var(--grau-text); margin: 0 0 13px; }
  .erechnung-tool .dl {
    display: inline-flex; align-items: center; gap: 8px; background: var(--gelb); color: #3a2a00;
    font-family: inherit; font-size: 13.5px; font-weight: 700; border: none; border-radius: 5px;
    padding: 10px 16px; cursor: pointer; transition: filter .12s;
  }
  .erechnung-tool .dl:hover { filter: brightness(.95); }
  .erechnung-tool .dl:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
  .erechnung-tool .dl-note { font-size: 12px; color: var(--grau); margin: 8px 0 0; }

  .erechnung-tool .erinnerung { margin-top: 16px; padding-top: 15px; border-top: 1px dashed var(--line); }
  .erechnung-tool .btn-klein {
    margin: 13px 0 0 32px; font-family: inherit; font-size: 13px; font-weight: 700;
    background: var(--blau); color: #fff; border: none; border-radius: 5px;
    padding: 9px 15px; cursor: pointer; transition: filter .12s;
  }
  .erechnung-tool .btn-klein:hover { filter: brightness(1.08); }
  .erechnung-tool .btn-klein:focus-visible { outline: 2px solid var(--gelb); outline-offset: 2px; }
  .erechnung-tool #remind-danke { margin-left: 32px; }
  .erechnung-tool .opt { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; cursor: pointer; user-select: none; }
  .erechnung-tool .opt input { position: absolute; opacity: 0; width: 0; height: 0; }
  .erechnung-tool .opt input:focus-visible + .box { outline: 2px solid var(--gelb); outline-offset: 2px; }
  .erechnung-tool .opt input:checked + .box { background: var(--blau); }
  .erechnung-tool .opt input:checked + .box::after { transform: rotate(45deg) scale(1); }
  .erechnung-tool .mailfeld { margin: 12px 0 0 32px; }
  .erechnung-tool .mailfeld label { display: block; font-size: 12.5px; color: var(--grau-text); margin-bottom: 5px; }
  .erechnung-tool .mailfeld input[type="email"] {
    font-family: inherit; font-size: 14px; padding: 9px 12px; width: 100%; max-width: 340px;
    border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink);
  }
  .erechnung-tool .mailfeld input[type="email"]:focus-visible { outline: 2px solid var(--blau); outline-offset: 1px; }
  .erechnung-tool .dsgvo { font-size: 11.5px; color: var(--grau); margin: 9px 0 0 32px; }

  /* CTA */
  .erechnung-tool .cta { background: var(--blau); color: #fff; border-radius: 8px; padding: 20px 24px; margin-top: 4px; }
  .erechnung-tool .cta h3 { margin: 0 0 7px; font-size: 16px; }
  .erechnung-tool .cta p { margin: 0; font-size: 13.5px; color: #d3e0ee; }
  .erechnung-tool .cta b { color: #fff; }
  .erechnung-tool .cta-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 17px; }
  .erechnung-tool .btn {
    display: flex; align-items: center; justify-content: center; text-align: center;
    font-family: inherit; font-size: 13.5px; font-weight: 700; line-height: 1.3;
    padding: 12px 16px; border: none; border-radius: 5px; text-decoration: none;
    cursor: pointer; transition: filter .12s, background .12s;
  }
  .erechnung-tool .btn-gelb { background: var(--gelb); color: #3a2a00; }
  .erechnung-tool .btn-gelb:hover { filter: brightness(.95); }
  .erechnung-tool .btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.55); }
  .erechnung-tool .btn-ghost:hover { background: rgba(255,255,255,.12); }
  .erechnung-tool .cta .btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  .erechnung-tool .cta-tip {
    display: flex; align-items: flex-start; gap: 9px; margin: 0; font-size: 13px; color: #e4edf6;
    background: rgba(255,255,255,.09); border-radius: 5px; padding: 11px 14px;
  }
  .erechnung-tool .cta-tip .tip-lbl { font-weight: 700; color: var(--gelb); white-space: nowrap; }

  /* Terminanfrage-Maske */
  .erechnung-tool dialog.modal {
    border: none; border-radius: 8px; padding: 0; color: var(--ink);
    width: min(470px, calc(100vw - 32px));
    box-shadow: 0 20px 60px rgba(29,63,104,.28);
  }
  .erechnung-tool dialog.modal::backdrop { background: rgba(20,38,60,.55); }
  .erechnung-tool .modal-head { background: var(--blau); color: #fff; padding: 17px 22px; }
  .erechnung-tool .modal-head h3 { margin: 0 0 3px; font-size: 16px; }
  .erechnung-tool .modal-head p { margin: 0; font-size: 12.5px; color: #d3e0ee; }
  .erechnung-tool .modal-body { padding: 20px 22px 22px; }
  .erechnung-tool .feld { margin-bottom: 14px; }
  .erechnung-tool .feld label { display: block; font-size: 12.5px; font-weight: 700; color: var(--grau-text); margin-bottom: 5px; }
  .erechnung-tool .feld input {
    font-family: inherit; font-size: 14px; width: 100%; padding: 9px 12px;
    border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink);
  }
  .erechnung-tool .feld input:focus-visible { outline: 2px solid var(--blau); outline-offset: 1px; }
  .erechnung-tool .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
  .erechnung-tool .btn-sec { background: transparent; color: var(--grau-text); border: 1px solid var(--line); }
  .erechnung-tool .btn-sec:hover { background: var(--paper); }
  .erechnung-tool .btn-blau { background: var(--blau); color: #fff; }
  .erechnung-tool .btn-blau:hover { filter: brightness(1.08); }
  .erechnung-tool .modal .btn:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }

  .erechnung-tool .ok-box {
    background: var(--gruen-hell); border-left: 4px solid var(--gruen);
    border-radius: 0 5px 5px 0; padding: 13px 16px; font-size: 13.5px;
  }
  .erechnung-tool .ok-box b { color: var(--gruen); }
  .erechnung-tool .devbox {
    margin-top: 14px; background: var(--paper); border: 1px dashed var(--grau);
    border-radius: 5px; padding: 11px 13px;
  }
  .erechnung-tool .devbox .lbl {
    display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
    font-weight: 700; color: var(--grau); margin-bottom: 6px;
  }
  .erechnung-tool .devbox pre {
    margin: 0; white-space: pre-wrap; word-break: break-word;
    font-family: Consolas, "Courier New", monospace; font-size: 11.5px; color: var(--ink);
  }

  .erechnung-tool .hinweis { font-size: 12px; color: var(--grau); margin-top: 18px; font-style: italic; }
  .erechnung-tool footer { padding: 14px 40px 24px; font-size: 11.5px; color: var(--grau); text-align: center; }

  @media (max-width: 640px) {
    .erechnung-tool .tiers { grid-template-columns: 1fr; }
    .erechnung-tool header, .erechnung-tool .et-main, .erechnung-tool footer { padding-left: 22px; padding-right: 22px; }
    .erechnung-tool .logo { height: 46px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .erechnung-tool, .erechnung-tool * { transition: none !important; }
  }
  @media print {
    .erechnung-tool { background: #fff; padding: 0; }
    .erechnung-tool .sheet { box-shadow: none; max-width: none; border: none; }
    .erechnung-tool section, .erechnung-tool .cta, .erechnung-tool .tier, .erechnung-tool .elig, .erechnung-tool .intro, .erechnung-tool .tipp, .erechnung-tool .mitnehmen { break-inside: avoid; }
    .erechnung-tool .dl, .erechnung-tool .btn-klein, .erechnung-tool .cta-actions .btn, .erechnung-tool dialog.modal, .erechnung-tool .erkl .bubble { display: none; }
    .erechnung-tool .erkl { border-bottom: none; }
  }

/* --- Ergaenzungen SFK-Integration --- */

/* WICHTIG: .opt setzt display:flex und wuerde das [hidden]-Attribut ueberstimmen
   -> explizit wieder ausblendbar machen (Consent erscheint nur bei Bedarf). */
.erechnung-tool .opt[hidden] { display: none; }

/* DSGVO-Einwilligung: bewusst klein & unscheinbar (Reminder wie Termin). */
.erechnung-tool .datenschutz-opt { margin-top: 12px; align-items: flex-start; }
.erechnung-tool .datenschutz-opt .box {
  width: 16px; height: 16px; margin-top: 2px; border-width: 1.5px;
}
.erechnung-tool .datenschutz-opt .box::after {
  left: 4px; top: 1px; width: 5px; height: 9px; border-width: 0 2px 2px 0;
}
.erechnung-tool .datenschutz-opt .txt {
  font-size: 11px; font-weight: 400; color: var(--grau-text); line-height: 1.45;
}
.erechnung-tool .datenschutz-opt .txt a,
.erechnung-tool .dsgvo a { color: var(--blau); text-decoration: underline; }
/* Erinnerung: E-Mail-Feld ist um 32px eingerueckt -> Consent auf dieselbe Flucht. */
.erechnung-tool .erinnerung .datenschutz-opt { margin-left: 32px; }

.erechnung-tool .et-consent-err {
  color: var(--rot); font-size: 11px; font-weight: 700; margin: 8px 0 0;
}
.erechnung-tool .erinnerung .et-consent-err { margin-left: 32px; }

/* Eingebettetes Terminanfrage-Formular. Hintergrund = dezentes Grau der
   Versprechen-Karten auf /leistungen/ (--sfk-gray-50 = #f8f9fa), damit sich der
   Kasten vom weissen Sheet abhebt. Fallback, falls der Theme-Token fehlt. */
.erechnung-tool .termin-card {
  margin-top: 18px; background: var(--sfk-gray-50, #f8f9fa); border: 1px solid var(--line);
  border-radius: 6px; padding: 16px 18px;
}
/* Eingabefelder bleiben weiss, damit sie sich vom grauen Kasten absetzen. */
.erechnung-tool .termin-card .feld input { background: #ffffff; }
.erechnung-tool .termin-card > h3 { margin: 0 0 4px; font-size: 15px; color: var(--blau); }
.erechnung-tool .termin-card .sub { font-size: 12.5px; color: var(--grau-text); margin: 0 0 14px; }
.erechnung-tool .termin-form .feld { margin-bottom: 12px; }
.erechnung-tool .termin-form .btn { margin-top: 6px; }
.erechnung-tool .termin-form .btn[disabled] { opacity: .6; cursor: default; }

/* Honeypot: fuer Menschen unsichtbar, von Bots aber ausfuellbar (nicht display:none). */
.erechnung-tool .et-hp {
  position: absolute !important; left: -9999px !important;
  width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
