/* brutto-netto-rechner-2027.de – „Der Gehaltsstreifen“
   Archivo (variable Breite): Fließtext normal, Überschriften etwas breiter, der Nettobetrag ganz breit.
   Kobalt = was Ihnen bleibt, Senf = Steuern, Taubenblau = Sozialabgaben.
   Ein Merkmal: der Streifen, der den Bruttolohn aufteilt. Alles andere bleibt ruhig. */

@font-face {
  font-family: "Archivo"; src: url("/fonts/archivo-var.woff2") format("woff2");
  font-weight: 400 800; font-stretch: 88% 125%; font-display: swap;
}
@font-face {
  /* Ersatzschrift mit angeglichenen Maßen, damit beim Nachladen nichts springt */
  font-family: "Archivo Fallback"; src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans");
  size-adjust: 104%; ascent-override: 88%; descent-override: 22%;
}

:root {
  --tinte-l: #1d2433;   --tinte-d: #e7eaf1;
  --leise-l: #56607a;   --leise-d: #a7b0c4;
  --papier-l: #f4f6fa;  --papier-d: #0f131b;
  --flaeche-l: #ffffff; --flaeche-d: #171c27;
  --linie-l: #dde2ec;   --linie-d: #2b3243;
  --kobalt-l: #2346d8;  --kobalt-d: #93a9ff;
  --kobalt-stark-l: #1a35a8; --kobalt-stark-d: #c0ceff;
  --auf-kobalt-l: #ffffff;   --auf-kobalt-d: #0e1433;
  --senf-l: #e3a521;    --senf-d: #f0bb45;
  --taube-l: #a9b6cd;   --taube-d: #5b6784;
  --plus-l: #11784a;    --plus-d: #74d6a4;
  --minus-l: #b42318;   --minus-d: #ff9d92;
  --fehler-bg-l: #fcebea; --fehler-bg-d: #3a1f22;

  --tinte: var(--tinte-l); --leise: var(--leise-l); --papier: var(--papier-l); --flaeche: var(--flaeche-l);
  --linie: var(--linie-l); --kobalt: var(--kobalt-l); --kobalt-stark: var(--kobalt-stark-l); --auf-kobalt: var(--auf-kobalt-l);
  --senf: var(--senf-l); --taube: var(--taube-l); --plus: var(--plus-l); --minus: var(--minus-l); --fehler-bg: var(--fehler-bg-l);
  --logo-bg: #2346d8; --logo-fg: #ffffff; --logo-flame: #f2b632;

  @media (prefers-color-scheme: dark) {
    --tinte: var(--tinte-d); --leise: var(--leise-d); --papier: var(--papier-d); --flaeche: var(--flaeche-d);
    --linie: var(--linie-d); --kobalt: var(--kobalt-d); --kobalt-stark: var(--kobalt-stark-d); --auf-kobalt: var(--auf-kobalt-d);
    --senf: var(--senf-d); --taube: var(--taube-d); --plus: var(--plus-d); --minus: var(--minus-d); --fehler-bg: var(--fehler-bg-d);
    --logo-bg: #93a9ff; --logo-fg: #0e1433; --logo-flame: #f0bb45;
  }

  /* Typografische Skala (Verhältnis 1,25) */
  --s-0: 1.125rem;
  --s-1: 1.406rem;
  --s-2: 1.758rem;
  --s-3: clamp(2.1rem, 1.55rem + 2.3vw, 2.75rem);
  --s-netto: clamp(2.6rem, 1.9rem + 3.4vw, 4rem);
  --mass: 68ch;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  color-scheme: light dark;
  accent-color: var(--kobalt);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Archivo", "Archivo Fallback", system-ui, sans-serif;
  font-size: var(--s-0);
  font-weight: 400;
  font-stretch: 100%;
  line-height: 1.6;
  color: var(--tinte);
  background: var(--papier);
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--kobalt); text-underline-offset: .18em; text-decoration-thickness: .07em; transition: color 150ms ease; }
@media (hover: hover) and (pointer: fine) { a:hover { color: var(--kobalt-stark); } }
a, button, summary, select, label { touch-action: manipulation; }
h1, h2, h3, .brand, nav.main, th, .netto-betrag { hyphens: manual; }
:focus-visible { outline: 3px solid var(--kobalt); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--flaeche); padding: .5rem 1rem; z-index: 10; }

.wrap { max-width: 74rem; margin: 0 auto; padding: 0 1.5rem; }

