/* ==========================================================================
   Energieberatung Rico Missel — Stylesheet
   Farben stehen als Variablen in :root; der Dunkelmodus tauscht nur diese Werte.
   ========================================================================== */

:root {
  --bg: #F4F6F2;
  --surface: #FFFFFF;
  --line: #DDE3DC;
  --line-2: #B8C2BA;
  --line-strong: #8A968E;
  --text: #1E2724;
  --muted: #56625D;
  --ink: #173B2D;
  --accent: #2D6A4F;
  --brand: #173B2D;
  --brand-hover: #235540;
  --on-brand: #FFFFFF;
  --on-brand-muted: #D5E2D8;
  --chip-on: #E7EEE8;
  --cta: #F0B95A;
  --cta-hover: #F5C877;
  --cta-text: #14261E;
  --footer-bg: #10291F;
  --footer-text: #D5E2D8;
  --error-bg: #FBE9E4;
  --error-text: #8C2F16;

  --radius: 14px;
  --radius-sm: 10px;
  --max-width: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0E1512;
  --surface: #17211C;
  --line: #2B3A33;
  --line-2: #46574E;
  --line-strong: #7A8A81;
  --text: #E6ECE8;
  --muted: #A9B6AF;
  --ink: #D6EADC;
  --accent: #8FCFA8;
  --brand: #2A6B4E;
  --brand-hover: #348160;
  --chip-on: #243329;
  --error-bg: #4A2219;
  --error-text: #F6C9BD;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--ink); }
a:hover { color: var(--accent); }

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: break-word;
}

h1 {
  font-size: clamp(32px, 4.2vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}

p { margin: 0; }

[hidden] { display: none !important; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.muted { color: var(--muted); }

/* ==== Buttons ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-hover); color: var(--on-brand); }

.btn--cta { background: var(--cta); color: var(--cta-text); }
.btn--cta:hover { background: var(--cta-hover); color: var(--cta-text); }

.btn[disabled] { opacity: 0.6; cursor: default; }

/* ==== Kopfzeile ==== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] { background: var(--chip-on); color: var(--ink); }

.nav a.nav-cta {
  padding: 0 20px;
  background: var(--brand);
  color: var(--on-brand);
}
.nav a.nav-cta:hover { background: var(--brand-hover); color: var(--on-brand); }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}

.lang-switch button {
  min-width: 46px;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--brand);
  color: var(--on-brand);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ==== Einstieg (Über mich) ==== */
.hero { padding: 72px 0; }

.hero .container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px 56px;
}

.hero-text {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lead { font-size: 19px; }

.hero-photo {
  flex: 1 1 400px;
  min-width: 0;
  max-width: 480px;
  margin: 0;
}

.hero-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
}

/* Werdegang als Tabelle */
.cv {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.cv h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--accent);
}

.cv table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.45;
}

.cv tr { border-top: 1px solid var(--line); }
.cv tr:last-child { border-bottom: 1px solid var(--line); }

.cv th {
  width: 150px;
  padding: 12px 16px 12px 0;
  text-align: left;
  vertical-align: top;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.cv td { padding: 12px 0; vertical-align: top; }
.cv-title { display: block; font-weight: 600; color: var(--text); }
.cv-place { display: block; color: var(--muted); }

/* ==== Abschnitte ==== */
.section { padding: 80px 0; }

.section--band {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
  margin-bottom: 40px;
}

/* Leistungen */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card p { font-size: 16px; color: var(--muted); }

.card--outline {
  background: var(--surface);
  border: 1.5px solid var(--ink);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: auto;
  font-weight: 600;
}

/* Ablauf */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px 24px;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step p { font-size: 16px; color: var(--muted); }

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 18px;
  font-weight: 700;
}

/* Band mit Verweis auf den Fragebogen */
.cta-section { padding: 0 0 80px; }

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  padding: 48px;
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 18px;
}

.cta-band > div {
  flex: 999 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cta-band h2 {
  font-size: clamp(24px, 2.8vw, 32px);
  color: var(--on-brand);
}

.cta-band p { color: var(--on-brand-muted); }

/* ==== Kontakt & Fragebogen ==== */
.contact {
  padding: 64px 0 80px;
}

.contact .container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.page-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
}

.page-intro a { font-weight: 600; }
.nowrap { white-space: nowrap; }

.form-wrap { max-width: 820px; }

.questionnaire {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.form-section-head h2 { font-size: 24px; }

.form-section-number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.hint { font-weight: 400; color: var(--muted); }

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.opt {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px 0 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
}

.opt input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink);
}

.opt:has(input:checked) {
  background: var(--chip-on);
  border-color: var(--ink);
}

.opt:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.opt input:focus-visible { outline: none; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 16px;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
}

.field textarea {
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.field input::placeholder { color: var(--muted); opacity: 1; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.consent input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  accent-color: var(--ink);
}

.consent label {
  font-size: 15px;
  color: var(--muted);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.form-note {
  font-size: 15px;
  color: var(--muted);
}

.form-status {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 15px;
  font-weight: 600;
}

.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

/* Nach dem Absenden */
.success {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Der Bereich bekommt nach dem Versand den Fokus (für Screenreader), soll aber keinen Rahmen zeigen */
.success:focus,
.success:focus-visible { outline: none; }

.success-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.success-head h2 { font-size: 28px; }

.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
}

.next-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  background: var(--brand);
  color: var(--on-brand);
  border-radius: var(--radius);
}

.next-steps h3 {
  font-size: 20px;
  line-height: 1.2;
  color: var(--on-brand);
}

.next-steps ol {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0 0 0 20px;
  font-size: 16px;
  color: var(--on-brand-muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 44px;
  font-weight: 600;
}

/* ==== Rechtliche Seiten ==== */
.page-header {
  padding: 56px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--muted);
}

.breadcrumb a { font-weight: 600; }

.legal { max-width: 780px; }
.legal h2 { margin: 40px 0 12px; font-size: 24px; }
.legal h2:first-child { margin-top: 0; }
.legal p { margin: 0 0 16px; color: var(--muted); }
.legal ul { margin: 0 0 16px; padding-left: 20px; }
.legal li { margin-bottom: 6px; color: var(--muted); }

/* ==== Fußzeile ==== */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  font-size: 14px;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--footer-text);
}

.footer-links a:hover { color: #FFFFFF; }

.eee-logo img {
  width: auto;
  height: 40px;
  box-sizing: content-box;
  padding: 6px 10px;
  background: #FFFFFF;
  border-radius: 6px;
}

/* ==== Kleine Bildschirme ==== */
@media (max-width: 600px) {
  .brand { font-size: 26px; }
  .hero { padding: 48px 0; }
  .section { padding: 56px 0; }
  .cta-section { padding-bottom: 56px; }
  .cta-band { padding: 32px 24px; }
  .contact { padding: 48px 0 56px; }
  .form-section { padding: 24px 20px; }
  .cv th { width: 112px; white-space: normal; }
}
