:root {
  /* V4.17: Schwarz/weiß bleibt, Akzent jetzt cyan/türkis wie auf der Hauptseite. */
  --accent: #35c3d6;
  --accent-dark: #151515;
  --accent-soft: #eefbfd;
  --background: #f5f5f4;
  --surface: #ffffff;
  --text: #171717;
  --muted: #686868;
  --line: #dedede;
  --danger: #a5151b;
  --danger-soft: #eefbfd;
  --success: #147a4b;
  --success-soft: #eaf8f0;
  --brand-black: #151515;
  --brand-dark: #242424;
  --brand-accent: #35c3d6;
  --brand-accent-dark: #179eb1;
  --shadow: 0 16px 42px rgba(0, 0, 0, .12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(53,195,214,.12), transparent 32rem),
    linear-gradient(180deg, #ffffff 0, var(--background) 40rem);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent-dark); font-weight: 800; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
[hidden] { display: none !important; }

.app-header {
  position: relative;
  padding: 24px 18px 56px;
  color: white;
  background: linear-gradient(135deg, var(--brand-black) 0%, var(--brand-dark) 67%, var(--brand-accent-dark) 100%);
}
.app-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(90deg, transparent, var(--brand-accent), transparent);
}
.header-inner {
  width: min(1040px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 92px;
  height: 92px;
  padding: 7px;
  border: 2px solid rgba(255,255,255,.86);
  border-radius: 50%;
  background: white;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.eyebrow {
  margin: 0 0 5px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .82;
}
.app-header h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.45rem);
  line-height: 1.12;
}
.app-header .subline {
  margin: 8px 0 0;
  max-width: 700px;
  color: rgba(255,255,255,.86);
}

main {
  width: min(1040px, calc(100% - 24px));
  margin: -28px auto 42px;
}
.privacy-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #cfe8ec;
  border-radius: 16px;
  background: #f6fdff;
  box-shadow: 0 8px 22px rgba(0,0,0,.06);
}
.privacy-note strong { display: block; margin-bottom: 2px; }
.privacy-note span { color: var(--muted); font-size: .92rem; }
.lock-icon { font-size: 1.3rem; }

.wizard-card {
  overflow: hidden;
  border: 1px solid rgba(21,21,21,.10);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.progress-track { height: 6px; background: #e7eeea; }
.progress-bar {
  width: 20%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-accent), var(--brand-black));
  transition: width .25s ease;
}

