/* ═══════════════════════════════════════════════════════════════
   FINTOOL · Gemeinsames Design für Rechner & Simulatoren
   Basis: Inflationsrechner (Sept 2026) · Einstiegskachel: Hypothekenrechner
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-dark:  #2C3E7A;
  --blue-mid:   #3D5498;
  --blue-light: #5B73B8;
  --blue-bg:    #EEF1FA;
  --red:        #C0392B;
  --red-dark:   #B32728;
  --red-light:  #E8A09A;
  --red-bg:     #FEF0EE;
  --green:      #1A6B3A;
  --green-bg:   #E8F5EE;
  --aktien:     #1A6B3A;
  --aktien-bg:  #E8F5EE;
  --purple:     #6B3A8A;
  --purple-bg:  #F2EBF9;
  --immo:       #2C3E7A;
  --immo-bg:    #EEF1FA;
  --lev:        #6B3A8A;
  --lev-bg:     #F2EBF9;
  --amber:      #B7791F;
  --amber-bg:   #FFF6E5;
  --grey-50:    #F8F9FB;
  --grey-100:   #ECEEF2;
  --grey-300:   #C4C8D0;
  --grey-500:   #7A8090;
  --grey-800:   #1A1D24;
  --white:      #FFFFFF;
  --radius:     14px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(44,62,122,0.10);
  --shadow-sm:  0 2px 8px rgba(44,62,122,0.08);
  --font:       -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', Roboto, Arial, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--grey-50);
  color: var(--grey-800);
  min-height: 100vh;
  line-height: 1.45;
}
button, input, select, textarea { font-family: inherit; }
a { color: var(--blue-mid); }

/* ── SPLASH / STARTSEITE ─────────────────────────────────────── */
#splash { min-height: 100vh; padding: 36px 16px 60px; background: var(--grey-50); }
.splash-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 8px 12px; }

/* Einstiegskachel (wie Hypothekenrechner) */
.ft-tile {
  position: relative; display: block;
  width: min(260px, 62vw); aspect-ratio: 1;
  border-radius: 20%; overflow: hidden;
  background: #303F78;
  box-shadow: 0 12px 40px rgba(28,52,68,0.14);
  cursor: pointer; user-select: none;
  margin: 0 auto 26px;
  transition: transform .15s, box-shadow .15s;
  border: none; padding: 0; text-align: center;
}
.ft-tile:hover { transform: translateY(-2px); box-shadow: 0 16px 44px rgba(28,52,68,0.20); }
.ft-tile:active { transform: translateY(0); }
.ft-tile:focus-visible { outline: 4px solid var(--blue-light); outline-offset: 6px; }
.ft-tile-logo { position: absolute; inset: 0 0 28.75%; display: flex; align-items: center; justify-content: center; }
.ft-tile-logo img { width: 78%; height: auto; filter: brightness(0) invert(1); opacity: .96; }
.ft-tile-label {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 28.75%;
  display: flex; align-items: center; justify-content: center;
  background: var(--red-dark); color: var(--white);
  font-size: clamp(11px, 3.2vw, 15px); font-weight: 800; letter-spacing: .04em;
  line-height: 1.2; text-transform: uppercase; padding: 0 10px; text-align: center;
}
.ft-tile-label.small { font-size: clamp(10px, 2.6vw, 13px); }

.splash-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 2px; color: var(--blue-mid); text-transform: uppercase; margin-bottom: 16px; }
.splash-eyebrow span { opacity: 0.4; margin: 0 8px; }
.splash-title { font-size: clamp(28px, 6vw, 42px); font-weight: 300; color: var(--grey-800); line-height: 1.1; margin-bottom: 8px; letter-spacing: -1px; }
.splash-title strong { font-weight: 800; }
.splash-author { font-size: 18px; color: var(--grey-500); font-weight: 600; margin-top: 10px; margin-bottom: 20px; }
.splash-sub { font-size: 15px; color: var(--grey-500); line-height: 1.55; max-width: 460px; margin: -8px auto 22px; }

