/* ==========================================================================
   Förderrechner — Seitenlayout (foerderrechner.html)
   Nutzt die Design-Tokens aus style.css (Waldgrün, Gold, Cormorant/DM Sans)
   ========================================================================== */

/* ---------- Einstieg ---------- */
.fr-intro { padding: 2.6rem 0 2.8rem; }
.fr-intro__inner { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: end; }
.fr-intro h1 { margin-top: 1rem; font-size: clamp(2.3rem, 4.6vw, 3.9rem); line-height: 1.05; text-wrap: balance; }
.fr-intro .lede { margin-top: 1.3rem; max-width: 56ch; }
.fr-intro__facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--stone-line); }
.fr-intro__facts li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; align-items: baseline; padding: 0.85rem 0; border-bottom: 1px solid var(--stone-line); }
.fr-intro__facts strong { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--forest); line-height: 1.15; font-variant-numeric: lining-nums; }
.fr-intro__facts span { font-size: 0.9rem; color: var(--ink-soft); }
@media (max-width: 900px) {
  .fr-intro__inner { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .fr-intro__facts li { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ---------- Rechner-Rahmen ---------- */
.fr-section { padding: 0 0 var(--space-xl); }
.fr { display: flex; flex-direction: column; gap: 1.6rem; }

.fr-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.2rem 2.4rem;
  padding-bottom: 1.6rem; border-bottom: 1px solid var(--stone-line);
}

/* Reiter */
.fr-tabs { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--stone-line); background: var(--white); }
.fr-tabs button {
  font: inherit; border: 0; background: transparent; cursor: pointer; color: var(--ink-soft);
  padding: 0.85rem 1.35rem; text-align: left; display: flex; flex-direction: column; gap: 0.1rem;
  border-right: 1px solid var(--stone-line); position: relative; transition: background-color .2s ease, color .2s ease;
}
.fr-tabs button:last-child { border-right: 0; }
.fr-tabs button span { font-weight: 700; font-size: 0.94rem; color: inherit; }
.fr-tabs button small { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stone); }
.fr-tabs button:hover { background: var(--paper-alt); color: var(--forest); }
.fr-tabs button[aria-selected="true"] { background: var(--forest); color: var(--paper); }
.fr-tabs button[aria-selected="true"] small { color: var(--gold); }
.fr-tabs button[aria-selected="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--gold); }

/* Datum */
.fr-datum { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; max-width: 340px; }
.fr-datum > label { font-size: 0.8rem; font-weight: 700; color: var(--forest); }

@media (max-width: 760px) {
  .fr-toolbar { flex-direction: column; align-items: stretch; }
  .fr-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .fr-tabs button { border-right: 0; border-bottom: 1px solid var(--stone-line); padding: 0.8rem 1rem; }
  .fr-tabs button:nth-child(odd) { border-right: 1px solid var(--stone-line); }
  .fr-tabs button:nth-last-child(-n+2) { border-bottom: 0; }
  .fr-datum { max-width: none; }
}

/* ---------- Formular ---------- */
.fr-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
@media (max-width: 960px) { .fr-grid { grid-template-columns: 1fr; } }

.fr-form { background: var(--white); border: 1px solid var(--stone-line); padding: clamp(1.4rem, 3vw, 2.2rem); display: flex; flex-direction: column; gap: 1.9rem; min-width: 0; }
.fr-form__head h2 { font-size: clamp(1.6rem, 2.6vw, 2rem); line-height: 1.1; }
.fr-form__head p { margin-top: 0.5rem; font-size: 0.88rem; color: var(--stone); max-width: 60ch; }

.fr fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.3rem; min-width: 0; }
.fr legend {
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-text, #86682D); font-weight: 700;
  padding: 0; margin-bottom: 0.9rem; display: flex; align-items: center; gap: 0.7rem; width: 100%;
}
@media (max-width: 560px) { .fr fieldset { grid-template-columns: 1fr; } }

