:root {
  --navy: #1F4E79;
  --blue: #2E75B6;
  --soft-green: #C6EFCE;
  --confirm-green: #2E7D32;
  --soft-yellow: #FFF2CC;
  --soft-bg: #F8F9FB;
  --gray: #595959;
  --mid-gray: #808080;
  --light-gray: #E5E7EB;
  --white: #FFFFFF;
  --danger: #C0392B;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--soft-bg);
  margin: 0;
  color: var(--gray);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.app-header {
  background: var(--white);
  border-bottom: 1px solid var(--light-gray);
  padding: 16px 32px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.app-header .brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--navy);
  text-transform: uppercase;
}
.app-header .brand-sub { font-size: 13px; color: var(--mid-gray); }

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}
.card {
  background: var(--white);
  width: 100%;
  max-width: 480px;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
  padding: 32px 28px;
  border: 1px solid var(--light-gray);
}

/* Progress */
.progress { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.progress-text { font-size: 11px; color: var(--blue); font-weight: 700; letter-spacing: 0.3px; }
.dots { display: flex; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--light-gray); }
.dot.active { background: var(--blue); }

/* Screens */
.screen { display: none; }
.screen.is-active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.kicker { font-size: 11px; color: var(--mid-gray); font-weight: 600; letter-spacing: 1px; margin-bottom: 14px; text-transform: uppercase; }
h1 { font-size: 28px; font-weight: 800; color: var(--navy); margin: 0 0 8px; line-height: 1.15; }
h2 { font-size: 22px; font-weight: 700; color: var(--navy); margin: 0 0 8px; line-height: 1.2; }
.center { text-align: center; }
.lead { font-size: 16px; color: var(--blue); margin: 0 0 20px; }
.sub { font-size: 13px; color: var(--gray); margin-bottom: 20px; line-height: 1.4; }
.muted { font-size: 12px; color: var(--gray); line-height: 1.5; margin: 16px 0 0; }
.meta { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--mid-gray); }