/* Aufklappbare Intro-Kachel («Warum dieser Rechner») */
.section.tile-click .cta-tile-inner { padding: 18px 20px; cursor: pointer; transition: background .15s; }
.section.tile-click .cta-tile-inner:hover { background: var(--grey-50); }
.tile-click .cta-tile-title { color: var(--grey-800); }
.tile-click .cta-tile-sub { color: var(--grey-500); }
.tile-click .cta-tile-arrow { color: var(--blue-dark); }
.tile-click.open .cta-tile-arrow { transform: rotate(180deg); }
.intro-body { display: none; padding-top: 0; }
.tile-click.open .intro-body { display: block; }
.intro-text { font-size: 14px; line-height: 1.65; color: var(--grey-800); }
.intro-text p { margin-bottom: 14px; }
.intro-text p:last-child { margin-bottom: 0; }
.intro-text strong { color: var(--blue-dark); }
.intro-text h4 { font-size: 13px; font-weight: 800; color: var(--blue-dark); text-transform: uppercase; letter-spacing: .5px; margin: 18px 0 8px; }
.intro-text ul { padding-left: 18px; margin-bottom: 14px; }
.intro-text li { margin-bottom: 6px; }

/* Grosse Aktions-Kachel («Direkt zum Rechner») */
.section.cta-tile { cursor: pointer; background: linear-gradient(135deg, var(--blue-dark), var(--blue-mid)); border: none; transition: transform .15s, box-shadow .15s; }
.section.cta-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(44,62,122,0.30); }
.section.cta-tile:active { transform: translateY(0); }
.cta-tile-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 20px; }
.cta-tile-title { color: var(--white); font-size: 17px; font-weight: 700; }
.cta-tile-sub { color: rgba(255,255,255,0.75); font-size: 12px; margin-top: 4px; }
.cta-tile-arrow { color: var(--white); font-size: 26px; font-weight: 700; flex-shrink: 0; transition: transform .2s; }
.section.cta-tile.secondary { background: var(--white); border: 1.5px solid var(--grey-100); }
.section.cta-tile.secondary .cta-tile-title { color: var(--blue-dark); }
.section.cta-tile.secondary .cta-tile-sub { color: var(--grey-500); }
.section.cta-tile.secondary .cta-tile-arrow { color: var(--blue-dark); }

/* ── APP ─────────────────────────────────────────────────────── */
#app { display: none; }
.app-header { background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%); padding: 14px 20px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-header-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.app-logo { height: 26px; flex-shrink: 0; display: flex; align-items: center; }
.app-logo img { height: 26px; width: auto; filter: brightness(0) invert(1); opacity: .96; display: block; }
.app-title { color: var(--white); font-size: 15px; font-weight: 700; line-height: 1.2; }
.app-sub { color: rgba(255,255,255,0.65); font-size: 11px; margin-top: 1px; }
.btn-back { background: rgba(255,255,255,0.15); border: none; color: var(--white); font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 20px; cursor: pointer; transition: background .15s; white-space: nowrap; flex-shrink: 0; }
.btn-back:hover { background: rgba(255,255,255,0.25); }
.red-bar { background: var(--red); height: 4px; }
.page { max-width: 680px; margin: 0 auto; padding: 20px 16px 60px; }
.page.wide { max-width: 980px; }

/* Sektionen */
.section { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 16px; overflow: hidden; }
.section-header { padding: 14px 18px 12px; border-bottom: 1px solid var(--grey-100); display: flex; align-items: center; gap: 10px; }
.section-header-icon { font-size: 16px; }
.section-header-title { font-size: 13px; font-weight: 700; color: var(--grey-800); }
.section-header-sub { font-size: 11px; color: var(--grey-500); margin-top: 1px; }
.section-body { padding: 16px 18px; }
.tag { display: inline-block; background: var(--blue-bg); color: var(--blue-mid); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 8px; border-radius: 20px; margin-left: 6px; }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-green { background: var(--green-bg); color: var(--green); }