header.site { background: var(--flaeche); border-bottom: 1px solid var(--linie); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 2rem; padding-block: .9rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 750; font-stretch: 108%; font-size: 1.1rem; color: var(--tinte); text-decoration: none; }
.brand .logo { inline-size: 2.1rem; block-size: 2.1rem; flex: none; }
nav.main ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.3rem; font-size: 1.02rem; }
nav.main a { color: var(--tinte); text-decoration: none; text-underline-offset: .45em; text-decoration-thickness: 2px; }
@media (hover: hover) and (pointer: fine) { nav.main a:hover { color: var(--kobalt); } }
nav.main a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--kobalt); font-weight: 650; }

main { padding: 1.5rem 0 4rem; }
main .wrap > * { max-width: var(--mass); }
main .wrap > :is(.rechner, .breit) { max-width: none; }
main .wrap > .table-wrapper { max-width: 62rem; }
h1 { font-size: var(--s-3); line-height: 1.1; font-weight: 780; font-stretch: 112%; letter-spacing: -.015em; margin: .6rem 0 .7rem; text-wrap: balance; }
h2 { font-size: var(--s-2); line-height: 1.2; font-weight: 750; font-stretch: 110%; letter-spacing: -.01em; margin: 2.8rem 0 .7rem; text-wrap: balance; }
h3 { font-size: var(--s-1); line-height: 1.3; font-weight: 650; font-stretch: 105%; margin: 2rem 0 .4rem; }
p, li { text-wrap: pretty; }
.lead { font-size: var(--s-1); line-height: 1.45; color: var(--leise); margin-top: 0; hyphens: manual; }
.breadcrumb { font-size: .98rem; color: var(--leise); margin-top: .5rem; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; }
.breadcrumb li + li::before { content: "›"; margin: 0 .5rem; }
.stand { font-size: .98rem; color: var(--leise); margin-top: 3rem; }
.note { border-left: 3px solid var(--senf); padding: .1rem 0 .1rem 1.1rem; margin: 2rem 0; }
.note p { margin: .4rem 0; }
.sources li { margin: .4rem 0; }
.links-raster { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .35rem 1.2rem; max-width: none; }
.links-raster a { font-weight: 550; }
.weiter { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; margin-top: 2rem; }

/* ── Rechner: Formular links, Ergebnis rechts ── */
.rechner { display: grid; gap: 2rem; align-items: start; margin-block: 1.2rem 2.5rem; }
@media (width >= 60rem) {
  .rechner { grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); gap: 3rem; }
  .rechner #result { position: sticky; top: 1.5rem; }
}
form.calc { background: var(--flaeche); border: 1px solid var(--linie); padding: 1.3rem 1.4rem 1.5rem; border-radius: .75rem; }
form.calc .feld, form.calc fieldset, form.calc .check { margin-top: 1.05rem; }
form.calc > .feld:first-of-type { margin-top: 0; }
form.calc label, form.calc legend { font-weight: 600; }
form.calc .feld > label { display: block; }
form.calc .hint { display: block; color: var(--leise); font-size: .93rem; line-height: 1.4; }
form.calc fieldset { border: 0; padding: 0; margin-inline: 0; min-inline-size: 0; }
form.calc legend { padding: 0; margin-bottom: .3rem; }
.eingabe { position: relative; display: block; margin-top: .3rem; }
.eingabe input { font: inherit; font-weight: 600; inline-size: 100%; padding: .55rem 2.2rem .55rem .7rem;
  border: 2px solid var(--linie); border-radius: .45rem; background: var(--flaeche); color: var(--tinte); }
.eingabe .einheit { position: absolute; inset-inline-end: .8rem; inset-block: 0; display: grid; place-items: center; color: var(--leise); pointer-events: none; }
#brutto, #netto, #brutto1 { font-size: 1.4rem; font-stretch: 110%; }
form.calc select { font: inherit; inline-size: 100%; margin-top: .3rem; padding: .5rem .6rem; border: 2px solid var(--linie);
  border-radius: .45rem; background: var(--flaeche); color: var(--tinte); }
form.calc :is(input, select):focus-visible { border-color: var(--kobalt); outline-offset: 1px; }

