/* Layout für die Erfassungs-App: eine Spalte, mobile-first, große Touch-Flächen.
   Farben grün/orange aus assets/*.svg übernommen (Check/Married = #00AA49, Warning/Cross = #C77700).
   Blau-Töne sind verbindlich vorgegeben (siehe docs/design.md): #007BFF für aktive Buttons/Ja-Nein,
   #0b5fa5 für Footer-Links und die Foto-Dropzone, #014395/#052F4A für den Header-Verlauf. */

:root {
  --bg: #f5f5f4;
  --fg: #1c1c1c;
  --card-bg: #ffffff;
  --border: #d9d9d6;
  --muted: #6b6b68;
  --placeholder: #8d8d8d;
  --accent-blue: #007bff;
  --accent-blue-fg: #ffffff;
  --link-blue: #0b5fa5;
  --inactive-bg: #e2e2e2;
  --accent-green: #00aa49;
  --accent-green-bg: #eaf7ee;
  --success-banner-bg: #00aa4936;
  --accent-orange: #c77700;
  --danger: #b3261e;
  --danger-bg: #fbeceb;
  --header-navy-start: #014395;
  --header-navy-end: #052f4a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

/* ---- Header (zwei Varianten: mit/ohne Married, Inhalt wird per JS getauscht) ---- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to right, var(--header-navy-start), var(--header-navy-end));
  color: #fff;
  padding: 1.1rem 1rem 1.3rem;
}

.app-logo {
  display: block;
  width: 42%;
  height: auto;
  margin-bottom: 0.55rem;
}

.app-header-bottom {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 700;
}

.app-header-title {
  font-size: 1.15rem;
}

.app-header-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.4);
}

.app-header-pop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}

.app-header-pop-value {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.icon-inline {
  width: 14px;
  height: 14px;
  vertical-align: middle;
}

.icon-inline-lg {
  width: 22px;
  height: 22px;
  vertical-align: middle;
}

main {
  background: var(--card-bg);
  padding: 1rem;
}

.state-message {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.error-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--danger);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.card h2, .card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

/* ---- Subheader "Schrank Stammdaten" (nur wenn verheiratet, außer Zwischenbildschirm) ---- */

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.kv-row:last-child {
  border-bottom: none;
}

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

.kv-value {
  font-weight: 700;
  text-align: right;
}

/* ---- Hinweis- / Zwischenbildschirm ---- */

.hint-card, .intermediate-card {
  text-align: center;
}

.hint-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 0.75rem;
}

.hint-text {
  margin: 0 0 1rem;
}

.hint-text:last-child {
  margin-bottom: 0;
}

.intermediate-success {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--success-banner-bg);
  color: var(--fg);
  padding: 0.75rem;
  border-radius: 0.5rem;
  text-align: left;
  margin-bottom: 1rem;
}

.intermediate-success img {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
}

.intermediate-success-title {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
}

.intermediate-success-sub {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
}

.intermediate-line {
  font-size: 15px;
}

/* ---- Overview "Status Verlauf" ---- */

.overview-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.overview-row:last-child {
  border-bottom: none;
}

.overview-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.overview-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}

.overview-title {
  font-weight: 600;
}

.overview-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.overview-row:active {
  background: var(--bg);
}

.overview-row:disabled {
  cursor: default;
}

.overview-chevron {
  font-size: 1.3rem;
  color: var(--muted);
}

/* ---- Formularfelder ---- */

.field {
  margin-bottom: 0.85rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field label, .field .label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.step-date {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}

select,
input[type="text"],
textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: #fff;
  color: var(--fg);
}

textarea {
  font-family: inherit;
  resize: vertical;
}

select:disabled {
  background: var(--bg);
  color: var(--muted);
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

.field input + input {
  margin-top: 0.5rem;
}

.radio-group {
  display: flex;
  gap: 0.6rem;
}

.radio-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.radio-group label {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  font-weight: 600;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radio-group input[type="radio"]:checked + label {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: var(--accent-blue-fg);
}

.extra-fields {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ---- Gemeinsame Statusseite: eine Karte, Blöcke durch Abstand + dezente Trennlinie getrennt ---- */

.status-block--divider {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ---- Read-only-Block auf der gemeinsamen Statusseite (Schritt schon gespeichert) ---- */

.locked-yes {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.4rem 0.7rem;
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border-radius: 0.4rem;
  font-weight: 700;
}

.locked-info {
  margin: 0 0 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---- Foto-Auswahl (Kamera oder Galerie) und Vorschau-Raster ---- */

.photo-picker-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem;
  border: none;
  border-radius: 0.6rem;
  background-color: #f1f7fc;
  /* Kräftigere, per Hintergrund-Verlauf gezeichnete Strichlinie statt border-style:dashed,
     damit Segmentlänge/Abstand gezielt größer als der Browser-Standard ausfallen. */
  background-image:
    linear-gradient(to right, var(--link-blue) 60%, transparent 60%),
    linear-gradient(to right, var(--link-blue) 60%, transparent 60%),
    linear-gradient(to bottom, var(--link-blue) 60%, transparent 60%),
    linear-gradient(to bottom, var(--link-blue) 60%, transparent 60%);
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-size: 18px 2.5px, 18px 2.5px, 2.5px 18px, 2.5px 18px;
  background-position: top left, bottom left, left top, right top;
  color: var(--link-blue);
  font-weight: 600;
  min-height: 48px;
}

.photo-picker-icon {
  width: 1.15em;
  height: 1.15em;
}

.photo-picker-btn:disabled,
.photo-picker-btn.is-inactive {
  opacity: 0.5;
}

.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.photo-grid img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 0.4rem;
  border: 1px solid var(--border);
  display: block;
}

.photo-thumb {
  position: relative;
  width: 64px;
  height: 64px;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
}

.photo-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--card-bg);
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Buttons ---- */

.btn-primary {
  width: 100%;
  padding: 0.9rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-blue-fg);
  background: var(--accent-blue);
  border: none;
  border-radius: 0.5rem;
  min-height: 48px;
}

.btn-primary.is-inactive {
  background: var(--inactive-bg);
  color: #fff;
}

.btn-primary:disabled {
  opacity: 0.6;
}

.btn-primary.is-inactive:disabled {
  opacity: 1;
}

.btn-60 {
  width: 60%;
  display: block;
  margin: 1rem auto 0;
}

.btn-90 {
  width: 90%;
  display: block;
  margin: 1rem auto 0;
}

.btn-secondary {
  width: 100%;
  padding: 0.7rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  min-height: 44px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0 0.6rem;
  display: inline-flex;
  align-items: center;
}

.validation {
  padding: 0.7rem 0.85rem;
  margin-bottom: 1rem;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 0.4rem;
  font-weight: 600;
}

.banner {
  padding: 1rem;
  margin-top: 1rem;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 0.5rem;
}

.banner p {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

/* ---- AppBottom "Kontakt Epcan": auf jedem Screen sichtbar ---- */

.app-bottom h2 {
  margin: 0 0 0.85rem;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--link-blue);
}

.contact-icon img {
  width: 18px;
  height: 18px;
}

.contact-text {
  display: flex;
  flex-direction: column;
}

.contact-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.contact-value {
  font-weight: 700;
  color: var(--link-blue);
  text-decoration: none;
}

.contact-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.25rem 0;
}

.app-bottom {
  margin-top: 1.5rem;
}
