/* ============================================================
   Ersatzteilfinder.com – Landing Page
   CI-Farben aus dem Logo abgeleitet
   ============================================================ */

:root {
  --navy: #16394b;
  --navy-dark: #0f2a38;
  --blue: #2e9bd6;
  --blue-dark: #1f7fb4;
  --ink: #1d2b33;
  --ink-soft: #4a5b64;
  --muted: #8a97a0;
  --surface: #f4f6f8;
  --line: #d9e0e5;
  --white: #ffffff;
  --error: #d64541;
  --radius: 10px;
  --wrap: 1120px;
  --shadow: 0 2px 10px rgba(15, 42, 56, 0.08);
  --shadow-lg: 0 18px 50px rgba(6, 20, 28, 0.28);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Grid-/Flex-Kinder dürfen unter ihre Content-Breite schrumpfen
   (verhindert horizontales Überlaufen auf schmalen Displays) */
.hero-inner > *,
.footer-inner > *,
.form-grid > *,
.teil-row > *,
.steps > *,
.cards > *,
.cat-grid > * { min-width: 0; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, li, summary { overflow-wrap: break-word; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.2; color: var(--navy); margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.9rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }

a { color: var(--blue-dark); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

[id] { scroll-margin-top: 90px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 14px 24px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, transform .05s ease;
}
.btn--primary { background: var(--blue); color: var(--white); }
.btn--primary:hover { background: var(--blue-dark); }
.btn--primary:active { transform: translateY(1px); }
.btn--sm { padding: 10px 16px; font-size: .95rem; }
.btn--lg { padding: 16px 32px; font-size: 1.05rem; width: 100%; }
.btn--ghost {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink-soft);
  font-weight: 600;
  padding: 11px 16px;
  white-space: nowrap;
}
.btn--ghost:hover { background: var(--surface); color: var(--ink); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.logo img { width: clamp(160px, 40vw, 220px); }
.header-actions { display: flex; align-items: center; gap: 18px; }
.header-phone { color: var(--white); text-decoration: none; text-align: right; line-height: 1.2; }
.header-phone__label { display: block; font-size: .72rem; color: rgba(255, 255, 255, 0.65); }
.header-phone__num { font-weight: 700; font-size: 1rem; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  padding: clamp(36px, 6vw, 72px) 0;
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 520px);
  gap: 40px;
  align-items: start;
}
.hero h1 { color: var(--white); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  font-size: .8rem;
  color: var(--blue);
  margin: 0 0 16px;
}
.hero-sub { font-size: 1.1rem; color: rgba(255, 255, 255, 0.85); max-width: 48ch; }
.hero-sub strong { color: var(--white); }

.hero-badges {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.hero-badges li {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: .82rem;
  color: rgba(255, 255, 255, 0.8);
}
.hero-badges__big { display: block; font-size: 1.4rem; font-weight: 800; color: var(--blue); line-height: 1.15; margin-bottom: 2px; }

/* ---------- Anfrageformular (auf dunklem Hero-Grund) ---------- */
.leadform {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--white);
  border-radius: 14px;
  padding: clamp(20px, 3vw, 30px);
}
.leadform-title { font-size: 1.35rem; margin: 0 0 4px; color: var(--white); }
.leadform-sub { margin: 0 0 20px; font-size: .88rem; color: rgba(255, 255, 255, 0.7); }
.leadform .field-label { color: rgba(255, 255, 255, 0.92); }
.leadform .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.form-divider { grid-column: 1 / -1; border: none; border-top: 1px solid rgba(255, 255, 255, 0.16); margin: 4px 0; }
.leadform-submit { margin-top: 22px; }
.leadform-foot { font-size: .8rem; color: rgba(255, 255, 255, 0.7); margin: 12px 0 0; text-align: center; }
.leadform-foot strong { color: var(--white); }

/* helle Schrift für die übrigen Formular-Texte auf dem dunklen Grund */
.leadform .checkbox { color: rgba(255, 255, 255, 0.78); }
.leadform .checkbox a { color: #bfe3f5; }
.leadform .teil-hint { color: rgba(255, 255, 255, 0.65); }
.leadform .teil-hint--alert { color: #bfe3f5; }
.leadform .form-status--ok { color: #7ee0b0; }
.leadform .form-status--err,
.leadform .form-note--error,
.leadform .field--invalid .field-label { color: #ff9b95; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.field input::placeholder { color: var(--muted); }
.field--invalid .field-label { color: var(--error); }
.field--invalid input,
.field--invalid select { border-color: var(--error); background: #fff6f5; }

/* ---------- Hersteller-Autocomplete ---------- */
.combo { position: relative; }
.combo-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 42, 56, 0.18);
  max-height: 244px;
  overflow-y: auto;
  z-index: 30;
}
.combo-option {
  padding: 9px 12px;
  border-radius: 6px;
  font-size: .95rem;
  color: var(--muted); /* Vorschläge ausgegraut */
  cursor: pointer;
}
.combo-option:hover,
.combo-option--active { background: var(--surface); color: var(--ink); }
.combo-empty { padding: 9px 12px; font-size: .88rem; color: var(--ink-soft); }

/* ---------- Gesuchtes Teil + Foto-Button ---------- */
.teil-row { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.btn--photo { align-self: flex-start; }
.teil-hint { font-size: .8rem; color: var(--ink-soft); }
.teil-hint--alert { color: var(--blue-dark); font-weight: 600; }

/* ---------- Checkbox / Status / Hinweise ---------- */
.checkbox { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 0; font-size: .88rem; color: var(--ink-soft); }
.checkbox input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; }
.checkbox.field--invalid span { color: var(--error); }

.form-note { font-size: .88rem; color: var(--ink-soft); margin: 12px 0 0; }
.form-note--error { color: var(--error); font-weight: 600; }

.form-status { margin: 14px 0 0; font-weight: 600; font-size: .96rem; }
.form-status:empty { margin: 0; }
.form-status--ok { color: #1a7f4b; }
.form-status--err { color: var(--error); }

/* Honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Sections ---------- */
.section { padding: clamp(48px, 7vw, 84px) 0; }
.section--surface { background: var(--surface); }
.section--navy { background: var(--navy); color: var(--white); }
.section--navy h2 { color: var(--white); }
.section-lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 60ch; margin-top: -.2em; }
.section-lead--light { color: rgba(255, 255, 255, 0.75); }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.steps li { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); }
.steps__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--blue); color: var(--white); font-weight: 800; font-size: 1.1rem;
  margin-bottom: 14px;
}
.steps p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 20px; margin-top: 32px; }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Kategorien ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.cat-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.cat-card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li {
  font-size: .78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

/* ---------- Brand wall ---------- */
.brand-wall { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.brand-wall li {
  font-size: .85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
}

/* ---------- FAQ ---------- */
.faq { margin-top: 28px; display: grid; gap: 12px; }
.faq details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 20px;
  box-shadow: var(--shadow);
}
.faq summary { cursor: pointer; font-weight: 600; color: var(--navy); padding: 16px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; font-size: 1.3rem; line-height: 1; color: var(--blue); }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: 0 0 18px; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-dark); color: rgba(255, 255, 255, 0.75); padding: 48px 0 32px; font-size: .9rem; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; align-items: start; }
.footer-slogan { color: var(--blue); font-weight: 700; margin: 12px 0 0; }
.footer-nav { display: grid; gap: 8px; }
.footer-nav a, .footer-contact a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.footer-nav a:hover, .footer-contact a:hover { color: var(--white); text-decoration: underline; }
.footer-legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.footer-legal p { font-size: .8rem; color: rgba(255, 255, 255, 0.55); margin: 0; }

/* ---------- Legal pages ---------- */
.legal h1 { margin-bottom: 24px; }
.legal h2 { font-size: 1.2rem; margin-top: 32px; }
.legal p { color: var(--ink-soft); }
.legal ul { color: var(--ink-soft); margin: 0 0 16px; padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal-note {
  background: #fff6e6;
  border: 1px solid #f0d9a8;
  border-radius: var(--radius);
  padding: 14px 16px;
  color: #7a5a12 !important;
  font-size: .9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .leadform-wrap { max-width: 560px; }
}

@media (max-width: 900px) {
  .cards--4 { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .header-phone { display: none; }
  .hero-badges { grid-template-columns: 1fr; }
  .leadform .form-grid { grid-template-columns: 1fr; }
  .cards--4 { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