/* Umschalter (Radiogruppe als Leiste) */
.umschalter > div { display: flex; border: 2px solid var(--linie); border-radius: .5rem; padding: 2px; gap: 2px; background: var(--papier); }
.umschalter label { flex: 1 1 0; position: relative; display: grid; cursor: pointer; font-weight: 500; }
.umschalter input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.umschalter span { display: grid; place-items: center; min-block-size: 2.5rem; padding: .2rem .5rem; border-radius: .35rem; text-align: center; line-height: 1.2; }
.umschalter input:checked + span { background: var(--kobalt); color: var(--auf-kobalt); font-weight: 650; }
.umschalter input:focus-visible + span { outline: 3px solid var(--kobalt); outline-offset: 2px; }
.umschalter.stkl span { font-stretch: 112%; font-weight: 650; font-size: 1.1rem; }
@media (prefers-reduced-motion: no-preference) { .umschalter span { transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out); } }

.check { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; font-weight: 500 !important; line-height: 1.4; }
.check input { inline-size: 1.2rem; block-size: 1.2rem; margin: .12rem 0 0; flex: none; }
.nur-kinderlos { display: none; }
form:has(#kinder option[value="0"]:checked) .nur-kinderlos { display: flex; }
.nur-privat { display: none; }
form:has(input[name="kv"][value="privat"]:checked) .nur-privat { display: block; }
form:has(input[name="kv"][value="privat"]:checked) .nur-gesetzlich { display: none; }

details.weitere { margin-top: 1.2rem; border-top: 1px solid var(--linie); padding-top: .8rem; }
details.weitere > summary { font-size: 1.05rem; font-weight: 650; }
.weitere-inhalt { padding-bottom: .2rem; }

form.calc button {
  font: inherit; font-weight: 650; font-stretch: 105%; inline-size: 100%; margin-top: 1.4rem; padding: .8rem 1.3rem; border: 0;
  border-radius: .5rem; background: var(--kobalt); color: var(--auf-kobalt); cursor: pointer; transition: background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) { form.calc button:hover { background: var(--kobalt-stark); } }
@media (prefers-reduced-motion: no-preference) {
  form.calc button { transition: transform 160ms var(--ease-out), background-color 150ms ease; }
  form.calc button:active { transform: scale(0.97); }
}
form.calc .error-msg { display: none; color: var(--minus); font-size: .93rem; margin-top: .25rem; }
form.calc input:user-invalid { border-color: var(--minus); background-color: var(--fehler-bg); }
form.calc .feld:has(input:user-invalid) .error-msg { display: block; }
form.calc .user-invalid-fallback { border-color: var(--minus); background-color: var(--fehler-bg); }
form.calc .feld:has(.user-invalid-fallback) .error-msg { display: block; }

/* ── Ergebnis: der Gehaltsstreifen ── */
#result { container-type: inline-size; }
#result:focus-visible { outline-offset: 6px; }
.ergebnis { background: var(--flaeche); border: 1px solid var(--linie); border-radius: .75rem; padding: 1.4rem 1.5rem 1.2rem; }
.ergebnis .kopf { margin: 0; font-weight: 600; color: var(--leise); }
.netto-betrag { margin: .1rem 0 .2rem; font-size: var(--s-netto); line-height: 1.05; font-weight: 800; font-stretch: 125%; letter-spacing: -.02em; color: var(--kobalt); }
@container (width < 26rem) { .netto-betrag { font-size: 2.5rem; font-stretch: 115%; } }
.ergebnis .fuer { margin: 0 0 .6rem; color: var(--leise); }
.streifen { display: block; inline-size: 100%; block-size: 2.6rem; margin: .9rem 0 .55rem; border-radius: .45rem; overflow: hidden; background: var(--linie); }
.s-netto { fill: var(--kobalt); }
.s-steuer { fill: var(--senf); }
.s-sozial { fill: var(--taube); }
.legende { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem 1.3rem; font-size: 1rem; color: var(--leise); }
.legende li { display: inline-flex; align-items: center; gap: .4rem; }
.legende li::before { content: ""; inline-size: .8rem; block-size: .8rem; border-radius: 2px; background: var(--c); }
.legende b { color: var(--tinte); font-weight: 650; }
.l-netto { --c: var(--kobalt); } .l-steuer { --c: var(--senf); } .l-sozial { --c: var(--taube); }
.vergleich { margin: 1rem 0 0; padding: .45rem .75rem; border-radius: .4rem; background: var(--papier); font-size: 1rem; }
.vergleich.plus b { color: var(--plus); }
.vergleich.minus b { color: var(--minus); }
table.abzuege { margin-top: 1.1rem; font-size: 1.02rem; }
table.abzuege caption { caption-side: top; text-align: left; font-size: .95rem; color: var(--leise); padding: 0 0 .35rem; }
table.abzuege th { font-weight: 400; padding-inline-end: 1rem; }
table.abzuege td { text-align: right; white-space: nowrap; padding-inline-end: 0; }
table.abzuege .z-steuer th, table.abzuege .z-sozial th { padding-inline-start: 1.1rem; position: relative; }
table.abzuege .z-steuer th::before, table.abzuege .z-sozial th::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 50%; inline-size: .55rem; block-size: .55rem; translate: 0 -50%; border-radius: 1px; background: var(--c);
}
.z-steuer { --c: var(--senf); } .z-sozial { --c: var(--taube); }
table.abzuege .z-brutto :is(th, td) { font-weight: 650; }
table.abzuege .z-netto :is(th, td) { font-weight: 750; border-top: 2px solid var(--tinte); border-bottom: 0; color: var(--kobalt); font-size: 1.1rem; }
.ergebnis .hinweis, .ergebnis .jahr { font-size: .95rem; color: var(--leise); margin: .8rem 0 0; }
table.kombis { margin-top: 1rem; font-size: 1rem; }
table.kombis td { text-align: right; white-space: nowrap; }
table.kombis th[scope="col"]:not(:first-child) { text-align: right; }
table.kombis .beste :is(th, td) { font-weight: 750; color: var(--kobalt); }