.fr-field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.fr-field--full { grid-column: 1 / -1; }
.fr-field--center { align-self: center; }
.fr-field > label { font-size: 0.84rem; font-weight: 700; color: var(--forest); }
.fr-field small { font-size: 0.78rem; color: var(--stone); line-height: 1.4; }

.fr input[type="number"], .fr input[type="date"], .fr select {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--stone-line); border-radius: 0; padding: 0.72rem 0.85rem; width: 100%; min-height: 48px;
  font-variant-numeric: tabular-nums; transition: border-color .2s ease, background-color .2s ease;
}
.fr select {
  appearance: none; -webkit-appearance: none; padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230D3B36' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center;
}
.fr input:hover, .fr select:hover { border-color: var(--stone); }
.fr input:focus, .fr select:focus { outline: none; border-color: var(--gold); background-color: var(--white); box-shadow: 0 0 0 3px rgba(201,169,97,0.22); }
.fr-unit { position: relative; }
.fr-unit input { padding-right: 2.2rem; }
.fr-unit span { position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--stone); font-size: 0.9rem; pointer-events: none; }

.fr-check-label { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 0.92rem; color: var(--ink); cursor: pointer; line-height: 1.45; }
.fr-check-label input { accent-color: var(--forest); width: 18px; height: 18px; margin-top: 0.15rem; flex: none; cursor: pointer; }
.fr-check-label em { display: block; font-style: normal; font-size: 0.78rem; color: var(--stone); margin-top: 0.1rem; }
.fr-check-label--small { font-size: 0.84rem; margin-top: 0.35rem; }
.fr-check-label[hidden] { display: none; }

/* ---------- Ergebnis-Panel ---------- */
.fr-result {
  background: var(--forest); color: var(--paper); padding: clamp(1.5rem, 3vw, 2.2rem);
  position: sticky; top: calc(var(--header-h-scrolled, 72px) + 1.2rem);
  display: flex; flex-direction: column; gap: 1.4rem; min-width: 0;
  border-top: 2px solid var(--gold);
}
@media (max-width: 960px) { .fr-result { position: static; } }
.fr-result__eyebrow { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.fr-result__big {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(3rem, 6vw, 4.2rem); line-height: 0.95;
  color: var(--gold-light, #E4CD98); font-variant-numeric: lining-nums tabular-nums; margin-top: 0.5rem;
}
.fr-result__big--text { font-size: clamp(2.2rem, 4.4vw, 2.9rem); }
.fr-result__sub { color: rgba(251,250,247,0.7); font-size: 0.92rem; margin-top: 0.55rem; }

.fr-rows { display: flex; flex-direction: column; border-top: 1px solid rgba(201,169,97,0.3); }
.fr-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.62rem 0; border-bottom: 1px solid rgba(201,169,97,0.18); font-size: 0.9rem; }
.fr-row span:first-child { color: rgba(251,250,247,0.68); min-width: 0; }
.fr-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; white-space: nowrap; color: var(--paper); }
.fr-row--strong span:first-child, .fr-row--strong span:last-child { color: var(--paper); font-weight: 700; }
.fr-row--dim span:last-child { color: rgba(251,250,247,0.6); font-weight: 400; }

