/* Author: Fabian Bitter (fabian@bitter.de) */

:root {
  --brand: #16a34a;
  --brand-strong: #15803d;
  --brand-tint: #ecfdf3;
  --danger: #dc2626;
  --bg: #ffffff;
  --bg-subtle: #f6f8f7;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --radius: 10px;
  --radius-pill: 999px;
  --container: 72rem;
  --header-h: 3.5rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  font-size: clamp(16px, 2.5vw, 17px);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

/* ---------------------------------------------------------------- hero */

.hero {
  padding: 6.5rem 0 4.25rem;
  text-align: center;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
  font-weight: 800;
}

h1 span { color: var(--brand); }

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0;
}

h2 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
  font-weight: 800;
}

.section { padding: 2.5rem 0; }
.section.subtle { background: var(--bg-subtle); }

/* the display property of layout classes must never beat the hidden attribute */
[hidden] { display: none !important; }

/* work-related inputs greyed out when unemployed is selected */
.is-disabled { opacity: 0.4; pointer-events: none; }

/* ---------------------------------------------------------------- input row */

.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
  align-items: end;
}

.input-field { flex: 1 1 12rem; min-width: 0; }

.input-field:first-child { flex: 1 1 20rem; }

.filter-field { flex: 0 0 auto; }

.segmented.block { display: flex; width: 100%; }
.segmented.block button {
  flex: 1;
  height: 3rem;
  padding: 0 0.9rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.input-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.55rem;
  white-space: nowrap;
}

.filter-field > label { color: transparent; } /* keep the button baseline-aligned */

/* all top controls share one exact outer height */
.stepper.big,
.segmented.block,
.filter-btn { height: 3.1rem; box-sizing: border-box; }

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0 1.3rem;
  cursor: pointer;
  white-space: nowrap;
}

.filter-btn:hover { border-color: var(--text); }

.stepper.big { width: 100%; justify-content: space-between; overflow: hidden; }
.stepper.big input[type="number"] {
  width: auto;
  flex: 1;
  min-width: 0; /* let the input shrink so the + button never gets pushed out */
  height: 100%;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
}
.stepper.big button { width: 3rem; height: 100%; flex-shrink: 0; }

.segmented.block button { height: 100%; }

@media (max-width: 46rem) {
  .input-field, .input-field:first-child { flex: 1 1 100%; }
  .filter-field > label { display: none; }
  .filter-btn { width: 100%; }
}

/* ---------------------------------------------------------------- filter dropdown */

.filter-field { position: relative; }

.filter-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 15; /* below the fixed header (20) so it slides under it on scroll */
  width: min(34rem, 86vw);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

/* the little triangle that docks the dropdown to its button */
.filter-dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 3.5rem;
  width: 15px;
  height: 15px;
  background: var(--bg);
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
  transform: rotate(45deg);
}

@media (max-width: 46rem) {
  .filter-dropdown { right: 0; left: 0; width: auto; }
  .filter-dropdown::before { right: 2.5rem; }
}

.popover-body { overflow-y: auto; padding: 1rem 1.1rem; }

/* compact everything inside the popover so it fits without scrolling */
.popover-body .quick-grid { gap: 0.8rem; }
.popover-body .quick-label { font-size: 0.88rem; }
.popover-body .quick-label small { font-size: 0.78rem; }
.popover-body .segmented button { padding: 0.4rem 0.75rem; font-size: 0.82rem; }
.popover-body .stepper button { width: 2.1rem; height: 2.1rem; font-size: 1.05rem; }
.popover-body .stepper input[type="number"] { width: 3.4rem; font-size: 0.9rem; }
.popover-body .check { font-size: 0.88rem; }
.popover-body .sub-rows { gap: 0.6rem; }
.popover-body .hint-row { font-size: 0.78rem; }

.popover-foot {
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--border);
}

.popover-foot .calc-btn { width: 100%; font-size: 1rem; padding: 0.65rem; }

/* ---------------------------------------------------------------- quick inputs */

.quick-grid { display: grid; gap: 1.4rem; }

.quick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.quick-label { font-weight: 700; min-width: 0; }

.quick-label small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
  flex-shrink: 0;
}

