/* =============================================================================
 * woflv.css — styles for the public Wohnflächenrechner (landing page)
 * -----------------------------------------------------------------------------
 * Design tokens mirror webeditor/style.css so the landing feels like the app.
 * Self-contained on purpose: style.css is the APP SHELL (body { overflow:hidden })
 * and must never be linked from a document page.
 * ========================================================================== */

:root {
  --bg:          #f4f5f7;
  --panel:       #ffffff;
  --ink:         #1d2330;
  --ink-soft:    #4f5a6b;   /* editor's #5b6473, darkened for AA contrast on --bg */
  --line:        #e2e5ea;
  --line-strong: #c9ced6;
  --accent:      #2f6fed;
  --accent-ink:  #ffffff;
  --accent-soft: #eaf1ff;
  --danger:      #d4493a;
  --ok:          #1f9d63;
  --navy:        #141b2e;

  --shadow: 0 1px 2px rgba(20,30,55,.06), 0 4px 16px rgba(20,30,55,.08);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--accent); }
a:hover { color: #2660d8; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius) 0;
  z-index: 50;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: block; flex: 0 0 auto; }
.site-nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.site-nav a { font-size: 15px; text-decoration: none; font-weight: 600; }
.site-nav a:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 8px; }
.hero h1 {
  font-size: clamp(28px, 4.4vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.4px;
  margin: 0 0 12px;
}
.hero .lead {
  font-size: clamp(17px, 2.1vw, 20px);
  color: var(--ink-soft);
  max-width: 66ch;
  margin: 0 0 18px;
}
.badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 8px; padding: 0; }
.badges li {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ---------- Cards / panels ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 24px 0;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

.privacy-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--accent-soft);
  border: 1px solid #cfe0ff;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 15px;
  margin: 0 0 20px;
}
.privacy-note .dot {
  flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok); margin-top: 7px;
}

.noscript-note {
  background: #fff6e8;
  border: 1px solid #f0d6a8;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 15px;
  margin: 0 0 18px;
}