/* Fields */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 11px; font-weight: 700; color: var(--gray);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--light-gray);
  border-radius: 8px; font-size: 14px; font-family: inherit; color: var(--gray); background: var(--white);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,117,182,0.12);
}
.field input.invalid, .field textarea.invalid { border-color: var(--danger); }
.field input::placeholder, .field textarea::placeholder { color: #BBB; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error { color: var(--danger); font-size: 12px; margin-top: 4px; min-height: 0; }
.error:empty { display: none; }

/* Smart hint */
.smart-hint {
  background: var(--soft-green); border-radius: 8px; padding: 10px 12px;
  font-size: 12px; color: #1B5E20; margin-top: 8px; line-height: 1.4;
}
.smart-hint.pending { background: #FFF8E1; color: #78350F; }
.smart-hint strong { display: block; }

/* Standard card */
.standard-card { background: var(--soft-green); border-radius: 12px; padding: 16px; margin: 16px 0; }
.standard-card-title { font-size: 12px; font-weight: 700; color: #1B5E20; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.standard-card ul { margin: 0; padding-left: 16px; font-size: 13px; color: #1B5E20; line-height: 1.5; }
.standard-card li { margin-bottom: 4px; }

/* Radio cards */
.radio-card {
  border: 1.5px solid var(--light-gray); border-radius: 10px; padding: 14px;
  margin-bottom: 10px; display: flex; gap: 12px; align-items: center; cursor: pointer;
  user-select: none; transition: border-color .15s, background .15s;
}
.radio-card.selected { border-color: var(--confirm-green); background: #F1F8E9; }
.radio-circle { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--light-gray); flex-shrink: 0; position: relative; }
.radio-card.selected .radio-circle { border-color: var(--confirm-green); }
.radio-card.selected .radio-circle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--confirm-green);
}
.radio-label { font-size: 14px; color: var(--gray); font-weight: 600; }
.radio-card.selected .radio-label { color: #1B5E20; }

/* Upload */
.upload-zone {
  border: 2px dashed var(--light-gray); border-radius: 10px; padding: 16px;
  margin-bottom: 10px; display: flex; gap: 12px; align-items: center; background: var(--white);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.upload-zone:hover { border-color: var(--blue); }
.upload-zone.required { background: #FFFEF2; border-color: #F0E0A0; }
.upload-zone.filled { border-color: var(--confirm-green); background: #F1F8E9; border-style: solid; }
.upload-icon {
  width: 36px; height: 36px; border-radius: 8px; background: #F3F4F6;
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.upload-zone.required .upload-icon { background: var(--soft-yellow); }
.upload-text { display: flex; flex-direction: column; }
.upload-text strong { font-size: 13px; color: var(--gray); font-weight: 700; }
.upload-text > span { font-size: 11px; color: var(--mid-gray); margin-top: 2px; line-height: 1.3; }
.file-list { color: var(--confirm-green) !important; font-weight: 600; }
.file-list:empty { display: none; }

/* Warning + hardstop */
.warning-card {
  background: #FFF8E1; border-left: 3px solid #F59E0B; border-radius: 6px;
  padding: 10px 12px; margin-top: 12px; font-size: 11px; color: #78350F; line-height: 1.4;
}
.hardstop-card {
  background: #FDECEA; border-left: 3px solid var(--danger); border-radius: 8px;
  padding: 14px; margin-top: 14px; color: #7A271A; font-size: 13px; line-height: 1.5;
}
.hardstop-card strong { display: block; margin-bottom: 4px; font-size: 14px; }
.hardstop-card p { margin: 0 0 10px; }
.btn-call {
  display: inline-block; background: var(--danger); color: #fff; text-decoration: none;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
}

/* Buttons */
.btn-primary {
  background: var(--navy); color: var(--white); border: none; padding: 14px 24px;
  border-radius: 10px; font-size: 14px; font-weight: 600; width: 100%; margin-top: 12px;
  font-family: inherit; cursor: pointer; transition: background .15s, opacity .15s;
}
.btn-primary:hover { background: #18395a; }
.btn-primary:disabled { opacity: .55; cursor: progress; }
.btn-ghost {
  background: transparent; color: var(--mid-gray); border: 1.5px solid var(--light-gray);
  padding: 14px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; margin-top: 12px;
}
.btn-ghost:hover { color: var(--gray); border-color: var(--mid-gray); }
.nav-row { display: flex; gap: 10px; }
.nav-row .btn-primary { flex: 1; }
.nav-row .btn-ghost { flex: 0 0 auto; }

/* Completion */
.checkmark-big {
  width: 64px; height: 64px; background: var(--soft-green); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 32px;
  color: var(--confirm-green); margin: 12px auto 20px;
}
.next-steps { margin-top: 24px; font-size: 13px; color: var(--gray); line-height: 1.6; }
.next-steps strong { display: block; color: var(--navy); margin-bottom: 8px; }
.next-steps ol { margin: 0; padding-left: 18px; }
.next-steps li { margin-bottom: 4px; }
.signature {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--light-gray);
  font-size: 12px; color: var(--mid-gray); text-align: center;
}
.signature strong { display: block; color: var(--navy); font-size: 13px; margin-bottom: 4px; }

.app-footer { text-align: center; padding: 30px 20px; color: var(--mid-gray); font-size: 12px; }

/* Service card (kostenlose Leistung) */
.service-card {
  background: var(--soft-green); border-radius: 12px; padding: 14px 16px;
  margin: 0 0 16px; display: flex; gap: 12px; align-items: flex-start;
}
.service-card .badge {
  width: 28px; height: 28px; background: var(--confirm-green); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 700; font-size: 14px;
}
.service-card-text strong { display: block; color: #1B5E20; font-size: 13px; margin-bottom: 4px; font-weight: 700; }
.service-card-text span { display: block; color: #1B5E20; font-size: 12px; line-height: 1.45; }

/* Inline conditional block (grauer Kasten) */
.conditional-block {
  background: #FAFBFC; border: 1px solid var(--light-gray); border-radius: 10px;
  padding: 14px; margin-bottom: 12px;
}
.conditional-block-label {
  font-size: 11px; color: var(--mid-gray); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; margin-bottom: 10px;
}
.conditional-block .field:last-child { margin-bottom: 0; }

/* WE-Tabelle (GE) */
.we-table-wrap { overflow-x: auto; margin: 8px 0 6px; }
.we-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.we-table th {
  background: var(--navy); color: var(--white); text-align: left; padding: 7px 6px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.we-table td { border: 1px solid var(--light-gray); padding: 0; }
.we-table td input, .we-table td select {
  width: 100%; border: none; background: transparent; padding: 7px 6px;
  font-size: 13px; font-family: inherit; color: var(--gray);
}
.we-table td input:focus, .we-table td select:focus { outline: 2px solid var(--blue); outline-offset: -2px; }
.we-table td.we-nr { background: #F3F4F6; text-align: center; font-weight: 600; width: 32px; }
.we-table td.we-del { width: 30px; text-align: center; }
.we-table .btn-del {
  border: none; background: transparent; color: var(--mid-gray); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 4px 6px;
}
.we-table .btn-del:hover { color: var(--danger); }
.btn-add-row {
  border: 1.5px dashed var(--light-gray); background: var(--white); color: var(--blue);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; margin-top: 4px;
}
.btn-add-row:hover { border-color: var(--blue); }
.table-note { font-size: 11px; color: var(--mid-gray); margin-top: 8px; }

/* Maßnahmen-Karten (GE) */
.measure { margin-bottom: 16px; }
.measure .standard-card { margin: 0 0 8px; }
.measure .radio-card { padding: 10px 14px; margin-bottom: 8px; }
.measure .deviation { margin-top: 4px; }
.measure .deviation textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--light-gray);
  border-radius: 8px; font-size: 13px; font-family: inherit; color: var(--gray); }

/* Read-only Adresse (Screen Objekt) */
.address-readonly {
  padding: 11px 12px; border: 1.5px solid var(--light-gray); border-radius: 8px;
  font-size: 14px; color: var(--gray); background: var(--soft-bg);
}
.meta-line { text-align: center; font-size: 12px; margin-top: 14px; }

/* Section divider with sub-heading */
.section-divider { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--light-gray); }
.section-divider h3 { font-size: 17px; color: var(--navy); margin: 0 0 4px; }

/* Startseite (Chooser) */
.chooser { max-width: 760px; }
.chooser h1 { font-size: 26px; }
.chooser-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.choice {
  display: block; text-decoration: none; color: inherit; border: 1.5px solid var(--light-gray);
  border-radius: 14px; padding: 22px; transition: border-color .15s, box-shadow .15s; background: var(--white);
}
.choice:hover { border-color: var(--blue); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.choice .tag { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--blue); text-transform: uppercase; }
.choice h2 { font-size: 18px; margin: 8px 0 6px; }
.choice p { font-size: 13px; color: var(--gray); line-height: 1.5; margin: 0; }
.choice .go { display: inline-block; margin-top: 14px; color: var(--navy); font-weight: 600; font-size: 14px; }
@media (max-width: 600px) { .chooser-grid { grid-template-columns: 1fr; } }

@media (max-width: 520px) {
  .card { padding: 24px 18px; border-radius: 14px; }
  h1 { font-size: 24px; }
}