/* Mitlaufende Ergebniszeile auf schmalen Bildschirmen: klebt unten, solange das Formular zu sehen ist,
   und landet an ihrem Platz direkt über dem Ergebnis */
.netto-leiste { display: none; }
@media (width < 60rem) {
  .netto-leiste {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; position: sticky; bottom: .75rem; z-index: 2;
    margin-block: -1rem -.5rem; padding: .7rem 1rem; border-radius: .6rem; background: var(--kobalt); color: var(--auf-kobalt);
    text-decoration: none; box-shadow: 0 6px 20px -6px rgb(20 30 80 / .45);
  }
  .netto-leiste .leiste-text { font-size: .95rem; }
  .netto-leiste b { font-weight: 800; font-stretch: 115%; font-size: 1.25rem; white-space: nowrap; }
  @media (hover: hover) and (pointer: fine) { .netto-leiste:hover { color: var(--auf-kobalt); background: var(--kobalt-stark); } }
}

/* Streifen in Tabellen der Gehaltsseiten */
.mini { display: block; inline-size: 100%; min-inline-size: 6rem; block-size: .7rem; border-radius: 3px; overflow: hidden; background: var(--linie); }

/* ── Tabellen (modern-web-guidance: responsive-table) ── */
table { border-collapse: collapse; width: 100%; font-size: 1.02rem; }
th, td { text-align: left; vertical-align: top; padding: .5rem .8rem .5rem 0; border-bottom: 1px solid var(--linie); }
thead th { font-weight: 700; border-bottom: 2px solid var(--tinte); }
caption { text-align: left; caption-side: bottom; padding-top: .6rem; font-size: .95rem; color: var(--leise); }
.table-wrapper { overflow: auto; max-inline-size: 100%; container-type: inline-size; margin: 1.2rem 0; }
.table-wrapper table { margin: 0; border-collapse: separate; border-spacing: 0; }
.table-wrapper tbody th { font-weight: 600; background: var(--papier); position: sticky; inset-inline-start: 0; }
.table-wrapper td.zahl, .table-wrapper th.zahl { text-align: right; white-space: nowrap; }
.table-wrapper .betont { font-weight: 700; color: var(--kobalt); }
.table-wrapper .plus { color: var(--plus); }
.table-wrapper .minus { color: var(--minus); }
.table-wrapper:focus-visible { outline-offset: 4px; }
@container (width < 30rem) {
  .table-wrapper table, .table-wrapper tbody, .table-wrapper tr, .table-wrapper th, .table-wrapper td { display: block; }
  .table-wrapper thead { display: none; }
  .table-wrapper caption { display: block; padding: .6rem 0 0; }
  .table-wrapper tr { padding: .5rem 0; border-bottom: 1px solid var(--linie); }
  .table-wrapper th, .table-wrapper td { border: 0; padding: .1rem 0; }
  .table-wrapper td.zahl { text-align: left; }
  .table-wrapper tbody th { position: static; }
  .table-wrapper td[data-label]::before { content: attr(data-label) ": "; color: var(--leise); }
  .table-wrapper tbody th[data-label]::before { content: attr(data-label) ": "; color: var(--leise); font-weight: 400; }
}

