/* =========================================================
   Kundenformular – sehr einfache, grosse Bedienung
   ========================================================= */
:root {
  --pastel: #dcebc5; --pastel-2: #cbe2a6; --pastel-3: #b8d78a; --pastel-50: #f2f6eb;
  --ink: #1f2420; --ink-2: #434a44; --muted: #5f665f; --line: #e2e4df; --grey: #f7f7f7;
  --err: #b42318; --err-bg: #fdecea;
  --font: "Lexend", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --head: "Outfit", "Lexend", system-ui, sans-serif;
  --tap: 60px;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
@media (max-width: 640px) { html { font-size: 106.25%; } }
body { margin: 0; font-family: var(--font); color: var(--ink); background: #fff; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #3e4a36; outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
.c-wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 18px; }

/* Kopf */
.c-top { background: var(--grey); border-bottom: 1px solid #ececec; }
.c-top__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.c-brand img { height: 52px; width: auto; }
.c-langbtn { border: 0; background: #fff; padding: 6px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.c-langbtn img { width: 44px; height: 27px; object-fit: cover; }
@media (max-width: 480px) { .c-brand img { height: 40px; } }

.c-main { padding-top: 26px; padding-bottom: 140px; }

/* Fortschritt */
.c-progress { margin-bottom: 26px; }
.c-progress__text { font-weight: 600; color: var(--muted); font-size: .95rem; margin-bottom: 8px; }
.c-progress__bar { height: 10px; border-radius: 999px; background: #eceee9; overflow: hidden; }
.c-progress__bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--pastel-2), var(--pastel-3)); transition: width .35s ease; }

/* Schritt */
.c-step { animation: c-in .3s ease both; }
@keyframes c-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.c-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.c-step h1 { font-family: var(--head); font-size: clamp(1.55rem, 4vw, 2.1rem); line-height: 1.2; margin: 0 0 10px; letter-spacing: -.01em; }
.c-hint { color: var(--ink-2); margin: 0 0 20px; font-size: 1.02rem; }
.c-small { font-size: .9rem; color: var(--muted); }
.c-sub { color: var(--muted); margin-top: 22px; text-align: center; }

/* Sprache: grosse Flaggen-Kacheln */
.c-flags { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
@media (min-width: 640px) { .c-flags { grid-template-columns: repeat(4, 1fr); } }
.c-flag { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 10px 14px; border: 2px solid var(--line); border-radius: 16px; background: #fff; font-weight: 600; font-size: .95rem; transition: border-color .15s, transform .15s, box-shadow .15s; }
.c-flag img { width: 72px; height: 44px; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.c-flag:hover { border-color: var(--pastel-3); transform: translateY(-2px); box-shadow: 0 8px 18px -10px rgba(0,0,0,.3); }
.c-flag[aria-pressed="true"] { border-color: var(--pastel-3); background: var(--pastel-50); }

/* Felder */
.c-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 14px; margin-bottom: 22px; }
.c-grid > * { grid-column: 1 / -1; }
@media (min-width: 640px) { .c-half { grid-column: span 3 !important; } .c-third { grid-column: span 2 !important; } .c-twothirds { grid-column: span 4 !important; } }
.c-field { display: grid; gap: 7px; font-weight: 600; }
.c-input { width: 100%; min-height: var(--tap); padding: 14px 16px; border: 2px solid #cfd3cc; border-radius: 14px; background: #fff; font-weight: 400; font-size: 1.05rem; transition: border-color .15s, box-shadow .15s; }
.c-input:focus { outline: none; border-color: #7d8a73; box-shadow: 0 0 0 4px rgba(203, 226, 166, .7); }
.c-field.is-invalid .c-input { border-color: var(--err); background: #fffafa; }
.c-msg { color: var(--err); font-weight: 600; font-size: .9rem; }
.c-err { color: var(--err); font-weight: 600; margin: 10px 0 0; }
.c-err:empty { display: none; }
.c-year .c-input { font-size: 1.3rem; letter-spacing: .04em; }
.c-fieldset { border: 0; padding: 0; margin: 6px 0 0; }
.c-fieldset legend { font-family: var(--head); font-weight: 600; font-size: 1.25rem; padding: 0; margin-bottom: 4px; }

/* Auswahl-Kacheln */
.c-tiles { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .c-tiles { grid-template-columns: 1fr 1fr; } }
.c-tiles--wide { grid-template-columns: 1fr !important; margin-bottom: 22px; }
.c-tile { position: relative; display: flex; align-items: center; gap: 14px; min-height: var(--tap); padding: 14px 18px; border: 2px solid #cfd3cc; border-radius: 16px; background: #fff; cursor: pointer; line-height: 1.35; transition: border-color .15s, background-color .15s; }
.c-tile:hover { border-color: var(--pastel-3); }
.c-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.c-mark { width: 28px; height: 28px; flex: none; border: 2px solid #8d958a; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.c-tile input[type="checkbox"] + .c-mark { border-radius: 8px; }
.c-tile input:checked + .c-mark { border-color: #5d7f33; background: #6f9a3a; }
.c-tile input[type="radio"]:checked + .c-mark::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: #fff; }
.c-tile input[type="checkbox"]:checked + .c-mark::after { content: ""; width: 8px; height: 14px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); }
.c-tile:has(input:checked) { border-color: var(--pastel-3); background: var(--pastel-50); }
.c-tile input:focus-visible + .c-mark { outline: 3px solid #3e4a36; outline-offset: 2px; }
.c-tile--single { margin-top: 6px; }
.c-consent { margin-top: 22px; font-size: .98rem; }

/* Upload */
.c-drops { display: grid; gap: 14px; }
.c-drop__zone { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 22px 16px; border: 2px dashed #b9beb6; border-radius: 18px; background: #fafbf8; cursor: pointer; transition: border-color .15s, background-color .15s; }
.c-drop__zone svg { width: 34px; height: 34px; color: #6f9a3a; margin-bottom: 4px; }
.c-drop__zone b { font-family: var(--head); font-size: 1.15rem; }
.c-drop__zone small { color: var(--muted); font-size: .92rem; }
.c-drop__zone:hover, .c-drop__zone.is-over { border-color: #6f9a3a; background: var(--pastel-50); }
.c-drop.has-files .c-drop__zone { border-style: solid; border-color: var(--pastel-3); }
.c-files { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.c-files li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.c-file__icon { font-size: .7rem; font-weight: 700; color: #fff; background: #8d958a; border-radius: 6px; padding: 3px 6px; }
.c-file__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.c-file__size { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.c-file__del { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--err-bg); color: var(--err); font-size: 1.4rem; line-height: 1; flex: none; }
.c-meter { margin-top: 18px; }
.c-meter__bar { height: 8px; border-radius: 999px; background: #eceee9; overflow: hidden; }
.c-meter__bar span { display: block; height: 100%; width: 0; background: var(--pastel-3); transition: width .3s; }
.c-meter__bar.is-full span { background: #e0a800; }
.c-meter p { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }

/* Zusammenfassung */
.c-sum { margin: 10px 0 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.c-sum__row { display: grid; grid-template-columns: 34% 1fr auto; gap: 10px; align-items: start; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.c-sum__row:last-child { border-bottom: 0; }
.c-sum__row:nth-child(odd) { background: #fafbf8; }
.c-sum dt { font-weight: 600; color: var(--ink-2); }
.c-sum dd { margin: 0; overflow-wrap: anywhere; }
.c-link { border: 0; background: none; color: #3e4a36; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 0 2px; min-height: 32px; }
@media (max-width: 560px) { .c-sum__row { grid-template-columns: 1fr auto; } .c-sum__row dd:not(.c-sum__edit) { grid-column: 1 / -1; grid-row: 2; } }

/* Untere Leiste */
.c-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255,255,255,.97); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
.c-nav__inner { display: flex; gap: 12px; justify-content: space-between; }
.c-btn { flex: 1 1 0; max-width: 300px; min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; gap: .5em; border-radius: 999px; border: 2px solid transparent; font-family: var(--head); font-weight: 600; font-size: 1.1rem; transition: background-color .15s; }
.c-btn--primary { background: var(--pastel-2); border-color: var(--pastel-3); margin-left: auto; }
.c-btn--primary:hover { background: var(--pastel-3); }
.c-btn--send { background: #6f9a3a; border-color: #5d7f33; color: #fff; }
.c-btn--send:hover { background: #5d7f33; }
.c-btn--ghost { background: #fff; border-color: #cfd3cc; }
.c-btn:disabled { opacity: .7; cursor: wait; }

/* Danke */
.c-done { text-align: center; padding: 30px 0 60px; }
.c-done__icon { width: 96px; height: 96px; margin: 0 auto 22px; border-radius: 50%; background: var(--pastel-2); display: grid; place-items: center; font-size: 3rem; box-shadow: 0 0 0 12px var(--pastel-50); }
.c-done h1 { font-family: var(--head); font-size: 2rem; margin: 0 0 12px; }
.c-done p { font-size: 1.12rem; color: var(--ink-2); }
.c-done__files { background: #fff6df; border: 1px solid #f1d48a; border-radius: 14px; padding: 12px 16px; font-size: 1rem !important; color: var(--ink) !important; }
.c-call a { font-family: var(--head); font-weight: 700; color: var(--ink); font-size: 1.3rem; }

.c-honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Zusatzangaben (Verkauf / Vermietung / Baugenehmigung) */
.c-block { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 4px; margin-bottom: 14px; background: #fcfdfb; }
.c-block__head { font-family: var(--head); font-weight: 600; font-size: 1.12rem; margin: 0 0 10px; }
.c-block__q { font-weight: 600; margin: 0 0 8px; }
.c-tiles--3 { grid-template-columns: repeat(3, 1fr) !important; margin-bottom: 14px; }
.c-tiles--3 .c-tile { justify-content: center; text-align: center; flex-direction: column; gap: 6px; padding: 10px 8px; }

/* =========================================================
   Handy: jeder Schritt passt ohne Scrollen auf einen Bildschirm
   (Ziel: ca. 390 × 660 px sichtbare Fläche in Safari/Chrome)
   ========================================================= */
@media (max-width: 640px) {
  html { font-size: 100%; }
  :root { --tap: 46px; }
  .c-wrap { padding: 0 14px; }

  .c-top__inner { padding-top: 5px; padding-bottom: 5px; }
  .c-brand img { height: 28px; }
  .c-langbtn { padding: 4px; }
  .c-langbtn img { width: 30px; height: 19px; }

  .c-main { padding-top: 9px; padding-bottom: 84px; }
  .c-progress { margin-bottom: 9px; }
  .c-progress__text { font-size: .78rem; margin-bottom: 4px; }
  .c-progress__bar { height: 6px; }

  .c-kicker { font-size: .7rem; margin-bottom: 2px; }
  .c-step h1 { font-size: 1.2rem; line-height: 1.25; margin-bottom: 6px; }
  .c-hint { font-size: .86rem; margin-bottom: 10px; line-height: 1.4; }
  .c-small { font-size: .76rem; }
  .c-sub { font-size: .82rem; margin-top: 10px; }

  /* Felder: paarweise nebeneinander, flacher */
  .c-grid { gap: 8px 10px; margin-bottom: 12px; }
  .c-half { grid-column: span 3 !important; }
  .c-third { grid-column: span 2 !important; }
  .c-twothirds { grid-column: span 4 !important; }
  .c-field { gap: 3px; font-size: .8rem; }
  .c-input { min-height: var(--tap); padding: 9px 12px; border-radius: 11px; font-size: 1rem; }
  .c-msg { font-size: .76rem; }
  .c-err { font-size: .82rem; margin-top: 6px; }
  .c-year .c-input { font-size: 1.1rem; }
  .c-fieldset legend { font-size: 1rem; margin-bottom: 0; }

  /* Sprache: 4 Flaggen pro Reihe */
  .c-flags { grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 10px; }
  .c-flag { padding: 9px 3px 7px; gap: 5px; border-radius: 12px; font-size: .66rem; line-height: 1.15; }
  .c-flag img { width: 44px; height: 27px; }

  /* Auswahl-Kacheln */
  .c-tiles { grid-template-columns: 1fr 1fr; gap: 7px; }
  .c-tiles--wide { margin-bottom: 12px; }
  .c-tile { min-height: var(--tap); padding: 8px 10px; gap: 9px; border-radius: 12px; font-size: .86rem; line-height: 1.25; }
  .c-mark { width: 22px; height: 22px; }
  .c-tile input[type="checkbox"] + .c-mark { border-radius: 6px; }
  .c-tile input[type="radio"]:checked + .c-mark::after { width: 9px; height: 9px; }
  .c-tile input[type="checkbox"]:checked + .c-mark::after { width: 6px; height: 11px; }
  .c-consent { margin-top: 10px; font-size: .8rem; }

  /* Upload: flache Felder, Symbol links */
  .c-drops { gap: 8px; }
  .c-drop__zone { grid-template-columns: auto 1fr; justify-items: start; text-align: left; column-gap: 12px; row-gap: 0; padding: 9px 12px; border-radius: 13px; }
  .c-drop__zone svg { grid-row: span 2; width: 26px; height: 26px; margin: 0; }
  .c-drop__zone b { font-size: .92rem; line-height: 1.2; }
  .c-drop__zone small { font-size: .74rem; }
  .c-files { margin-top: 5px; gap: 4px; }
  .c-files li { padding: 3px 4px 3px 8px; border-radius: 9px; }
  .c-file__name { font-size: .8rem; }
  .c-file__size { font-size: .72rem; }
  .c-file__del { width: 32px; height: 32px; font-size: 1.15rem; }
  .c-meter { margin-top: 10px; }
  .c-meter p { font-size: .76rem; margin-top: 3px; }

  /* Kontrolle: kompakte Tabelle */
  .c-sum { border-radius: 12px; margin-top: 4px; }
  .c-sum__row { grid-template-columns: 24% 1fr auto !important; gap: 6px; padding: 3px 5px 3px 9px; font-size: .74rem; line-height: 1.28; align-items: center; }
  .c-sum dt { overflow-wrap: anywhere; }
  .c-sum__row dd:not(.c-sum__edit) { grid-column: auto !important; grid-row: auto !important; }
  .c-link { min-height: 26px; font-size: .74rem; }
  .c-link--icon { width: 32px; height: 28px; border-radius: 8px; background: var(--pastel-50); text-decoration: none; font-size: .95rem; }

  /* untere Leiste */
  .c-nav { padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
  .c-btn { min-height: 48px; font-size: 1rem; }

  .c-block { padding: 9px 10px 1px; margin-bottom: 9px; border-radius: 12px; }
  .c-block__head { font-size: .95rem; margin-bottom: 6px; }
  .c-block__q { font-size: .8rem; margin-bottom: 5px; }
  .c-tiles--3 { gap: 6px; margin-bottom: 9px; }
  .c-tiles--3 .c-tile { flex-direction: row; justify-content: flex-start; text-align: left; padding: 7px 6px; gap: 5px; font-size: .72rem; line-height: 1.15; min-height: 0; }
  .c-tiles--3 .c-mark { width: 18px; height: 18px; }
  .c-tiles--3 .c-tile input[type="radio"]:checked + .c-mark::after { width: 7px; height: 7px; }
  .c-step[data-step="2"] h1 { margin-bottom: 2px; }
  .c-step[data-step="2"] > .c-hint { font-size: .78rem; margin-bottom: 7px; }
  .c-block .c-grid { margin-bottom: 8px; }
  .c-done { padding: 16px 0 30px; }
  .c-done__icon { width: 76px; height: 76px; font-size: 2.4rem; margin-bottom: 16px; }
  .c-done h1 { font-size: 1.6rem; }
  .c-done p { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