/* ---------- Tool controls ---------- */
.tool-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}
.tool-head h2 { margin: 0; font-size: 22px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field .hint { font-size: 12px; color: var(--ink-soft); }

.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .12s, border-color .12s, transform .04s;
}
.btn:hover { background: #f0f2f6; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: #2660d8; color: #fff; }
.btn-lg { font-size: 16px; padding: 12px 22px; }

select.woflv-input, input.woflv-input, .field select {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 10px;
  width: 100%;
  min-width: 0;
}
.field select { width: auto; }
input.woflv-input:focus, select.woflv-input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input.woflv-input:disabled {
  background: #f6f7f9;
  color: #9aa3b2;
  cursor: not-allowed;
}
.woflv-number { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Table ---------- */
.table-scroll { width: 100%; overflow-x: auto; }
.woflv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 900px;
}
.woflv-table caption {
  text-align: left;
  font-size: 14px;
  color: var(--ink-soft);
  padding-bottom: 10px;
}
/* Column widths so the text fields stay readable and the rule column wraps. */
.woflv-table col.c-name   { width: 17%; }
.woflv-table col.c-type   { width: 17%; }
.woflv-table col.c-area   { width: 10%; }
.woflv-table col.c-band   { width: 10%; }
.woflv-table col.c-low    { width: 10%; }
.woflv-table col.c-rule   { width: 21%; }
.woflv-table col.c-result { width: 9%; }
.woflv-table col.c-action { width: 6%; }

.woflv-table th {
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .3px;
  border-bottom: 2px solid var(--line-strong);
  padding: 8px 10px;
  vertical-align: bottom;
}
.woflv-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.woflv-table tbody tr:hover { background: #fafbfd; }
.woflv-cell-result { text-align: right; }
.woflv-result {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  white-space: nowrap;
}
.woflv-cell-rule { max-width: 280px; }
.woflv-factor { display: block; font-size: 16px; }
.woflv-rule { display: block; font-size: 13px; color: var(--ink-soft); }
.woflv-detail { display: block; font-size: 12px; color: var(--ink-soft); }
.woflv-warning { display: block; font-size: 12px; color: var(--danger); font-weight: 600; }
.woflv-warning:empty { display: none; }
.woflv-remove {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.woflv-remove:hover { background: #fdeeec; border-color: #f2cdc8; }
.woflv-table tfoot td {
  border-top: 2px solid var(--line-strong);
  border-bottom: none;
  font-weight: 700;
  padding-top: 12px;
}
.woflv-table tfoot .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Print-only mirrors of the input values (kept out of the a11y tree). */
.woflv-print { display: none; }

/* ---------- Totals ---------- */
.totals {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: stretch;
  margin-top: 20px;
}
.total-box {
  flex: 1 1 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  background: #fbfcfe;
}
.total-box.is-primary { background: var(--accent-soft); border-color: #cfe0ff; }
.total-box .label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .3px; }
.total-box .value { display: block; font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.total-box.is-primary .value { color: var(--accent); }
.total-box .sub { display: block; font-size: 13px; color: var(--ink-soft); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.cta-row p { margin: 0; font-size: 15px; color: var(--ink-soft); flex: 1 1 260px; }

/* ---------- Article ---------- */
.article { padding: 8px 0 48px; }
.article h2 {
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.25;
  margin: 40px 0 12px;
  letter-spacing: -0.2px;
}
.article h3 { font-size: 19px; margin: 26px 0 8px; }
.article p, .article li { max-width: 72ch; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin-bottom: 8px; }
.article .lead-in { color: var(--ink-soft); }

.facts-table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
.facts-table caption { text-align: left; font-size: 14px; color: var(--ink-soft); padding-bottom: 8px; }
.facts-table th, .facts-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts-table thead th { border-bottom: 2px solid var(--line-strong); font-size: 13px; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-soft); }
.facts-table tbody th { font-weight: 600; }

.faq h3 { margin-top: 22px; }
.faq p { margin-top: 4px; }

.disclaimer {
  border-left: 4px solid var(--line-strong);
  background: var(--panel);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  font-size: 15px;
  color: var(--ink-soft);
}
.disclaimer strong { color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #c8cfdd;
  padding: 28px 0;
  font-size: 14px;
}
.site-footer a { color: #ffffff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.site-footer nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer p { margin: 0; }

/* ---------- Dachschrägen-Rechner ---------- */
.slope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 4px 0 18px;
}
.slope-grid .field input, .slope-grid .field select { width: 100%; }
.slope-out {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}
.slope-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--panel);
}
.slope-box.is-primary { background: var(--accent-soft); border-color: #cfe0ff; }
.slope-box .label {
  display: block; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px; color: var(--ink-soft);
}
.slope-box .value {
  display: block; font-size: 20px; font-weight: 700;
  font-variant-numeric: tabular-nums; line-height: 1.35;
}
.slope-box.is-primary .value { color: var(--accent); }
.slope-box .sub { display: block; font-size: 12px; color: var(--ink-soft); }
.slope-note { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }
.slope-status { font-size: 14px; font-weight: 600; color: var(--ok); min-height: 20px; margin: 10px 0 0; }
.slope-status:empty { margin: 0; }

/* ---------- Mobile: table becomes cards ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .table-scroll { overflow-x: visible; }
  .woflv-table { min-width: 0; }
  .woflv-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .woflv-table tr { display: block; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; padding: 6px 4px; background: var(--panel); }
  .woflv-table td { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding: 8px 10px; }
  .woflv-table tr td:last-child { border-bottom: none; }
  .woflv-table td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--ink-soft);
  }
  .woflv-cell-rule, .woflv-cell-result { align-items: flex-start; }
  .woflv-cell-rule { max-width: none; }
  .woflv-cell-result { justify-content: flex-start; }
  .woflv-table tfoot tr { border: none; background: transparent; padding: 0; }
  .woflv-table tfoot td { display: flex; justify-content: space-between; border-top: 1px solid var(--line-strong); }
  .woflv-table tfoot td::before { content: attr(data-label); }
  .woflv-table tfoot td:first-child { display: none; }
  .card { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .btn:active { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; font-size: 11pt; }
  .site-header, .site-footer, .site-nav, .cta-row, .badges,
  .noscript-note, .no-print, .woflv-cell-action, .tool-actions,
  .slope-card { display: none !important; }
  .article { display: none; }
  .card { box-shadow: none; border: none; padding: 0; margin: 0 0 12pt; }
  .hero { padding: 0 0 8pt; }
  .wrap { max-width: none; padding: 0; }
  input.woflv-input, select.woflv-input { display: none !important; }
  .woflv-print { display: inline; }
  .woflv-table { min-width: 0; font-size: 10pt; }
  .woflv-table td, .woflv-table th { padding: 4pt 6pt; }
  .woflv-table tbody tr { page-break-inside: avoid; }
  .totals { break-inside: avoid; }
  .total-box { border: 1px solid #999; background: #fff !important; }
  .total-box.is-primary .value { color: #000; }
  .print-only { display: block !important; }
  a[href]::after { content: ""; }
}
.print-only { display: none; }
