/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; display: block; }
html { scroll-behavior: smooth; }

/* ── Page Shell ── */
body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--fh-bg);
  font-family: var(--font-sans);
  color: var(--fg-1);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(15,118,110,.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
main { flex: 1; position: relative; z-index: 1; }

/* ── Nav/Footer inner padding (used in components.js inline styles via var()) ── */
:root { --nav-inner-pad: 20px; }
@media (min-width: 640px)  { :root { --nav-inner-pad: 32px; } }
@media (min-width: 768px)  { :root { --nav-inner-pad: 48px; } }

/* ── Container — mobile-first ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 640px)  { .container { padding: 0 24px; } }
@media (min-width: 1024px) { .container { padding: 0 48px; } }
@media (min-width: 1440px) { .container { max-width: 1440px; padding: 0 120px; } }

/* ── Sections — mobile-first ── */
.section     { padding: 48px 0; }
.section--sm { padding: 32px 0; }
.section--petrol {
  background: linear-gradient(135deg, var(--fh-petrol), #0d9488);
  color: white;
}
@media (min-width: 768px)  { .section { padding: 64px 0; }  .section--sm { padding: 40px 0; } }
@media (min-width: 1024px) { .section { padding: 100px 0; } .section--sm { padding: 60px 0; } }

/* ── Grid — mobile: 1 col, scale up ── */
.grid-2 { display: grid; grid-template-columns: 1fr;           gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: 1fr;           gap: var(--space-6); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr;          gap: var(--space-8); } }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ── Card ── */
.card {
  background: var(--fh-surface);
  border: 1px solid var(--fh-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

/* ── Pill / Badge ── */
.pill {
  display: inline-flex;
  align-items: center;
  background: var(--fh-petrol-50);
  color: var(--fh-petrol-700);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  min-height: 44px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity var(--duration-base) var(--ease-out);
}
.btn:hover { opacity: .85; }
.btn--primary    { background: var(--fh-petrol); color: white; }
.btn--outline    { background: transparent; border: 1px solid var(--fh-border); color: var(--fg-1); }
.btn--ghost-white { background: white; color: var(--fh-petrol); }

/* ── Trust Bar — mobile: stacked, tablet+: 3 cols ── */
.trust-bar {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--fh-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--fh-surface);
}
.trust-bar__item {
  padding: var(--space-6);
  text-align: center;
  border-bottom: 1px solid var(--fh-border);
}
.trust-bar__item:last-child { border-bottom: none; }
.trust-bar__number { font-size: var(--text-h2); font-weight: 800; color: var(--fh-petrol); }
.trust-bar__label  { font-size: var(--text-sm); color: var(--fg-3); margin-top: var(--space-1); }
@media (min-width: 640px) {
  .trust-bar { grid-template-columns: repeat(3, 1fr); }
  .trust-bar__item { border-bottom: none; border-right: 1px solid var(--fh-border); }
  .trust-bar__item:last-child { border-right: none; }
}

/* ── Steps — mobile: stacked, tablet+: 3 cols with arrows ── */
.steps { display: grid; grid-template-columns: 1fr; gap: 0; }
.step  { padding: var(--space-6); text-align: center; position: relative; }
.step__number {
  width: 36px; height: 36px;
  background: var(--fh-petrol);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--text-sm);
  margin: 0 auto var(--space-3);
}
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: calc(-1 * var(--space-3));
    top: 50%;
    transform: translateY(-50%);
    color: var(--fh-border);
    font-size: var(--text-h3);
  }
}

/* ── Form ── */
.form-group { display: flex; flex-direction: column; gap: var(--space-1); }
.form-group label { font-size: var(--text-sm); font-weight: 500; color: var(--fg-2); }
.form-group input,
.form-group textarea,
.form-group select {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--fh-border);
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: max(16px, var(--text-body));
  background: var(--fh-surface);
  color: var(--fg-1);
  transition: border-color var(--duration-base) var(--ease-out);
  min-height: 44px;
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--fh-petrol);
  box-shadow: 0 0 0 3px rgba(15,118,110,.1);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-stack { display: flex; flex-direction: column; gap: var(--space-4); }

/* ── Consent ── */
.consent-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--text-sm);
  color: var(--fg-3);
  line-height: var(--leading-normal);
}
.consent-row input[type="checkbox"] {
  width: 16px; height: 16px;
  margin-top: 2px;
  accent-color: var(--fh-petrol);
  flex-shrink: 0;
}
.consent-row a { color: var(--fh-petrol); text-decoration: underline; }

