/* wealab · Login: Zeichenmaschine im Hintergrund (login.js), schlichte Karte.
   Farben aus kzi-skript.sty (basis.css). Breit: Karte links, Figur im freien Platz rechts.
   Schmal (Handy): Karte oben, damit die Tastatur das Eingabefeld nicht verdeckt; die Seite darf
   dort scrollen, die Figur läuft im Hintergrund. */
html, body { height: 100%; }
body { min-height: 100svh; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
#bild, #oben, #zeiger { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.buehne {
  position: relative; z-index: 1; flex: 1;
  display: flex; align-items: center; justify-content: flex-start;
  width: 100%; padding: 2rem clamp(1.5rem, 8vw, 8rem); pointer-events: none;
}
.buehne > * { pointer-events: auto; }

.karte {
  width: min(22rem, 100%); padding: 1.5rem 1.5rem 1.75rem;
  background: var(--papier); border-radius: var(--r-fenster);
  box-shadow: 0 0 0 1px var(--linie), var(--schatten-gross);
}
.karte .marke { display: inline-flex; margin-bottom: 2.25rem; }
.karte .marke span { display: block; }
.karte h1 { margin: 0; font: 600 1.9rem/1.15 var(--sans); color: var(--text); }
.aufgabe { margin: .25rem 0 1.5rem; font: .98rem/1.5 var(--sans); color: var(--text-3); }
.datenschutz { margin: 1.25rem 0 0; font: .78rem/1.5 var(--sans); color: var(--text-3); }
.karte.wackeln { animation: wackeln .45s; }
@keyframes wackeln { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.karte.erfolg { transform: translateY(-6px); opacity: 0; transition: transform .4s cubic-bezier(.22, 1, .36, 1), opacity .4s cubic-bezier(.22, 1, .36, 1); }

.feld { position: relative; display: flex; align-items: center; }
.feld input {
  width: 100%; height: 3.1rem; padding: 0 3rem 0 1rem; border-radius: var(--r-karte);
  border: 1px solid var(--linie); background: var(--bg);
  font: 500 1.08rem var(--sans); letter-spacing: .03em; color: var(--text); transition: border-color .2s, box-shadow .2s, background .2s;
}
.feld input::placeholder { color: var(--text-3); letter-spacing: 0; font-weight: 400; }
.feld input:focus { outline: none; background: var(--papier); border-color: var(--akzent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 16%, transparent); }
.feld.fehler input { border-color: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 14%, transparent); }
.auge { position: absolute; right: .35rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-knopf); color: var(--text-3); }
.auge:hover { color: var(--text); }
.auge[aria-pressed="true"] { color: var(--akzent); }
.auge svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.5; }

.los {
  margin-top: .75rem; width: 100%; height: 3.1rem; border: 0; border-radius: var(--r-karte);
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 1.02rem var(--sans); color: var(--papier); background: var(--akzent); transition: background .15s;
}
.los:hover { background: var(--akzent-stark); }
.los svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.los:active { transform: scale(.98); }
.los[disabled] { opacity: .7; cursor: progress; }

.meldung { margin: -.5rem 0 1rem; padding: .5rem .75rem; border-radius: var(--r-knopf); font-size: .92rem; }
.meldung.fehler { background: var(--falschbg); color: var(--warn); }
.meldung.info { background: var(--okbg); color: var(--gruen); }

/* kleine Legende zur Figur, unten rechts */
.legende { position: fixed; z-index: 1; right: 1.2rem; bottom: 1rem; margin: 0; max-width: min(22rem, calc(100% - 2.4rem)); text-align: right;
  font: .88rem/1.4 var(--serif); color: var(--text-3); pointer-events: none; transition: opacity .8s; }
.legende small { font: 500 .75rem var(--sans); }

@media (max-width: 760px) {
  html, body { height: auto; }
  body { overflow: auto; }
  /* Karte oben (die Tastatur verdeckt sonst das Feld), mit Luft zum Rand; das Bild läuft darunter */
  .buehne { align-items: flex-start; justify-content: center; min-height: 100svh;
    padding: calc(1.25rem + 3vh + env(safe-area-inset-top)) 1rem calc(4.5rem + env(safe-area-inset-bottom)); }
  .karte { width: min(26rem, 100%); padding: 1.25rem 1.25rem 1.5rem; border-radius: var(--r-fenster); }
  .karte .marke { margin-bottom: 1.25rem; }
  .karte h1 { font-size: 1.75rem; }
  .aufgabe { margin-bottom: 1rem; }
  .feld input, .los { height: 3.25rem; }
  .feld input { font-size: 1.1rem; scroll-margin: 6rem 0; }
  .datenschutz { margin-top: 1rem; }
  .legende { right: 1rem; bottom: calc(.9rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) and (max-height: 620px) {
  .buehne { padding-top: calc(.75rem + env(safe-area-inset-top)); }
  .karte .marke { margin-bottom: .75rem; }
}