/* ── Häufige Fragen (modern-web-guidance: accordion) ── */
details { border-bottom: 1px solid var(--linie); padding: .9rem 0; }
.faq details:first-of-type { border-top: 1px solid var(--linie); }
details.weitere { border-bottom: 0; padding-bottom: 0; }
summary { list-style: none; display: flex; align-items: baseline; gap: .6ch; cursor: pointer; font-weight: 700; font-size: 1.22rem; line-height: 1.35; }
summary::-webkit-details-marker { display: none; }
summary::before {
  content: ""; inline-size: .6em; block-size: .6em; flex-shrink: 0; background-color: var(--kobalt); translate: 0 .05em;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 8l8 8 8-8' fill='none' stroke='black' stroke-width='3.5'/%3E%3C/svg%3E") no-repeat center / contain;
  rotate: -90deg;
}
details[open] > summary::before { rotate: 0deg; }
details > p { margin: .7rem 0 .2rem; }
details::details-content { interpolate-size: allow-keywords; overflow: clip; contain: layout; }
details:not([open])::details-content { block-size: 0; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  summary::before { transition: rotate 200ms var(--ease-out); }
  details::details-content {
    transition: block-size 220ms var(--ease-out), opacity 220ms var(--ease-out), content-visibility 220ms;
    transition-behavior: allow-discrete;
  }
}
@media (prefers-reduced-motion: reduce) {
  details::details-content { transition: opacity 150ms var(--ease-out), content-visibility 150ms; transition-behavior: allow-discrete; }
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important; clip-path: inset(50%) !important; overflow: hidden !important;
  width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important;
  border: 0 !important; white-space: nowrap !important;
}

footer.site { background: var(--flaeche); border-top: 1px solid var(--linie); font-size: .98rem; color: var(--leise); padding: 2rem 0 2.5rem; }
footer.site p { max-width: var(--mass); margin: 0; }
footer.site ul { list-style: none; padding: 0; margin: .7rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; }

/* ── Bewegung: ein Moment ──
   Nach einer Eingabe wächst der Streifen von links auf: erst das Netto, dann Steuern, dann Abgaben.
   Nur bei Antwort auf eine Aktion, nicht beim Laden. Bei reduzierter Bewegung: nur Einblenden. */
@keyframes wachsen { from { transform: scaleX(0); } }
@keyframes einblenden { from { opacity: 0; } }
.streifen rect { transform-box: fill-box; transform-origin: left center; }
@media (prefers-reduced-motion: no-preference) {
  .ergebnis.animate .streifen rect { animation: wachsen 560ms var(--ease-out) both; }
  .ergebnis.animate .streifen .s-steuer { animation-delay: 70ms; }
  .ergebnis.animate .streifen .s-sozial { animation-delay: 120ms; }
  .ergebnis.animate .netto-betrag { animation: einblenden 240ms var(--ease-out) both; }
}
@media (prefers-reduced-motion: reduce) {
  .ergebnis.animate .streifen { animation: einblenden 200ms ease both; }
}

/* Navigation auf schmalen Bildschirmen: eine Zeile, seitlich scrollbar, weiche Ränder nur dort, wo mehr kommt
   (modern-web-guidance: scrollability-affordance-hints; Scrollbalken bleibt sichtbar) */
@property --fade-start { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --fade-end { syntax: "<length>"; inherits: false; initial-value: 0px; }
@keyframes reveal-fade-start { to { --fade-start: var(--fade-size); } }
@keyframes hide-fade-end { from { --fade-end: var(--fade-size); } }
@media (width < 52rem) {
  header.site .wrap { row-gap: .3rem; }
  nav.main {
    inline-size: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin;
    padding-block: .45rem .55rem; scroll-padding-inline: 2rem;
    --fade-size: 2rem;
    mask:
      linear-gradient(black, black) no-clip subtract,
      linear-gradient(to right, black, transparent) 0 0 / var(--fade-start) 100% no-repeat no-clip,
      linear-gradient(to right, transparent, black) 100% 0 / var(--fade-end) 100% no-repeat no-clip;
    animation: reveal-fade-start linear both, hide-fade-end linear both;
    animation-timeline: scroll(self inline);
    animation-range: 0 var(--fade-size), calc(100% - var(--fade-size)) 100%;
  }
  nav.main ul { flex-wrap: nowrap; }
  nav.main li { flex: none; white-space: nowrap; }
}
@media (width < 30rem) {
  .wrap { padding: 0 1rem; }
  form.calc, .ergebnis { padding-inline: 1rem; }
}
