:root {
  --blue: #1d4ed8;
  --blue-dark: #1e40af;
  --blue-soft: #eff6ff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --error: #b91c1c;
  --error-soft: #fef2f2;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-hover: 0 4px 8px rgba(15, 23, 42, .06), 0 12px 32px rgba(29, 78, 216, .14);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

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

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 720px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; color: var(--blue); }
.brand span { color: var(--blue); }
.back { font-size: .95rem; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--blue); }

main { flex: 1; padding: 48px 0 64px; }

/* Hero */
.hero { text-align: center; margin-bottom: 40px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.2; margin: 0 0 12px; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 560px; }

.page-head { margin-bottom: 32px; }
.page-head .icon-badge { margin-bottom: 16px; }
.page-head h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); line-height: 1.2; margin: 0 0 8px; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin: 0; }

/* Startseiten-Karten */
.cards { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; gap: 28px; } }

.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 32px 28px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: #bfdbfe; }
.card:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.card h2 { margin: 4px 0 0; font-size: 1.4rem; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); }
.card .more { margin-top: auto; padding-top: 8px; color: var(--blue); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.card .more svg { width: 18px; height: 18px; transition: transform .18s ease; }
.card:hover .more svg { transform: translateX(4px); }

.icon-badge {
  width: 56px; height: 56px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-soft); color: var(--blue);
}
.icon-badge svg { width: 30px; height: 30px; }

/* Formular */
.form-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow); padding: 28px 20px; }
@media (min-width: 600px) { .form-card { padding: 36px 36px; } }

fieldset { border: 0; margin: 0 0 28px; padding: 0; min-width: 0; }
legend { font-weight: 700; font-size: 1.1rem; margin-bottom: 14px; padding: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.grid-2 .field { margin-bottom: 0; }
label, .label { font-weight: 600; font-size: .95rem; }
.req { color: var(--blue); }
.opt { color: var(--muted); font-weight: 400; }

input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%;
  font: inherit; color: var(--text);
  padding: 12px 14px;
  border: 1px solid #cbd5e1; border-radius: 10px;
  background: var(--bg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 120px; }
textarea.large { min-height: 220px; }
input:hover, textarea:hover { border-color: #94a3b8; }
input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 78, 216, .18); }
.invalid input, .invalid textarea, input.invalid, textarea.invalid { border-color: var(--error); }

.field-error { color: var(--error); font-size: .9rem; min-height: 0; }
.field-error:empty { display: none; }

.hint {
  margin-top: 16px; padding: 12px 14px;
  border-radius: 10px; border: 1px solid #bfdbfe;
  background: var(--blue-soft); color: #1e3a8a; font-size: .95rem;
}
.alert {
  margin: 0 0 20px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid #fecaca; background: var(--error-soft); color: var(--error); font-size: .95rem;
}
[hidden] { display: none !important; }

/* Bauteil-Kacheln */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 480px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(5, 1fr); } }

.tile { position: relative; display: block; cursor: pointer; }
.tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tile span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  height: 100%; padding: 16px 8px;
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--bg);
  font-weight: 600; font-size: .95rem; text-align: center;
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.tile svg { width: 32px; height: 32px; color: var(--blue); }
.tile:hover span { border-color: #93c5fd; transform: translateY(-2px); box-shadow: var(--shadow); }
.tile input:focus-visible + span { outline: 3px solid #93c5fd; outline-offset: 2px; }
.tile input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); box-shadow: inset 0 0 0 1px var(--blue); }
.tiles.invalid .tile span { border-color: #fca5a5; }

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

.turnstile { margin: 8px 0 20px; min-height: 65px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  padding: 14px 24px; border: 0; border-radius: 12px;
  background: var(--blue); color: #fff; cursor: pointer;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
@media (min-width: 600px) { .btn { width: auto; min-width: 240px; } }
.btn:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(29, 78, 216, .25); }
.btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.btn[disabled] { opacity: .65; cursor: progress; transform: none; box-shadow: none; }

.note { color: var(--muted); font-size: .9rem; margin: 16px 0 0; }

.success {
  text-align: center; padding: 40px 24px;
  border: 1px solid #bbf7d0; border-radius: var(--radius); background: var(--ok-soft);
}
.success .icon-badge { background: #dcfce7; color: var(--ok); margin-bottom: 12px; }
.success p { margin: 0 auto; max-width: 520px; font-size: 1.05rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); color: var(--muted); font-size: .9rem; }
.site-footer .wrap { padding-top: 20px; padding-bottom: 20px; text-align: center; }

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