.fr-notes { display: flex; flex-direction: column; gap: 0.5rem; }
.fr-note { font-size: 0.84rem; line-height: 1.5; padding: 0.65rem 0.85rem; background: rgba(251,250,247,0.06); color: rgba(251,250,247,0.88); border-left: 2px solid rgba(251,250,247,0.3); }
.fr-note--warn { border-left-color: var(--gold); background: rgba(201,169,97,0.1); }
.fr-note--bad { border-left-color: #E7867A; background: rgba(231,134,122,0.12); }
.fr-more summary {
  cursor: pointer; font-size: 0.84rem; color: var(--gold-light, #E4CD98); list-style: none; display: flex; align-items: center; gap: 0.5rem;
}
.fr-more summary::-webkit-details-marker { display: none; }
.fr-more summary::before { content: '+'; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid rgba(201,169,97,0.5); font-size: 0.8rem; line-height: 1; transition: transform .2s ease; }
.fr-more[open] summary::before { content: '–'; }
.fr-more .fr-notes { margin-top: 0.7rem; }

.fr-checks { display: flex; flex-direction: column; gap: 0.45rem; }
.fr-check { display: flex; gap: 0.7rem; align-items: baseline; font-size: 0.9rem; color: rgba(251,250,247,0.85); }
.fr-check b { font-weight: 600; color: var(--paper); }
.fr-check__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.fr-check.is-ok .fr-check__dot { background: #72C496; }
.fr-check.is-no .fr-check__dot { background: #E7867A; }
.fr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kontakt im Ergebnis */
.fr-cta { border-top: 1px solid rgba(201,169,97,0.3); padding-top: 1.3rem; display: flex; flex-direction: column; gap: 0.8rem; }
.fr-cta__titel { font-family: var(--font-display); font-size: 1.35rem; color: var(--paper); line-height: 1.2; }
.fr-cta__main { width: 100%; justify-content: center; gap: 0.6rem; display: inline-flex; align-items: center; text-align: center; white-space: normal; }
.fr-cta__alt { display: flex; justify-content: center; gap: 0.7rem; font-size: 0.88rem; flex-wrap: wrap; }
.fr-cta__alt a { color: var(--paper); border-bottom: 1px solid rgba(201,169,97,0.5); padding-bottom: 1px; }
.fr-cta__alt a:hover { color: var(--gold-light, #E4CD98); border-bottom-color: var(--gold); }
.fr-cta__alt span { color: rgba(251,250,247,0.4); }
.fr-cta__hinweis { font-size: 0.76rem; color: rgba(251,250,247,0.55); text-align: center; line-height: 1.5; margin: 0; }

/* ---------- Karten unter dem Rechner ---------- */
.fr-card { background: var(--white); border: 1px solid var(--stone-line); padding: clamp(1.4rem, 3vw, 2rem); display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
.fr-card__head h3 { font-size: clamp(1.4rem, 2.2vw, 1.7rem); line-height: 1.15; }
.fr-card__head p { margin-top: 0.45rem; font-size: 0.86rem; color: var(--stone); max-width: 70ch; }
.fr-panel { display: flex; flex-direction: column; gap: 1.6rem; }
.fr-panel[hidden] { display: none; }
.fr-info-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
@media (max-width: 960px) { .fr-info-grid { grid-template-columns: 1fr; } }

/* Vergleich Stichtage */
.fr-cmp { display: flex; flex-direction: column; gap: 0.9rem; }
.fr-cmp__row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 100px 92px; gap: 1rem; align-items: center; font-size: 0.9rem; }
.fr-cmp__lbl b { display: block; font-weight: 700; color: var(--forest); }
.fr-cmp__lbl small { color: var(--stone); font-size: 0.78rem; }
.fr-cmp__bar { height: 10px; background: var(--paper-alt); overflow: hidden; }
.fr-cmp__bar i { display: block; height: 100%; background: var(--forest); transition: width .4s cubic-bezier(.22,.61,.36,1); }
.fr-cmp__row.is-now .fr-cmp__bar i { background: var(--gold); }
.fr-cmp__amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--forest); }
.fr-cmp__diff { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.84rem; color: #A1392D; }
.fr-cmp__diff.is-zero { color: var(--stone); }
@media (max-width: 640px) {
  .fr-cmp__row { grid-template-columns: 1fr auto; gap: 0.35rem 1rem; }
  .fr-cmp__bar { grid-column: 1 / -1; order: 3; }
  .fr-cmp__diff { grid-column: 2; }
}

/* Tabellen */
.fr-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fr-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.fr-table th { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stone); font-weight: 700; text-align: right; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--stone-line); white-space: nowrap; }
.fr-table th:first-child, .fr-table td:first-child { text-align: left; }
.fr-table td { padding: 0.65rem 0.7rem; border-bottom: 1px solid var(--stone-line); text-align: right; white-space: nowrap; color: var(--ink); }
.fr-table td small { display: block; font-size: 0.74rem; color: var(--stone); font-weight: 400; }
.fr-table tr.is-cur td { background: var(--paper-alt); font-weight: 700; }
.fr-table td.is-hit { background: var(--gold); color: var(--forest-deep); font-weight: 700; }
.fr-table td.is-hit small { color: var(--forest-deep); opacity: 0.75; }
.fr-table .is-zero { color: var(--stone); }
.fr-legend { font-size: 0.8rem; color: var(--stone); display: flex; align-items: center; gap: 0.5rem; }
.fr-legend i { width: 12px; height: 12px; background: var(--gold); display: inline-block; }

.fr-quelle { margin-top: 2rem; font-size: 0.78rem; color: var(--stone); max-width: 110ch; line-height: 1.6; }
.fr-noscript { padding: 1.2rem; background: var(--white); border: 1px solid var(--stone-line); }

@media (prefers-reduced-motion: reduce) { .fr-cmp__bar i { transition: none; } }
@media print {
  .fr-result { position: static; }
  .fr-cta, .fr-tabs { display: none; }
}

/* ==========================================================================
   Förderrechner-Teaser (Startseite, Fördermittelberatung)
   ========================================================================== */
.fr-teaser { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(2rem, 6vw, 5.5rem); align-items: center; }
.fr-teaser__text h2 { margin-top: 1rem; }
.fr-teaser__text p { margin-top: 1.2rem; max-width: 50ch; }
.fr-teaser__list { list-style: none; padding: 0; margin: 1.6rem 0 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1.4rem; }
.fr-teaser__list li { display: flex; gap: 0.6rem; align-items: baseline; font-size: 0.92rem; color: var(--ink-soft); }
.fr-teaser__list li::before { content: ''; width: 7px; height: 7px; background: var(--gold); flex: none; transform: translateY(-2px); }
.fr-teaser__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.fr-teaser__card { display: block; transition: transform .35s cubic-bezier(.22,.61,.36,1); background: var(--forest); color: var(--paper); padding: clamp(1.6rem, 3vw, 2.4rem); border-top: 2px solid var(--gold); position: relative; box-shadow: 0 30px 60px -30px rgba(8,42,38,0.45); }
.fr-teaser__card::after { content: ''; position: absolute; inset: 14px -14px -14px 14px; border: 1px solid rgba(201,169,97,0.45); z-index: -1; }
.fr-teaser__tag { display: inline-block; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(201,169,97,0.5); padding: 0.2rem 0.6rem; }
.fr-teaser__card .fr-result__eyebrow { margin-top: 1.2rem; }
.fr-teaser__card .fr-rows { margin-top: 1.3rem; }
.fr-teaser__wrap { position: relative; z-index: 0; padding: 0 14px 14px 0; }
@media (max-width: 900px) {
  .fr-teaser { grid-template-columns: 1fr; }
  .fr-teaser__wrap { max-width: 520px; }
}
@media (max-width: 480px) {
  .fr-teaser__list { grid-template-columns: 1fr; }
  .fr-teaser__actions .btn { width: 100%; justify-content: center; }
}

/* ---------- Handy: Ergebnisleiste ---------- */
.fr-mini { display: none; }
@media (max-width: 960px) {
  .fr-mini {
    display: flex; align-items: center; gap: 0.8rem;
    position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 60;
    background: var(--forest); color: var(--paper); padding: 0.7rem 1rem; border-top: 2px solid var(--gold);
    box-shadow: 0 12px 30px -10px rgba(8,42,38,0.5);
    opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s ease, transform .25s ease;
  }
  .fr-mini.is-visible { opacity: 1; transform: none; pointer-events: auto; }
  .fr-mini__lbl { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
  .fr-mini__wert { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--gold-light, #E4CD98); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
  .fr-mini__go { margin-left: auto; font-size: 0.8rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
}
@media (max-width: 1024px) and (min-width: 961px) { .fr-mini { display: none; } }
.fr-teaser__card:hover { transform: translateY(-4px); }

/* Chat-Button über der Handy-Ergebnisleiste halten */
@media (max-width: 960px) {
  body:has(.fr-mini.is-visible) .chat-launcher { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); transition: bottom .25s ease; }
}