/* ── Page Hero (legal / sub-pages) ── */
.page-hero { padding: 48px 0 32px; text-align: center; }
.page-hero .pill { margin-bottom: var(--space-4); }
@media (min-width: 768px)  { .page-hero { padding: 64px 0 48px; } }
@media (min-width: 1024px) { .page-hero { padding: 100px 0 64px; } }

/* ── CTA Banner ── */
.cta-banner { border-radius: var(--radius-2xl); padding: var(--space-8); text-align: center; }
.cta-banner h2 { color: white; margin-bottom: var(--space-3); }
.cta-banner p  { color: rgba(255,255,255,.85); margin-bottom: var(--space-6); }
@media (min-width: 768px) { .cta-banner { padding: var(--space-12); } }

/* ── Navigation — mobile: hamburger, desktop: inline ── */
#topbar {
  position: relative;
  z-index: 100;
  background: linear-gradient(to right, rgba(9,72,66,.98) 0%, rgba(15,118,110,.98) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.nav-link {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color var(--duration-base) var(--ease-out);
}
.nav-link:hover,
.nav-link[aria-current="page"] { color: white; }

/* Mobile nav defaults */
#nav-toggle { display: block; }
#main-nav {
  display: none;
  position: absolute;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--fh-petrol);
  flex-direction: column;
  padding: var(--space-4) var(--space-6);
  gap: var(--space-4);
  border-top: 1px solid rgba(255,255,255,.15);
}
#main-nav.nav--open { display: flex; }
#main-nav .btn { align-self: flex-start; }

/* Desktop nav */
@media (min-width: 768px) {
  #topbar    { position: sticky; top: 0; }
  #nav-toggle { display: none; }
  #main-nav {
    display: flex;
    flex-direction: row;
    position: static;
    background: none;
    padding: 0;
    gap: var(--space-8);
    align-items: center;
    border-top: none;
  }
}

/* ── Footer ── */
#site-footer { background: var(--fh-surface); border-top: 1px solid var(--fh-border); }
.footer-link {
  color: var(--fg-3);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color var(--duration-base) var(--ease-out);
}
.footer-link:hover { color: var(--fh-petrol); }

/* ── Body font scale up for desktop ── */
@media (min-width: 1024px) { body { font-size: 18px; } }

/* ── Angebot-Preview ── */
.angebot-preview { background: var(--fh-surface); border: 1px solid var(--fh-petrol-200); border-radius: var(--radius-2xl); padding: var(--space-5); box-shadow: var(--shadow-petrol); }
.angebot-preview__label { font-size: var(--text-xs); font-weight: 700; color: var(--fh-petrol); text-transform: uppercase; letter-spacing: var(--tracking-wider); margin-bottom: var(--space-4); }
.angebot-preview__row { display: flex; justify-content: space-between; padding: var(--space-2) 0; font-size: var(--text-sm); color: var(--fg-3); border-bottom: 1px solid var(--fh-border); }
.angebot-preview__row strong { color: var(--fg-1); }
.angebot-preview__total { display: flex; justify-content: space-between; padding: var(--space-3) 0; font-weight: 700; font-size: var(--text-body); margin-top: var(--space-2); }
.angebot-preview__divider { height: 1px; background: var(--fh-border); margin: var(--space-3) 0; }

/* ── Kostenrechner — mobile: stacked, tablet+: 2 cols ── */
.rechner-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-8); align-items: start; }
@media (min-width: 768px) { .rechner-grid { grid-template-columns: 1fr 1fr; gap: var(--space-10); } }
.rechner-slider-group { margin-bottom: var(--space-7); }
.rechner-slider-label { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-2); }
.rechner-slider-label span { font-size: var(--text-h4); font-weight: 800; color: var(--fh-petrol); }
input[type=range].rechner-slider { width: 100%; accent-color: var(--fh-petrol); height: 6px; cursor: pointer; }
.rechner-panel { background: var(--fh-ink-900); border-radius: var(--radius-2xl); padding: var(--space-8); color: white; }
.rechner-panel__block { margin-bottom: var(--space-5); }
.rechner-panel__label { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.45); margin-bottom: var(--space-2); }
.rechner-panel__value { font-size: clamp(28px, 4vw, 40px); font-weight: 800; color: white; line-height: 1.1; }
.rechner-panel__sub { font-size: var(--text-sm); color: rgba(255,255,255,0.55); margin-top: var(--space-1); }
.rechner-panel__divider { height: 1px; background: rgba(255,255,255,0.12); margin: var(--space-5) 0; }
.rechner-panel__saving { font-size: var(--text-h4); font-weight: 700; color: var(--fh-petrol); }

/* ── Reduce Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