.segmented button {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: none;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.segmented button + button { border-left: 1px solid var(--border); }

.segmented button:hover { color: var(--text); }

.segmented button.active { background: var(--brand); color: #fff; }

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.stepper button {
  font: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  background: none;
  border: none;
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
  border-radius: 50%;
}

.stepper button:hover { color: var(--brand-strong); }

.stepper output {
  min-width: 4.2rem;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stepper input[type="number"] {
  width: 5.5rem;
  border: none;
  border-radius: 0;
  background: none;
  text-align: center;
  padding: 0.4rem 0;
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper input[type="number"]::-webkit-outer-spin-button,
.stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper input[type="number"]:focus { outline: none; }

.sub-rows {
  display: grid;
  gap: 1.1rem;
  border-left: 3px solid var(--brand);
  padding-left: 1rem;
  margin: -0.3rem 0;
}

.hint-row { font-size: 0.875rem; color: var(--muted); line-height: 1.4; }

.checks { display: grid; gap: 0.7rem; justify-items: start; }

.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}

.check span { line-height: 1; }

.check input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--brand);
  flex-shrink: 0;
}

input[type="number"] {
  width: 8rem;
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.9rem;
}

input[type="number"]:focus,
.segmented button:focus-visible,
.stepper button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.small { font-size: 0.875rem; color: var(--muted); }

.verdict {
  font-size: clamp(1.4rem, 3.2vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-align: center;
  margin: 0 0 1.75rem;
}

.center { text-align: center; }

.share-prompt {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 0.9rem;
}

.verdict strong { color: var(--brand-strong); font-variant-numeric: tabular-nums; }

.verdict.bad strong { color: var(--danger); }

.calc-btn {
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.9rem 2.5rem;
  cursor: pointer;
  width: 100%;
}

.calc-btn:hover { background: var(--brand-strong); }

/* ---------------------------------------------------------------- price tiles */

.tiles {
  display: grid;
  gap: 1.5rem;
  align-items: stretch;
}

@media (min-width: 48rem) {
  .tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


.tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  background: var(--bg);
}

/* uniform head so all three tables start at the same line */
.tile-head {
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 0.9rem;
  margin-bottom: 0.4rem;
}

.tile-title { font-weight: 800; font-size: 1.05rem; }

/* fixed heights on every head element so both tiles' heads match exactly and
   the two tables line up row for row */
.tile-msg {
  min-height: 3.9em;
  margin-top: 0.15rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.35;
}

.tile-msg.bad { color: var(--danger); font-weight: 700; }

.tile-amount {
  min-height: 3.9rem;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin-top: 0.35rem;
}

.tile-amount small {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  margin-top: 0.15rem;
}

.tile-amount.up { color: var(--brand-strong); }
.tile-amount.down { color: var(--danger); }
.tile-amount.statement { font-size: 1.5rem; line-height: 1.25; }

.tile-sub {
  min-height: 2.7em;
  margin-top: 0.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.tile-sub.up { color: var(--brand-strong); }
.tile-sub.down { color: var(--danger); }

.tile table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }

.tile td { padding: 0.3rem 0; vertical-align: top; }

.tile td:first-child { color: var(--muted); padding-right: 0.75rem; }

.tile td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* section headers inside the table, always left aligned */
.tile tr.group td,
.tile tr.group td:last-child {
  text-align: left;
  padding: 0.85rem 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.tile tr.emph td {
  font-weight: 800;
  color: var(--text);
  border-top: 1px solid var(--border-strong);
  padding-top: 0.5rem;
}

.tile td.neg { color: var(--danger); font-weight: 600; }
.tile td.pos { color: var(--text); }

.tile .free { color: var(--brand-strong); font-weight: 800; }
.tile .counted { color: var(--muted); font-style: italic; }

/* the reference (Buergergeld) tile is the calm, green, positive one */
.tile.reference { background: var(--bg-subtle); border-color: var(--brand); }
.tile.reference .tile-head { border-bottom-color: var(--brand); }
.tile-amount.ref { color: var(--text); }

/* ---------------------------------------------------------------- faq */

.accordion { border-top: 1px solid var(--border); }

.faq-item { border-bottom: 1px solid var(--border); }

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: none;
  border: none;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  padding: 1rem 0;
  cursor: pointer;
}

.faq-q svg { flex-shrink: 0; color: var(--muted); transition: transform 0.15s ease-out; }

.faq-item.open .faq-q svg { transform: rotate(180deg); }

.faq-a {
  display: none;
  padding: 0 0 1.1rem;
  color: var(--muted);
  line-height: 1.55;
}

.faq-item.open .faq-a { display: block; }

/* ---------------------------------------------------------------- carousel dots */

.dots { display: none; }

/* ---------------------------------------------------------------- share */

.share-text {
  font-size: 1.1rem;
  font-weight: 600;
  border-left: 4px solid var(--brand);
  padding-left: 1rem;
  margin: 0 0 1.5rem;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
}

.share-btn:hover { border-color: var(--text); }

.share-btn svg { width: 18px; height: 18px; }

.share-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }

.share-btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }

/* ---------------------------------------------------------------- prose */

.prose p { margin: 0 0 1rem; }
.prose ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.prose li { margin-bottom: 0.35rem; }
.prose a { color: var(--brand-strong); }

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 0.875rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

.back-to-top:hover { color: var(--text); border-color: var(--text); }

.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }

.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 40rem) {
  .footer-links { flex-direction: column; gap: 0.5rem; }
  .quick-row { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- mobile carousel */

@media (max-width: 47.99rem) {
  /* keep font >= 16px so iOS does not auto-zoom on input focus (pinch-zoom stays on) */
  input[type="number"],
  .popover-body .stepper input[type="number"] { font-size: 16px; }

  /* results become a swipeable carousel, the own scenario shown first */
  .tiles.two {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    margin: 0 -1.25rem;
    padding: 0 1.25rem 0.25rem;
    scrollbar-width: none;
  }
  .tiles.two::-webkit-scrollbar { display: none; }
  .tiles.two .tile { flex: 0 0 86%; scroll-snap-align: center; }
  .tiles.two .tile:nth-child(1) { order: 2; }
  .tiles.two .tile:nth-child(2) { order: 1; }

  .dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.9rem; }
  .dots button {
    width: 9px; height: 9px; border-radius: 50%;
    border: none; padding: 0; cursor: pointer;
    background: var(--border-strong);
  }
  .dots button.active { background: var(--brand); }
}


/* Cookie consent (vanilla-cookieconsent v3) — mirrors the fonella / follower.kaufen banner:
   a wide, bottom-centered box with the site's button hierarchy. Selectors match the library's
   real class names and specificity so the overrides win. */
#cc-main {
  --cc-font-family: var(--font-sans);
  --cc-bg: #ffffff;
  --cc-primary-color: var(--text);
  --cc-secondary-color: var(--muted);

  /* Primary button = the site's green CTA. */
  --cc-btn-primary-bg: var(--brand);
  --cc-btn-primary-border-color: var(--brand);
  --cc-btn-primary-color: #ffffff;
  --cc-btn-primary-hover-bg: var(--brand-strong);
  --cc-btn-primary-hover-border-color: var(--brand-strong);
  --cc-btn-primary-hover-color: #ffffff;

  /* Secondary buttons = ghost: transparent, hairline border, brand on hover. */
  --cc-btn-secondary-bg: transparent;
  --cc-btn-secondary-border-color: var(--border-strong);
  --cc-btn-secondary-color: var(--text);
  --cc-btn-secondary-hover-bg: var(--bg-subtle);
  --cc-btn-secondary-hover-border-color: var(--brand);
  --cc-btn-secondary-hover-color: var(--brand-strong);

  --cc-btn-border-radius: var(--radius);
  --cc-modal-border-radius: 14px;
  --cc-modal-margin: 1rem;
  --cc-separator-border-color: var(--border);
  --cc-toggle-on-bg: var(--brand);
  --cc-toggle-readonly-bg: var(--border-strong);
  --cc-link-color: var(--brand-strong);
  --cc-cookie-category-block-bg: var(--bg-subtle);
  --cc-cookie-category-block-border: var(--border-strong);
  --cc-overlay-bg: rgba(10, 12, 16, 0.45);
}

/* Moderate, centered width. Overrides the library's narrow box-wide cap (same specificity). */
#cc-main .cm--box.cm--wide {
  max-width: min(48rem, calc(100vw - 2 * var(--cc-modal-margin)));
}
#cc-main .cm {
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 40px rgba(17, 24, 39, 0.16);
}

/* Readable base type throughout the banner and preferences modal (no sub-1rem text). */
#cc-main,
#cc-main .cm,
#cc-main .pm { font-size: 1rem; line-height: 1.55; }

/* Centered title and copy, like the reference banner. */
#cc-main .cm__texts { padding-top: 1.5rem; }
#cc-main .cm__title,
#cc-main .pm__title {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
#cc-main .cm__title { text-align: center; }
#cc-main .cm__desc { font-size: 1.02rem; line-height: 1.55; text-align: center; }
#cc-main .pm__section-title { font-size: 1.02rem; font-weight: 600; }
#cc-main .pm__section-desc { font-size: 1rem; line-height: 1.55; }

/* One clean, centered button row with even gaps. display:contents dissolves the library's two
   button groups (and its margin-left:auto that shoved the preferences button to the far right),
   so every button becomes a direct flex child and lines up side by side. */
#cc-main .cm__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  padding: 1.3rem;
}
#cc-main .cm__btn-group,
#cc-main .cm__btn-group--uneven {
  display: contents;
}

/* Buttons adopt the site's button metrics; no shadows. */
#cc-main .cm__btn,
#cc-main .pm__btn {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.005em;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0.8rem 1.35rem;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
#cc-main .cm__btn:active:not(:disabled),
#cc-main .pm__btn:active:not(:disabled) { transform: translateY(1px); }
#cc-main .pm { box-shadow: none; border: 1px solid var(--border); }

/* Static underlined links in the brand colour; kill the library's sliding-underline animation. */
#cc-main .cc__link,
#cc-main a {
  background-image: none;
  background-size: 0 0;
  font-weight: inherit;
  color: var(--brand-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}
#cc-main .cc__link:hover,
#cc-main a:hover { background-size: 0 0; color: var(--brand); }
