/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #1B4F72;
  --primary-light: #2E86C1;
  --accent:        #C0392B;
  --bg:            #F4F6F8;
  --card-bg:       #FFFFFF;
  --text:          #2C3E50;
  --muted:         #7F8C8D;
  --border:        #E0E6ED;
  --gold:          #D4AC0D;
  --green:         #1E8449;
  --radius:        12px;
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover:  0 4px 24px rgba(0,0,0,0.13);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.logo-flag {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.logo-flag::before, .logo-flag::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 1px;
}
.logo-flag::before { width: 16px; height: 4px; }
.logo-flag::after  { width: 4px;  height: 16px; }

.logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lang-switcher {
  display: flex;
  gap: 4px;
}

.lang-switcher a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  letter-spacing: 0.05em;
}

.lang-switcher a:hover,
.lang-switcher a.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.lang-switcher a.active {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #154360 100%);
  color: #fff;
  padding: 52px 0 40px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.05rem;
  opacity: 0.88;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
}

/* ── Form ──────────────────────────────────────────────────────────────────── */
.main-content { padding: 32px 0 48px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 580px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }

label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.label-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}
.info-btn:hover { color: var(--primary-light); }

.info-text {
  display: none;
  font-size: 0.82rem;
  color: var(--muted);
  background: #F0F4F8;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--primary-light);
  margin-top: 4px;
  line-height: 1.5;
}
.info-text.visible { display: block; }

input[type="text"],
input[type="number"],
select {
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
}

input:focus, select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(46,134,193,0.12);
}

select { cursor: pointer; }

.field-error {
  display: none;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 13px 32px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(192,57,43,0.25);
  width: 100%;
  margin-top: 4px;
}

.btn-primary:hover {
  background: #a93226;
  box-shadow: 0 4px 16px rgba(192,57,43,0.35);
}

.btn-primary:active { transform: translateY(1px); }

/* ── Results ───────────────────────────────────────────────────────────────── */
#results { display: none; }

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 580px) {
  .results-grid { grid-template-columns: 1fr; }
  .card { padding: 20px; }
}

.result-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.2s;
}