/* Felder */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-label { font-size: 11px; font-weight: 700; color: var(--grey-500); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.field-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.field-col { flex: 1 1 150px; min-width: 0; }
.field-col label { display: block; font-size: 11px; font-weight: 700; color: var(--grey-500); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.input-wrap { display: flex; align-items: center; background: var(--grey-50); border: 1.5px solid var(--grey-100); border-radius: var(--radius-sm); overflow: hidden; transition: border-color .15s; }
.input-wrap:focus-within { border-color: var(--blue-mid); }
.input-wrap input, .input-wrap select { flex: 1; border: none; background: transparent; padding: 9px 10px; font-size: 14px; font-weight: 700; color: var(--blue-dark); outline: none; min-width: 0; }
.input-unit { padding: 0 10px; font-size: 12px; color: var(--grey-500); font-weight: 500; flex-shrink: 0; }
.output-val { padding: 9px 10px; font-size: 14px; font-weight: 700; color: var(--grey-500); background: var(--grey-100); border-radius: var(--radius-sm); border: 1.5px solid var(--grey-100); }
.divider { height: 1px; background: var(--grey-100); margin: 14px 0; }
.hint { font-size: 11px; color: var(--grey-500); line-height: 1.5; margin-top: 8px; }

/* Segmentierte Schalter */
.segmented { display: flex; background: var(--grey-50); border: 1.5px solid var(--grey-100); border-radius: var(--radius-sm); padding: 3px; gap: 4px; flex-wrap: wrap; }
.segmented button { flex: 1 1 40%; min-width: 90px; border: none; background: transparent; padding: 9px 8px; font-size: 12px; font-weight: 700; color: var(--grey-500); border-radius: 6px; cursor: pointer; transition: all .15s; }
.segmented button.active { background: var(--blue-dark); color: var(--white); box-shadow: var(--shadow-sm); }
.part-switch-wrap { padding: 6px; }
.part-switch { display: flex; background: var(--grey-50); border: 1.5px solid var(--grey-100); border-radius: var(--radius-sm); padding: 4px; gap: 4px; }
.part-switch button { flex: 1; border: none; background: transparent; padding: 13px 10px; font-size: 13px; font-weight: 700; color: var(--grey-500); border-radius: 7px; cursor: pointer; transition: all .15s; text-align: left; }
.part-switch button .ps-num { display: block; font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase; opacity: 0.7; margin-bottom: 2px; }
.part-switch button.active { background: var(--blue-dark); color: var(--white); box-shadow: var(--shadow-sm); }
.part-panel { display: none; }
.part-panel.active { display: block; }

/* Schieberegler */
.period-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.period-label { font-size: 12px; font-weight: 700; color: var(--grey-500); text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; }
input[type=range] { flex: 1; min-width: 120px; accent-color: var(--blue-dark); height: 4px; }
.period-val { font-size: 22px; font-weight: 800; color: var(--blue-dark); min-width: 70px; text-align: center; }
.period-sub { font-size: 11px; color: var(--grey-500); width: 100%; text-align: right; margin-top: 2px; }

/* Buttons */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: linear-gradient(135deg, var(--blue-dark), var(--blue-mid)); color: var(--white); border: none; padding: 14px 26px; border-radius: 30px; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(44,62,122,0.28); }
.btn-outline { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: transparent; color: var(--blue-dark); border: 1.5px solid var(--blue-dark); padding: 10px 22px; border-radius: 30px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-outline:hover { background: var(--blue-bg); }
.btn-ghost { background: transparent; border: 1.5px solid var(--grey-100); color: var(--grey-500); padding: 7px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-ghost:hover { border-color: var(--blue-light); color: var(--blue-dark); }

/* Erzählbox */
.narrative { font-size: 13px; line-height: 1.6; color: var(--grey-800); background: var(--blue-bg); border: 1.5px solid var(--blue-light); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; }
.narrative strong { color: var(--blue-dark); }

/* Resultatkarten */
.result-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
@media (max-width: 620px) { .result-grid { grid-template-columns: 1fr; } }
.result-card { border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.result-card-hdr { padding: 10px 12px; font-size: 11px; font-weight: 700; color: var(--white); display: flex; align-items: center; gap: 5px; background: var(--blue-dark); }
.rc-pess .result-card-hdr, .rc-red .result-card-hdr { background: var(--red); }
.rc-neutral .result-card-hdr, .rc-blue .result-card-hdr, .rc-immo .result-card-hdr { background: var(--blue-dark); }
.rc-opt .result-card-hdr, .rc-green .result-card-hdr, .rc-aktien .result-card-hdr { background: var(--green); }
.rc-lev .result-card-hdr, .rc-purple .result-card-hdr { background: var(--purple); }
.result-card-body { background: var(--white); padding: 12px; }
.result-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--grey-100); }
.result-row:last-child { border-bottom: none; }
.result-lbl { font-size: 11px; color: var(--grey-500); flex: 1; }
.result-val { font-size: 13px; font-weight: 700; color: var(--grey-800); text-align: right; flex-shrink: 0; }
.result-row.hl .result-lbl { color: var(--grey-800); font-weight: 600; font-size: 12px; }
.result-row.hl .result-val { font-size: 16px; }
.rc-pess .result-row.hl .result-val, .rc-red .result-row.hl .result-val { color: var(--red); }
.rc-neutral .result-row.hl .result-val, .rc-blue .result-row.hl .result-val, .rc-immo .result-row.hl .result-val { color: var(--blue-dark); }
.rc-opt .result-row.hl .result-val, .rc-green .result-row.hl .result-val, .rc-aktien .result-row.hl .result-val { color: var(--green); }
.rc-lev .result-row.hl .result-val, .rc-purple .result-row.hl .result-val { color: var(--purple); }

/* Kennzahl-Kacheln */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi { background: var(--grey-50); border: 1.5px solid var(--grey-100); border-radius: var(--radius-sm); padding: 12px 14px; }
.kpi-lbl { font-size: 11px; font-weight: 700; color: var(--grey-500); text-transform: uppercase; letter-spacing: .4px; }
.kpi-val { font-size: 20px; font-weight: 800; color: var(--blue-dark); margin-top: 4px; line-height: 1.15; }
.kpi-sub { font-size: 11px; color: var(--grey-500); margin-top: 3px; }
.kpi.red .kpi-val { color: var(--red); }
.kpi.green .kpi-val { color: var(--green); }

/* Legende & Tabelle */
.area-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 0 4px 12px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--grey-500); font-weight: 600; }
.legend-swatch { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.rate-table-wrap { overflow-x: auto; margin-top: 18px; }
.rate-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rate-table caption { caption-side: top; text-align: left; font-size: 11px; color: var(--grey-500); line-height: 1.5; padding-bottom: 10px; }
.rate-table th, .rate-table td { padding: 8px 8px; text-align: right; border-bottom: 1px solid var(--grey-100); white-space: nowrap; }
.rate-table th:first-child, .rate-table td:first-child { text-align: left; white-space: normal; line-height: 1.35; }
.rate-table thead th { font-size: 11px; font-weight: 700; color: var(--white); text-transform: uppercase; letter-spacing: 0.4px; background: var(--blue-dark); }
.rate-table thead th:first-child { background: var(--grey-800); }
.rate-table tbody th { text-align: left; font-weight: 600; color: var(--grey-500); font-size: 11px; }
.rate-table tbody tr.hl td, .rate-table tbody tr.hl th { font-weight: 800; color: var(--grey-800); background: var(--grey-50); }

/* Fussbereich */
.app-footer { text-align: center; font-size: 11px; color: var(--grey-500); margin-top: 8px; padding-bottom: 20px; line-height: 1.6; }
.app-footer a { color: var(--blue-light); text-decoration: none; }
.app-footer strong { color: var(--grey-500); }
.app-footer .ft-footer-logo { display: block; margin: 0 auto 10px; height: 20px; width: auto; opacity: .85; }
.splash-footer { text-align: center; font-size: 11px; color: var(--grey-300); padding: 20px 0 0; }
.splash-footer a { color: var(--blue-light); text-decoration: none; }

@media print { .ft-tile, .btn-back, .section.cta-tile { display: none !important; } #app { display: block !important; } }
