/* Lösungsfinder (loesung.html) — baut auf styles.css auf (.sr und .nav a[aria-current] kommen von dort) */
/* Kontrast: Ränder von Auswahlmarken und Eingabefeldern mindestens 3:1 auf Weiß */

.finder {
  padding-block: clamp(2.5rem, 1.5rem + 3vw, 4.5rem) var(--abschnitt);
  background: linear-gradient(to bottom, var(--wand-mitte), var(--kalk) 420px);
}
.finder-raster { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2.5rem, 1.5rem + 3vw, 5rem); align-items: start; }
.finder-seite { position: sticky; top: 100px; }
.finder-seite h1 { font-size: clamp(2.2rem, 1.5rem + 2.4vw, 3.4rem); font-weight: 340; line-height: 1.04; letter-spacing: -.035em; }
.finder-seite .lead { margin-top: 1rem; }

/* Weg wählen */
.pfad-wahl { display: grid; gap: .6rem; margin-top: 2rem; }
.pfad-wahl button {
  position: relative; display: grid; gap: .15rem; text-align: left; padding: .95rem 1.1rem .95rem 2.75rem; border-radius: 14px;
  border: 1px solid var(--linie-2); background: rgb(255 255 255 / .55); color: var(--anthrazit-2); font: inherit; cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.pfad-wahl button::before { content: ''; position: absolute; left: 1.05rem; top: 1.2rem; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #8a8e89; background: #fff; transition: border .2s; }
.pfad-wahl button:hover { border-color: var(--anthrazit-2); background: #fff; }
.pfad-wahl button[aria-checked="true"] { border-color: var(--bronze); background: #fff; box-shadow: inset 0 0 0 1px var(--bronze); }
.pfad-wahl button[aria-checked="true"]::before { border: 5px solid var(--bronze); }
.pfad-wahl strong { color: var(--anthrazit); font-weight: 560; }
.pfad-wahl span { font-size: var(--fs-klein); color: var(--grau); }

/* Fortschritt wie Achsen im Grundriss */
.fortschritt { position: relative; display: grid; gap: .1rem; margin-top: 2.25rem; }
.fortschritt::before { content: ''; position: absolute; left: 13.5px; top: 14px; bottom: 14px; width: 1px; background: var(--linie-2); }
.fortschritt li > * { position: relative; display: flex; align-items: center; gap: .85rem; width: 100%; padding: .35rem 0; border: 0; background: none; font: inherit; color: var(--grau); text-align: left; }
.fortschritt button { cursor: pointer; }
.fortschritt button:hover > span:not(.achse):not(.sr) { color: var(--anthrazit); text-decoration: underline; text-underline-offset: 3px; }
.fortschritt .achse { width: 28px; height: 28px; font-size: .8125rem; border-color: var(--linie-2); color: var(--grau); }
.fortschritt .achse svg { width: 15px; height: 15px; }
.fortschritt .ist-erledigt .achse { border-color: var(--bronze); color: var(--bronze-text); }
.fortschritt .ist-erledigt > * { color: var(--anthrazit-2); }
.fortschritt .ist-aktuell .achse { background: var(--bronze-dunkel); border-color: var(--bronze-dunkel); color: #fff; }
.fortschritt .ist-aktuell > * { color: var(--anthrazit); font-weight: 560; }

/* Empfehlung entsteht live */
.live { margin-top: 2rem; padding: 1.25rem 1.35rem; border-radius: 16px; background: var(--bronze-hell); }
.live h2 { font-size: var(--fs-klein); font-weight: 600; color: var(--bronze-text); }
.live-liste { display: grid; gap: .45rem; margin-top: .8rem; font-size: var(--fs-klein); color: var(--anthrazit); }
.live-liste li { display: flex; align-items: center; gap: .6rem; }
.live-liste li::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--bronze); }
.live-liste li.nach-mass::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bronze); }
.live-liste li.ist-neu { animation: dazu .6s var(--ease); }
@keyframes dazu { from { opacity: 0; transform: translateX(-8px); } }

/* Karte mit der aktuellen Frage */
.finder-karte { scroll-margin-top: 92px; background: #fff; border-radius: 22px; padding: clamp(1.4rem, .8rem + 2.4vw, 2.75rem); box-shadow: var(--schatten-fenster); }
.finder-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* wie .sr */
.finder-inhalt.tritt-ein { animation: eintreten .45s var(--ease); }
@keyframes eintreten { from { opacity: 0; transform: translateY(10px); } }
.schritt-zahl { font-size: var(--fs-klein); font-weight: 560; color: var(--bronze-text); }
.frage { margin-top: .4rem; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); font-weight: 400; line-height: 1.15; letter-spacing: -.02em; }
.frage:focus { outline: none; }
.frage-hinweis { margin-top: .5rem; color: var(--grau); }
.gruppe { border: 0; padding: 0; margin: 1.75rem 0 0; min-width: 0; }
.gruppe-titel { padding: 0; margin-bottom: .75rem; font-weight: 560; color: var(--anthrazit); }
.optionen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.optionen-kurz { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } /* 220: „Sondereigentums-“ passt in eine Zeile */
.option { position: relative; display: block; }
.option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.option-flaeche {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: .8rem; row-gap: .15rem; align-items: center; height: 100%;
  padding: .95rem 1.05rem; border-radius: 14px; border: 1px solid var(--linie-2); background: #fff; cursor: pointer;
  transition: border-color .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease);
}
.option-marke { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #8a8e89; background: #fff center / 14px no-repeat; transition: background-color .15s, border-color .15s; }
.option input[type="radio"] + .option-flaeche .option-marke { border-radius: 50%; }
.option-flaeche:has(.option-text) { align-items: start; }
.option-flaeche:has(.option-text) .option-marke { margin-top: 1px; }
.option-titel { color: var(--anthrazit); font-weight: 500; line-height: 1.35; hyphens: auto; overflow-wrap: break-word; }
.option-text { grid-column: 2; font-size: .875rem; color: var(--grau); line-height: 1.45; }
.option:hover .option-flaeche { border-color: #9da19b; }
.option input:checked + .option-flaeche { border-color: var(--bronze); background: #fcf8f3; box-shadow: inset 0 0 0 1px var(--bronze); }
.option input:checked + .option-flaeche .option-marke {
  background-color: var(--bronze); border-color: var(--bronze);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5l3.5 3.5 7.5-8' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.option input[type="radio"]:checked + .option-flaeche .option-marke { background-image: none; box-shadow: inset 0 0 0 4px #fff; }
.option input:focus-visible + .option-flaeche { outline: 2px solid var(--bronze); outline-offset: 2px; }

.freitext { margin-top: 1.75rem; display: grid; gap: .45rem; }
.freitext label { font-weight: 560; color: var(--anthrazit); }
.freitext label span, .feld-hell label span { font-weight: 400; color: var(--grau); }
.freitext textarea, .feld-hell input {
  width: 100%; border: 1px solid #8a8e89; border-radius: 12px; background: #fff; color: var(--anthrazit);
  font: 400 1rem/1.5 var(--schrift); transition: border-color .2s, box-shadow .2s;
}
.freitext textarea { padding: .8rem 1rem; resize: vertical; min-height: 96px; }
.freitext textarea:focus, .feld-hell input:focus { outline: none; border-color: var(--bronze); box-shadow: 0 0 0 3px rgb(160 112 63 / .18); }
.schritt-fehler { margin-top: 1rem; color: #b0262a; font-size: var(--fs-klein); }
.schritt-fehler:empty { display: none; }
.finder-aktionen { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--linie); }

/* Ergebnis */
.empfehlung-gruppe { margin-top: 2rem; font-size: var(--fs-klein); font-weight: 600; color: var(--bronze-text); }
.empfehlung { margin-top: .75rem; border-bottom: 1px solid var(--linie); }
.empfehlung li { position: relative; display: grid; gap: .2rem; padding: 1.05rem 0 1.05rem 1.9rem; border-top: 1px solid var(--linie); }
.empfehlung li::before { content: ''; position: absolute; left: 2px; top: 1.45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--bronze); }
.empfehlung li.nach-mass::before { background: transparent; box-shadow: inset 0 0 0 2px var(--bronze); }
.empfehlung-name { color: var(--anthrazit); font-weight: 560; font-size: 1.0625rem; }
.marke-mass { display: inline-block; margin-left: .45rem; padding: 1px 8px; border-radius: 999px; background: var(--bronze-hell); color: var(--bronze-text); font-size: .75rem; font-weight: 600; vertical-align: 2px; }
.empfehlung-text { font-size: var(--fs-klein); color: var(--anthrazit-2); }
.empfehlung-grund { font-size: .8125rem; color: var(--grau); }

.anfrage { margin-top: 2.25rem; padding: clamp(1.25rem, 1rem + 1vw, 1.75rem); border-radius: 18px; background: var(--kalk); box-shadow: inset 0 0 0 1px var(--linie); }
.anfrage h3 { font-size: 1.375rem; font-weight: 480; letter-spacing: -.01em; }
.anfrage > p { margin-top: .35rem; font-size: var(--fs-klein); color: var(--grau); }
.anfrage-felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.4rem 0 1.25rem; }
.feld-hell { display: grid; gap: .35rem; align-content: start; }
.feld-hell label { font-size: var(--fs-klein); color: var(--anthrazit-2); }
.feld-hell input { min-height: 48px; padding: 0 .95rem; }
.feld-hell.hat-fehler input { border-color: #c9302c; }
.feld-hell .feld-fehler { color: #b0262a; font-size: .875rem; }
.anfrage .anfrage-hinweis { margin-top: .9rem; font-size: .875rem; }
.anfrage-hinweis a { color: var(--anthrazit-2); }
.anfrage-status:empty { display: none; }
.anfrage-status { margin-top: 2rem; padding: 1.25rem 1.4rem; border-radius: 16px; background: var(--bronze-hell); color: var(--anthrazit); }
.anfrage-status:focus { outline: none; } /* bekommt nach dem Absenden den Fokus, ist aber kein Bedienelement */
.anfrage-status strong { display: block; font-size: 1.25rem; font-weight: 520; margin-bottom: .2rem; }
.link-knopf { margin-top: 1.4rem; padding: 0; border: 0; background: none; font: inherit; color: var(--bronze-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

@media (max-width: 900px) {
  .finder-raster { grid-template-columns: minmax(0, 1fr); }
  .finder-seite { position: static; }
  .live { display: none; }
  .fortschritt { display: flex; gap: .35rem; margin-top: 1.75rem; overflow-x: auto; }
  .fortschritt::before { display: none; }
  .fortschritt li > * { width: auto; padding: 0; gap: .5rem; }
  /* Schrittnamen nur sichtbar ausblenden (nicht display:none), damit die Knöpfe ihren Namen behalten */
  .fortschritt li > * > span:not(.achse):not(.sr) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .fortschritt .ist-aktuell > * > span:not(.achse):not(.sr) { position: static; width: auto; height: auto; overflow: visible; clip: auto; margin-right: .5rem; }
  .optionen, .anfrage-felder { grid-template-columns: 1fr; }
  .optionen-kurz { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finder-karte { scroll-margin-top: 76px; }
}
/* Handy: lange Wörter wie „Sondereigentumsverwaltung“ passen nicht in zwei Spalten */
@media (max-width: 480px) {
  .optionen-kurz { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .finder-inhalt.tritt-ein, .live-liste li.ist-neu { animation: none; }
}