.result-card:hover { box-shadow: var(--shadow-hover); }

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.result-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-top10  { background: #FEF9E7; color: var(--gold); border: 1px solid #F7DC6F; }
.badge-top25  { background: #EAFAF1; color: var(--green); border: 1px solid #82E0AA; }
.badge-neutral { background: #EBF5FB; color: var(--primary); border: 1px solid #AED6F1; }

.result-top-pct {
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.result-subtext {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Percentile bar ─────────────────────────────────────────────────────────── */
.pct-bar-wrapper {
  margin-top: 4px;
}

.pct-bar {
  position: relative;
  height: 10px;
  background: #E5ECF0;
  border-radius: 100px;
  overflow: visible;
}

.pct-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #AED6F1, var(--primary-light));
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.pct-bar-marker {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: left 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.pct-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Chart ─────────────────────────────────────────────────────────────────── */
.chart-container {
  position: relative;
  height: 220px;
}

.chart-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 10px;
}

/* ── Context / info ─────────────────────────────────────────────────────────── */
.context-box {
  background: #EBF5FB;
  border-left: 4px solid var(--primary-light);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--text);
  margin-top: 16px;
}

.pk-note {
  background: #FEF9E7;
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  font-size: 0.85rem;
  color: #7D6608;
  margin-top: 10px;
}

/* ── FAQ ───────────────────────────────────────────────────────────────────── */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-item summary {
  cursor: pointer;
  padding: 12px 4px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: '+';
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.15s;
  display: inline-block;
  width: 18px;
}

.faq-item[open] summary::before { transform: rotate(45deg); }

.faq-item p {
  padding: 0 4px 14px 28px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Disclaimer ────────────────────────────────────────────────────────────── */
.disclaimer {
  background: #F8F9FA;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.disclaimer strong { color: var(--text); }

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  padding: 24px 0;
  text-align: center;
  font-size: 0.82rem;
  margin-top: 24px;
}

.site-footer a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.section-spacer { margin-top: 32px; }
.hidden { display: none !important; }

@media (max-width: 420px) {
  .hero { padding: 36px 0 28px; }
  .card { padding: 18px; }
  .result-card { padding: 18px; }
}

/* ── Landing page ──────────────────────────────────────────────────────────── */
.landing-hero {
  background: linear-gradient(155deg, #1a3a5c 0%, var(--primary) 45%, #0d2d45 100%);
  color: #fff;
  padding: 52px 0 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.landing-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 60% at 50% 130%, rgba(255,255,255,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.landing-hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
  line-height: 1.15;
  position: relative;
  z-index: 1;
}

.landing-hero p {
  font-size: 1.12rem;
  opacity: 0.82;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

.landing-main {
  padding: 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 52px 0 72px;
}

.tool-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
  padding: 28px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.22s, transform 0.18s;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-light), #5DADE2);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.tool-card:hover { box-shadow: 0 6px 28px rgba(0,0,0,0.12); transform: translateY(-3px); }
.tool-card:hover::before { transform: scaleX(1); }
.tool-card.coming-soon { opacity: 0.55; cursor: default; pointer-events: none; }
.tool-card.coming-soon::before { display: none; }

.tool-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 2px; }
.tool-title { font-size: 1.08rem; font-weight: 700; color: var(--primary); line-height: 1.3; }
.tool-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.6; flex: 1; }

.tool-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.badge-live  { background: #E8F8F0; color: #1E8449; border: 1px solid #82E0AA; }
.badge-soon  { background: #F4F6F8; color: var(--muted); border: 1px solid var(--border); }

.tool-cta {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  transition: gap 0.15s;
}

.tool-card:hover .tool-cta { gap: 8px; }

@media (max-width: 640px) {
  .landing-hero { padding: 36px 0 28px; }
  .tools-grid { padding: 36px 0 56px; gap: 14px; }
  .tool-card { padding: 22px 20px; }
}

/* ── Hypothekenrechner ──────────────────────────────────────────────────────── */
.hypo-container { max-width: 1100px; }

.hypo-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}

.hypo-inputs {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hypo-inputs fieldset {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 20px 16px;
  border: none;
  margin-bottom: 16px;
}

.hypo-inputs legend {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  padding: 0 6px;
  margin-left: -6px;
}

.hypo-input-row { margin-top: 14px; }

.hypo-input-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.hypo-input-control {
  position: relative;
  display: flex;
  align-items: center;
}

.hypo-input-control input { padding-right: 48px; }

.unit {
  position: absolute;
  right: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  pointer-events: none;
}

#hypo-messages { margin-bottom: 16px; }

.msg {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 8px;
  font-weight: 500;
  line-height: 1.5;
}

.msg-error   { background: #FDEDEB; border-left: 4px solid var(--accent); color: #922B21; }
.msg-warning { background: #FEF9E7; border-left: 4px solid var(--gold);   color: #7D6608; }

.hypo-results { display: flex; flex-direction: column; gap: 24px; }
.hypo-results .card { margin-bottom: 0; }

.hypo-chart-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: -12px;
  margin-bottom: 16px;
}

.hypo-chart-container {
  position: relative;
  height: 320px;
}

.hypo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.hypo-table tr { border-bottom: 1px solid var(--border); }
.hypo-table tr:last-child { border-bottom: none; }

.hypo-table td { padding: 10px 4px; color: var(--text); }

.hypo-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.hypo-section-label td {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  padding-top: 20px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary);
}

.hypo-table tr:first-child .hypo-section-label td,
.hypo-section-label:first-child td { padding-top: 4px; }

.sub-value {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}

@media (max-width: 800px) {
  .hypo-layout { grid-template-columns: 1fr; }
  .hypo-chart-container { height: 260px; }
  .hypo-container { max-width: 860px; }
}
