/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #0d1b2a;
  --navy2:  #132338;
  --gold:   #e8a020;
  --gold2:  #f0b040;
  --white:  #ffffff;
  --gray-100: #f7f7f8;
  --gray-200: #ebebec;
  --gray-500: #8a8d91;
  --text:   #1a1d21;
  --radius: 4px;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
  --transition: .25s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  font-size: 15px;
}

.container {
  width: min(1160px, 92%);
  margin-inline: auto;
}

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

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 26px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform .15s;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold2); border-color: var(--gold2); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.6);
}
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,.08); }

.btn-full { width: 100%; justify-content: center; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0;
  transition: background var(--transition), box-shadow var(--transition);
}
.navbar.scrolled {
  background: var(--navy);
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 68px;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-image {
  height: 50px;
  width: auto;
  max-width: min(450px, 48vw);
  object-fit: contain;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
}
.nav-links a {
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .03em;
  transition: color var(--transition);
  white-space: nowrap;
}
.nav-links a:hover { color: var(--gold); }

.nav-cta { white-space: nowrap; padding: 10px 20px; font-size: 13px; }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform var(--transition), opacity var(--transition);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background:
    url('images/hero-bg.jpg')
    center / cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(10,20,35,.82) 40%,
    rgba(10,20,35,.45) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 620px;
  padding-top: 80px;
}

.hero-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(36px, 5.5vw, 62px);
  font-weight: 800;
  color: var(--white);
  line-height: 1.12;
  margin-bottom: 22px;
}

.hero-sub {
  color: rgba(255,255,255,.75);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 500px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.hero-scroll span {
  display: block;
  width: 24px;
  height: 38px;
  border: 2px solid rgba(255,255,255,.4);
  border-radius: 12px;
  position: relative;
}
.hero-scroll span::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--gold);
  border-radius: 2px;
  animation: scroll-dot 1.8s ease infinite;
}
@keyframes scroll-dot {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(14px); }
}

/* ===== SECTION SHARED ===== */
.section-header { max-width: 640px; margin-bottom: 56px; }
.section-header.centered { max-width: 100%; text-align: center; }

.section-header h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
}
.section-header p {
  color: var(--gray-500);
  font-size: 15px;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 12px;
}
.centered-label { text-align: center; }

.divider {
  width: 40px;
  height: 3px;
  background: var(--gold);
  margin: 16px auto 0;
}

/* ===== LEISTUNGEN ===== */
.leistungen {
  padding: 96px 0;
  background: var(--navy);
}

.leistungen-title {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
  color: var(--white);
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: -.5px;
}

.leistungen-subtitle {
  text-align: center;
  color: rgba(255,255,255,.45);
  font-size: 15px;
  margin-bottom: 56px;
}

.leistungen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.leistung-card {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: default;
  background: var(--navy2);
}

.leistung-card-center {
  grid-column: 2;
}

.leistung-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  transition: transform .45s ease;
  display: block;
  position: relative;
}
.leistung-card:hover .leistung-img { transform: scale(1.07); }

.leistung-name {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 52px 16px 16px;
  background: linear-gradient(to top, rgba(6,14,24,.95) 0%, transparent 100%);
  font-size: clamp(13px, 1.25vw, 15px);
  font-weight: 600;
  color: var(--white);
  text-align: center;
  line-height: 1.4;
}

.leistung-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 3px;
  background: var(--gold);
  transition: transform .3s ease;
  border-radius: 2px 2px 0 0;
}
.leistung-card:hover::after { transform: translateX(-50%) scaleX(1); }

/* Gleisbau-Bilder – eigene Fotos in frontend/images/ ablegen */
.leistung-img-1 { background-image: url('images/technisch-berechtigter-ki.jpg'); }
.leistung-img-2 { background-image: url('images/bauueberwacher-bahn.jpg'); }
.leistung-img-3 { background-image: url('images/betra-antragstellung-ki.jpg'); }
.leistung-img-4 { background-image: url('images/sicherungsueberwachung.jpg'); }
.leistung-img-5 { background-image: url('images/alb-oberleitung.jpg'); }
.leistung-img-6 { background-image: url('images/schaltantragsteller.jpg'); }
.leistung-img-7 { background-image: url('images/bahnerder.jpg'); }
.leistung-img-8 { background-image: url('images/la-planungen.jpg'); }
.leistung-img-9 { background-image: url('images/sicherheitsplaene-ki.jpg'); }
.leistung-img-10 { background-image: url('images/sperrpausen.jpg'); }

/* ===== REFERENZEN ===== */
.referenzen {
  padding: 96px 0;
  background: var(--gray-100);
}

.referenzen .section-header { margin-bottom: 48px; }

.ref-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.ref-img {
  height: 300px;
  position: relative;
  overflow: hidden;
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
  filter: grayscale(100%);
  transition: filter var(--transition), transform .4s ease;
}
.ref-item:hover .ref-img { filter: grayscale(0%); transform: scale(1.02); }