.step-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 18px 20px 4px;
}
.step-indicator {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}
.step-indicator .number {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  font-weight: 800;
}
.step-indicator .label {
  overflow: hidden;
  font-size: .82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.step-indicator.active { color: var(--accent-dark); background: var(--accent-soft); }
.step-indicator.active .number,
.step-indicator.done .number {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}
.step-indicator.done { color: var(--accent); }

form { padding: 6px 24px 24px; }
.step-panel { animation: appear .18s ease; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }
.step-heading { margin: 18px 0 22px; }
.step-heading h2 { margin: 0 0 6px; font-size: 1.45rem; }
.step-heading p { margin: 0; color: var(--muted); }

.section-card {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfcfc;
}
.section-card h3 { margin: 0 0 16px; font-size: 1.05rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 15px;
}
.field { grid-column: span 6; min-width: 0; }
.field.third { grid-column: span 4; }
.field.quarter { grid-column: span 3; }
.field.full { grid-column: 1 / -1; }
.field.small { grid-column: span 3; }
.field.large { grid-column: span 9; }

label, .legend-label {
  display: block;
  margin-bottom: 6px;
  font-size: .88rem;
  font-weight: 750;
}
.required::after { content: " *"; color: var(--danger); }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #c9c9c9;
  border-radius: 11px;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(53,195,214,.16);
}
.invalid-field, input:invalid:focus, select:invalid:focus {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.35;
}
.inline-help { display: inline; }
.field-status {
  display: block;
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: .82rem;
}
.field-status.neutral { color: var(--muted); background: #f1f1f1; }
.field-status.valid { color: var(--success); background: var(--success-soft); }
.field-status.invalid { color: var(--danger); background: var(--danger-soft); }

.check-row, .radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.check-row input, .radio-card input {
  width: 21px;
  min-width: 21px;
  min-height: 21px;
  height: 21px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}
.check-row label, .radio-card label { margin: 0; font-weight: 600; line-height: 1.45; }
.check-row + .check-row { margin-top: 10px; }
.linked-check { border-left: 4px solid var(--accent); }
.linked-check:has(input:checked) { border-color: var(--success); background: var(--success-soft); }

.radio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.consent-fieldset { margin: 16px 0 0; padding: 0; border: 0; }
.consent-fieldset legend { margin-bottom: 9px; font-size: .9rem; font-weight: 800; }

.legal-details {
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.legal-details summary {
  padding: 13px 14px;
  color: var(--accent-dark);
  font-weight: 850;
  cursor: pointer;
  background: var(--accent-soft);
}
.legal-details[open] summary { border-bottom: 1px solid var(--line); }
.legal-text { max-height: 460px; overflow: auto; padding: 14px 16px 18px; font-size: .88rem; line-height: 1.55; }
.legal-text p { margin: 0 0 11px; }
.legal-text h4 { margin: 20px 0 7px; font-size: .94rem; }
.legal-text ul { margin: 4px 0 12px; padding-left: 22px; }
.legal-subsection:first-of-type h4 { margin-top: 8px; }
.minor-note { padding: 10px 12px; border-left: 4px solid #d71920; background: #f4fcfe; font-weight: 700; }

.info-box, .success-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 12px;
}
.info-box { border: 1px solid #d9d9d9; background: #f7f7f7; }
.success-box { border: 1px solid #bee3ce; background: var(--success-soft); }
.info-box span, .success-box span { color: var(--muted); font-size: .9rem; }

.global-status {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 11px;
  font-weight: 700;
}
.global-status.error { color: var(--danger); background: var(--danger-soft); }
.global-status.success { color: var(--success); background: var(--success-soft); }
.global-status.info { background: #f1f1f1; }

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.action-right { display: flex; gap: 10px; margin-left: auto; }
.btn {
  min-height: 46px;
  padding: 11px 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 800;
}
.btn-primary { color: white; background: var(--brand-accent); }
.btn-primary:hover { background: var(--brand-accent-dark); }
.btn-secondary { border-color: var(--line); color: var(--text); background: white; }
.btn-secondary:hover { border-color: var(--brand-accent); color: var(--brand-accent-dark); }
.btn-danger-quiet { border-color: transparent; color: var(--danger); background: transparent; }
.btn:focus-visible { outline: 3px solid rgba(53,195,214,.32); outline-offset: 2px; }

.review-section {
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.review-section h3 {
  margin: 0;
  padding: 12px 15px;
  background: var(--accent-soft);
  font-size: 1rem;
}
.review-section dl { margin: 0; }
.review-section dl > div {
  display: grid;
  grid-template-columns: minmax(145px, .8fr) 2fr;
  gap: 14px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
}
.review-section dt { color: var(--muted); font-weight: 700; }
.review-section dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.app-footer {
  width: min(1040px, calc(100% - 24px));
  margin: 0 auto 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  font-size: .82rem;
}
.app-footer img { width: 30px; height: 30px; object-fit: contain; }

@media (max-width: 760px) {
  .app-header { padding-top: 18px; padding-bottom: 44px; }
  .header-inner { gap: 13px; align-items: center; }
  .brand-mark { flex-basis: 66px; height: 66px; padding: 5px; }
  .eyebrow { font-size: .66rem; letter-spacing: .08em; }
  main { width: min(100% - 14px, 1040px); margin-top: -20px; }
  .step-nav { padding: 13px 10px 2px; gap: 1px; }
  .step-indicator { justify-content: center; padding: 5px 2px; }
  .step-indicator .label { display: none; }
  .step-indicator .number { flex-basis: 32px; height: 32px; }
  form { padding: 4px 14px 16px; }
  .section-card { padding: 14px; }
  .field, .field.third, .field.quarter, .field.small, .field.large { grid-column: 1 / -1; }
  .form-grid { gap: 12px; }
  .radio-grid { grid-template-columns: 1fr; }
  .legal-text { max-height: 390px; padding: 13px; }
  .actions { flex-wrap: wrap; }
  .btn { flex: 1; min-width: 120px; }
  .action-right { width: 100%; order: -1; }
  .action-right .btn { width: 100%; }
  .review-section dl > div { grid-template-columns: 1fr; gap: 3px; }
}

@media print {
  .app-header, .privacy-note, .step-nav, .progress-track, .actions, .app-footer { display: none !important; }
  main { width: 100%; margin: 0; }
  .wizard-card { border: 0; box-shadow: none; }
}


/* V3: Einzel- und Familienantrag */
.application-type-card {
  padding-top: 14px;
}
.application-type-card > legend {
  padding: 0 6px;
  font-size: .95rem;
  font-weight: 850;
}
.application-type-grid {
  margin-top: 4px;
}
.choice-card {
  position: relative;
  display: flex;
  align-items: stretch;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.choice-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.choice-card input {
  position: absolute;
  inset: auto auto auto -9999px;
  width: 1px;
  height: 1px;
}
.choice-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-height: 86px;
  padding: 17px 18px 16px 54px;
}
.choice-card-content::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 24px;
  width: 20px;
  height: 20px;
  border: 2px solid #aab7b1;
  border-radius: 50%;
  background: white;
  box-shadow: inset 0 0 0 4px white;
}
.choice-card input:checked + .choice-card-content {
  color: var(--accent-dark);
  background: var(--accent-soft);
}
.choice-card input:checked + .choice-card-content::before {
  border-color: var(--accent);
  background: var(--accent);
}
.choice-card input:focus-visible + .choice-card-content {
  outline: 3px solid rgba(53,195,214,.32);
  outline-offset: -3px;
}
.choice-card-content strong {
  font-size: 1rem;
}
.choice-card-content small {
  color: var(--muted);
  line-height: 1.4;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.section-title-row h3 {
  margin: 2px 0 0;
}
.section-kicker {
  display: block;
  color: var(--accent);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.member-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: .76rem;
  font-weight: 850;
}

.department-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 13px;
}
.department-options.invalid-group {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.department-choice {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.department-choice:hover {
  border-color: var(--accent);
}
.department-choice input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin: 0 9px 0 0;
  accent-color: var(--accent);
}
.department-choice:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.department-choice span {
  font-size: .9rem;
  font-weight: 750;
}

.family-section {
  margin-top: 18px;
}
.family-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-color: #c8e3e8;
  background: linear-gradient(135deg, #ffffff, #eefbfd);
}
.family-intro h3 {
  margin: 3px 0 5px;
}
.family-intro p {
  max-width: 670px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.family-intro .btn {
  flex: 0 0 auto;
}
.family-members-list {
  display: grid;
  gap: 14px;
}
.family-member-card {
  position: relative;
  border-left: 5px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}
.family-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #ebc2bd;
  border-radius: 10px;
  color: var(--danger);
  background: white;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 500;
}
.icon-button:hover {
  background: var(--danger-soft);
}
.family-empty-state {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1px dashed #b8dce3;
  border-radius: 14px;
  color: var(--muted);
  background: #fcfcfc;
  text-align: center;
}
.family-empty-state strong {
  color: var(--text);
}
.consent-note {
  margin: 0 0 12px;
}

@media (max-width: 900px) {
  .department-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .application-type-grid {
    grid-template-columns: 1fr;
  }
  .choice-card-content {
    min-height: 76px;
  }
  .section-title-row {
    align-items: center;
  }
  .family-intro {
    align-items: stretch;
    flex-direction: column;
  }
  .family-intro .btn {
    width: 100%;
  }
  .family-card-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
  }
  .member-badge {
    max-width: 150px;
    text-align: center;
  }
}

@media (max-width: 460px) {
  .department-options {
    grid-template-columns: 1fr;
  }
  .section-title-row {
    align-items: flex-start;
  }
}

/* V4: elektronische Einreichung */
.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.compact-check { padding: 10px 12px; }
.electronic-declaration-card {
  border-color: rgba(53,195,214,.36);
  background: linear-gradient(180deg, #ffffff, #f3fcfe);
}
.declaration-hint {
  margin: -6px 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eefbfd;
  color: var(--accent-dark);
  font-weight: 700;
}
.submit-button { min-width: 210px; }
.submission-result { margin-top: 18px; }
.submission-success { align-items: flex-start; }
.submission-success .result-download { margin-top: 8px; text-decoration: none; }
.text-link {
  margin-top: 5px;
  color: var(--accent-dark);
  font-weight: 750;
}
.btn[disabled], button[disabled] { cursor: not-allowed; opacity: .62; }
input[readonly] { background: #f2f2f2; color: #4d4d4d; }

.confirmation-page {
  width: min(720px, calc(100% - 24px));
  margin: -28px auto 42px;
}
.confirmation-card {
  padding: 24px;
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow);
}
.confirmation-card h1, .confirmation-card h2 { margin-top: 0; }
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: .84rem;
}
.status-list { display: grid; gap: 10px; margin: 18px 0; }
.status-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfcfc;
}
.status-item strong { display: block; margin-bottom: 3px; }
.confirmation-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn-reject { color: white; background: #a5151b; }

@media (max-width: 760px) {
  .submit-button { min-width: 0; }
  .confirmation-card { padding: 17px; }
}


.security-check-card {
  border-color: #bfd8ca;
  background: #f7fdfe;
}
.turnstile-widget {
  width: 100%;
  min-height: 66px;
  margin: 14px 0 8px;
  overflow: hidden;
}
.turnstile-widget iframe {
  max-width: 100%;
}
