/* ============================================================
   NettoKlar – Brutto-Netto-Rechner 2026
   Design-Tokens: Light auf :root, Dark via prefers-color-scheme
   ============================================================ */

:root {
  --c-bg: #f4f6f5;
  --c-surface: #ffffff;
  --c-surface-2: #eaf1ee;
  --c-text: #1c2b27;
  --c-text-muted: #5b6f68;
  --c-accent: #0d7a63;
  --c-accent-strong: #0a5f4d;
  --c-accent-soft: #d7ece6;
  --c-warn: #b3541e;
  --c-border: #d5deda;
  --c-bar-tax: #b3541e;
  --c-bar-social: #1f6f8b;
  --c-bar-net: #0d7a63;
  --shadow: 0 1px 3px rgba(28, 43, 39, 0.08), 0 8px 24px rgba(28, 43, 39, 0.06);
  --radius: 14px;
  --font-body: "Spline Sans", "Segoe UI", system-ui, sans-serif;
  --font-num: "IBM Plex Mono", "Consolas", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #101816;
    --c-surface: #18221f;
    --c-surface-2: #1f2c28;
    --c-text: #e4ece9;
    --c-text-muted: #94a5a0;
    --c-accent: #34b394;
    --c-accent-strong: #5cc9ad;
    --c-accent-soft: #1d3730;
    --c-warn: #e08a52;
    --c-border: #2c3a36;
    --c-bar-tax: #e08a52;
    --c-bar-social: #5aa7c2;
    --c-bar-net: #34b394;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
}

.wrap {
  width: min(64rem, 100% - 2rem);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  flex: none;
}

.brand-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-sub {
  margin: 0;
  font-size: 0.8rem;
  color: var(--c-text-muted);
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding-block: 1.5rem 2.5rem;
}

@media (min-width: 56rem) {
  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: start;
  }
  .ad-slot { grid-column: 1 / -1; }
}

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1rem;
}

.per-month-note {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

/* ---------- Formular ---------- */

.field { margin-bottom: 1.1rem; }

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1rem;
}

@media (min-width: 34rem) {
  .field-grid { grid-template-columns: 1fr 1fr; }
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

input[type="number"],
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
}

input[type="number"]:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

.input-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.input-row input { flex: 1 1 auto; min-width: 0; }

.hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--c-text-muted);
}

.checks {
  border: 0;
  padding: 0;
  margin: 0 0 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
}

.check input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: var(--c-accent);
  flex: none;
}

.check small {
  display: block;
  font-weight: 400;
  color: var(--c-text-muted);
}

/* ---------- Segmented Buttons ---------- */

.segmented {
  display: inline-flex;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  flex: none;
}

.seg-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

.seg-btn.is-active {
  background: var(--c-surface);
  color: var(--c-accent-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* ---------- Ergebnis ---------- */

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.result-head h2 { margin: 0; }

.netto-label {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.netto-big {
  margin: 0.15rem 0 0;
  font-family: var(--font-num);
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-weight: 600;
  color: var(--c-accent);
  letter-spacing: -0.02em;
}

.netto-year {
  margin: 0.25rem 0 0;
  color: var(--c-text-muted);
  font-size: 0.95rem;
}

.netto-year strong { font-family: var(--font-num); font-weight: 600; }

/* ---------- Balken ---------- */

.bars { display: grid; gap: 0.65rem; }

.bar-row { display: grid; gap: 0.2rem; }

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.bar-name { font-weight: 600; }

.bar-value {
  font-family: var(--font-num);
  font-weight: 600;
  white-space: nowrap;
}

.bar-track {
  height: 0.65rem;
  border-radius: 999px;
  background: var(--c-surface-2);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
  transition: width 0.25s ease;
}

.bar-fill.tax { background: var(--c-bar-tax); }
.bar-fill.social { background: var(--c-bar-social); }
.bar-fill.net { background: var(--c-bar-net); }
.bar-fill.employer { background: var(--c-bar-social); }
.bar-fill.gross { background: var(--c-bar-net); }

/* ---------- Summen ---------- */

.totals {
  margin: 1.25rem 0 0;
  border-top: 1px solid var(--c-border);
  padding-top: 0.75rem;
  display: grid;
  gap: 0.35rem;
}

.totals > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.totals dt { color: var(--c-text-muted); font-size: 0.9rem; }

.totals dd {
  margin: 0;
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 0.95rem;
}

.totals-strong dt,
.totals-strong dd {
  color: var(--c-text);
  font-weight: 700;
}

/* ---------- Disclaimer ---------- */

.disclaimer {
  margin: 1.5rem 0 0;
  padding: 0.9rem 1rem;
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--c-text-muted);
  background: var(--c-surface-2);
  border-left: 4px solid var(--c-warn);
  border-radius: 8px;
}

/* ---------- Ad-Slot ---------- */

.ad-slot {
  min-height: 6rem;
  border: 1px dashed var(--c-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface);
}

.ad-hint {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

/* ---------- Buttons ---------- */

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn:disabled { cursor: not-allowed; opacity: 0.6; }

.btn-primary {
  background: var(--c-accent);
  color: #fff;
}

.btn-primary:not(:disabled):hover { background: var(--c-accent-strong); }

.btn-ghost {
  background: transparent;
  color: var(--c-accent-strong);
  border-color: var(--c-border);
}

.btn-ghost:hover { background: var(--c-accent-soft); }

.link-btn {
  font: inherit;
  font-size: 0.9rem;
  color: var(--c-accent-strong);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-block: 1.1rem;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

.footer-inner p { margin: 0; }

.footer-inner nav { display: flex; gap: 1rem; }

/* ---------- Modale ---------- */

.modal {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  padding: 0;
  width: min(28rem, calc(100% - 2rem));
  box-shadow: var(--shadow);
}

.modal::backdrop { background: rgba(10, 18, 16, 0.55); }

.modal-body { padding: 1.5rem; }

.modal-body h2 { margin-top: 0; }

.modal-body code {
  font-family: var(--font-num);
  font-size: 0.85em;
  background: var(--c-surface-2);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.feature-list {
  margin: 0.75rem 0;
  padding-left: 1.2rem;
}

.feature-list li { margin-bottom: 0.3rem; }

.price { font-size: 1.05rem; }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* ---------- Erste-Schritte-Hilfe ---------- */

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: none;
}

.help-btn {
  inline-size: 2rem;
  block-size: 2rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-muted);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.help-btn:hover,
.help-btn:focus-visible {
  color: var(--c-accent);
  border-color: var(--c-accent);
}

.tour-intro { color: var(--c-text-muted); }

.tour-steps {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.6rem;
}

.tour-steps li strong { color: var(--c-accent-strong); }

.know-box {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.know-box h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.know-box ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.4rem;
}

.know-box li {
  font-size: 0.9rem;
  color: var(--c-text-muted);
}