/* Referenz-Bilder: Gleisbau-Projekte */
.ref-img-1 { background-image: url('images/ref-1.jpg'); }
.ref-img-2 { background-image: url('images/ref-2.jpg'); }
.ref-img-3 { background-image: url('images/ref-3.jpg'); }

/* KI-Bildkennzeichnung */
.ki-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,.55);
  color: rgba(255,255,255,.75);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .8px;
  padding: 2px 5px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.ref-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,20,35,.85) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  opacity: 0;
  transition: opacity var(--transition);
}
.ref-item:hover .ref-overlay { opacity: 1; }

.ref-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}
.ref-overlay span {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ===== PARTNER ===== */
.partner {
  padding: 64px 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

.partner-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 28px;
}

.partner-logo {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--gray-200);
  transition: color var(--transition);
  cursor: default;
  user-select: none;
}
.partner-logo:hover { color: var(--gray-500); }

/* ===== KONTAKT ===== */
.kontakt {
  padding: 0;
  background: var(--white);
}

.kontakt-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  min-height: 640px;
}

.kontakt-left {
  background: var(--navy);
  color: var(--white);
  padding: 72px 56px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.kontakt-left h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.2;
}

.kontakt-left > p {
  font-size: 14px;
  color: rgba(255,255,255,.65);
  line-height: 1.75;
}

.contact-info { display: flex; flex-direction: column; gap: 20px; }

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.contact-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-icon svg { width: 16px; height: 16px; color: var(--gold); }

.contact-item small {
  display: block;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}
.contact-item p {
  font-size: 14px;
  color: rgba(255,255,255,.85);
  line-height: 1.5;
}

/* Form */
.kontakt-right {
  background: var(--white);
  padding: 72px 56px;
}

.contact-form { display: flex; flex-direction: column; gap: 20px; }

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

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

.form-group label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid var(--gray-200);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
  background: var(--gray-100);
  transition: border-color var(--transition), box-shadow var(--transition);
  border-radius: var(--radius);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232,160,32,.12);
  background: var(--white);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group select { appearance: none; cursor: pointer; }

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--gold);
  cursor: pointer;
}
.form-check label {
  font-size: 12px;
  color: var(--gray-500);
  cursor: pointer;
  line-height: 1.5;
}
.form-check a {
  color: var(--navy);
  font-weight: 600;
}

.form-success,
.form-error {
  display: none;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
}
.form-success {
  background: #e8f5e9;
  color: #2e7d32;
  border-left: 3px solid #2e7d32;
}
.form-error {
  background: #fdecea;
  color: #c62828;
  border-left: 3px solid #c62828;
}
.form-success.visible,
.form-error.visible { display: block; }

#submitBtn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* ===== RECHTLICHES ===== */
.legal-section {
  padding: 88px 0;
  background: var(--white);
  scroll-margin-top: 88px;
}

.legal-section-alt { background: var(--gray-100); }

.legal-inner {
  max-width: 980px;
}

.legal-inner h2 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.2;
  margin-bottom: 28px;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 36px;
}

.legal-grid article,
.legal-card {
  border-top: 1px solid var(--gray-200);
  padding-top: 18px;
}

.legal-grid h3,
.legal-card h3 {
  font-size: 15px;
  margin: 18px 0 8px;
}

.legal-grid article h3:first-child,
.legal-card h3:first-child {
  margin-top: 0;
}

.legal-grid p,
.legal-card p {
  color: var(--gray-500);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 12px;
}

.legal-grid a,
.legal-card a {
  color: var(--navy);
  font-weight: 600;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--navy);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  flex: 1;
}

.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--gold); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.4);
}
.lang-switch a {
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color var(--transition);
}
.lang-switch a.active,
.lang-switch a:hover { color: var(--gold); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .leistungen-grid { grid-template-columns: repeat(2, 1fr); }
  .leistung-card-center { grid-column: 1 / -1; max-width: 360px; margin-inline: auto; width: 100%; }

  .ref-grid { grid-template-columns: 1fr; }
  .ref-img { height: 220px; }

  .kontakt-inner { grid-template-columns: 1fr; }
  .kontakt-left { padding: 52px 32px; }
  .kontakt-right { padding: 52px 32px; }

  .form-row { grid-template-columns: 1fr; }
  .legal-grid { grid-template-columns: 1fr; }

  .partner-grid { justify-content: center; }
}

@media (max-width: 600px) {
  .leistungen-grid { grid-template-columns: 1fr; }
  .leistung-card-center { grid-column: 1; max-width: 100%; }
}

@media (max-width: 700px) {
  .logo-image {
    height: 40px;
    max-width: calc(100vw - 108px);
  }

  .nav-links, .nav-cta { display: none; }
  .burger { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 68px 0 0 0;
    background: var(--navy);
    align-items: center;
    justify-content: center;
    gap: 32px;
    z-index: 99;
  }
  .nav-links.open a { font-size: 20px; }

  .hero-actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }

  .footer-inner { flex-direction: column; text-align: center; gap: 16px; }
  .footer-copy { flex: none; }
  .legal-section { padding: 64px 0; }
}
