/* Missing Object – Anmeldeseite.
   Weißes Lamm (Silhouette aus dem Logo) und zwei Eingabezeilen in dünner
   weißer Schrift direkt auf dem Bild; dazwischen eine weiße Linie, die nach
   rechts ausläuft, am Ende ein dezenter Pfeil. Ein weicher dunkler Schatten
   unter allem Weißen hält es auf dem Bild lesbar.
   Hintergrund: Caspar David Friedrich, „Winterlandschaft mit Kirche“ (1811). */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/public/fonts/inter-var-latin.woff2') format('woff2');
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white: #fff;
  --row: clamp(46px, 3.9vw, 56px);          /* Höhe einer Eingabezeile */
  --h: calc(var(--row) * 2.1);               /* Lamm knapp so hoch wie beide Zeilen */
  --lamb-w: calc(var(--h) * 0.451);          /* Seitenverhältnis lamm-white.svg */
  --gap: clamp(36px, 4vw, 60px);
  --side: clamp(28px, 7vw, 64px);
  --type: clamp(22px, 1.9vw, 28px);
  --fw: clamp(240px, 24vw, 340px);          /* Breite der Eingabezeilen */
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 20px rgba(0,0,0,.55);
  color-scheme: light dark;
}

/* Grundfarbe aus der Bildmitte, falls irgendwo kein Bild liegt */
html { background: #7d8486; }
html, body { height: 100%; }
body {
  font-family: "Helvetica Neue", 'Inter', Helvetica, Arial, sans-serif;
  color: var(--white);
  background: transparent;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Hintergrundbild ───────────────────────────── */
.scene {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url('/public/winterlandschaft.jpg') no-repeat 50% 46% / cover;
}
@media (max-width: 1200px) {
  .scene { background-image: url('/public/winterlandschaft-1200.jpg'); }
}
/* Touch-Geräte: Ebene ragt oben und unten über den sichtbaren Bereich
   hinaus, damit Safari das Bild auch unter Status- und Adressleiste zeigt
   statt einer Farbfläche. */
@media (pointer: coarse) {
  .scene {
    top: calc(-1 * max(env(safe-area-inset-top), 80px));
    bottom: calc(-1 * max(env(safe-area-inset-bottom), 140px));
  }
}
.scene::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 70% at 45% 50%, rgba(8,12,16,.18), rgba(8,12,16,.04) 70%);
}

/* ── Bühne ─────────────────────────────────────── */
.stage {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 18vh var(--side) 8vh;
}

.login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap);
  max-width: 100%;
  animation: arrive 1s .3s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes arrive {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.logo {
  flex: 0 0 auto;
  width: var(--lamb-w);
  height: var(--h);
  display: block;
  filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.42)) drop-shadow(0 3px 18px rgba(0,0,0,.52));
}

.fields {
  position: relative;
  flex: 0 1 var(--fw);
  width: var(--fw);
  min-width: 0;
  display: flex; flex-direction: column;
}

.row { position: relative; height: var(--row); display: flex; align-items: center; }

.row input {
  width: 100%; height: 100%;
  border: 0; outline: 0;
  background: transparent;
  color: var(--white);
  caret-color: var(--white);
  font: inherit;
  font-size: var(--type);
  font-weight: 300;
  letter-spacing: -.02em;
  text-shadow: var(--shadow);
  padding: 0 calc(var(--row) * 0.9) 0 calc(var(--type) * 0.06);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
/* Eingegebener Text = genau Chromes Vorschau für gespeicherte Zugangsdaten
   (feste Systemschrift 13,33 px, von keiner Seite änderbar). So springt
   beim ersten Klick nichts. Auf dem Handy 16 px, sonst zoomt iOS hinein. */
:root { --value-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --value-size: 13.333px; }
.row input:not(:placeholder-shown) {
  font-family: var(--value-font);
  font-size: var(--value-size);
  font-weight: 400;
  letter-spacing: 0;
}
.row input:-webkit-autofill { font-family: var(--value-font); font-size: var(--value-size); font-weight: 400; letter-spacing: 0; }
.row input:autofill         { font-family: var(--value-font); font-size: var(--value-size); font-weight: 400; letter-spacing: 0; }
.row input::placeholder { color: var(--white); opacity: 1; transition: opacity .25s; }
.row input:focus::placeholder { opacity: .5; }
/* Browser-Autofill: ohne farbige Fläche, ohne Chromes eigene Schrift */
.row input:-webkit-autofill::first-line {
  font-family: var(--value-font);
  font-size: var(--value-size);
  font-weight: 400;
}
.row input:-webkit-autofill,
.row input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--white);
  transition: background-color 600000s 0s, color 600000s 0s;
}

/* Die Linie: beginnt leicht vor dem Text, läuft nach rechts aus */
.line {
  position: absolute;
  left: calc(var(--gap) * -0.12);
  right: 48px;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,.85) 35%, rgba(255,255,255,.25) 80%, rgba(255,255,255,0) 100%);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)) drop-shadow(0 1px 8px rgba(0,0,0,.55));
  pointer-events: none;
}
/* Fokus: die Linie wird kurz kräftiger */
.fields:focus-within .line { height: 1.5px; }

/* Weiter-Knopf am Ende der Linie: dünner Kreis mit Pfeil,
   gefüllt sobald beide Felder ausgefüllt sind */
.go {
  position: absolute;
  right: -6px;
  top: 50%;
  width: 48px; height: 48px;
  transform: translateY(-50%);
  border: 0; background: transparent;
  display: grid; place-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.go span {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.75);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.15), 0 2px 16px rgba(0,0,0,.48);
  transition: background-color .25s, color .25s, border-color .25s, transform .25s;
}
.go svg { width: 14px; height: 14px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.55)); }
.go.ready span { background: #fff; border-color: #fff; color: #111; }
.go.ready svg { filter: none; }
.go.ready:hover span { transform: translateX(2px); }
.go:focus-visible { outline: none; }
.go:focus-visible span { box-shadow: 0 0 0 3px rgba(255,255,255,.45); }
.busy .go span { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── Meldung ───────────────────────────────────── */
.msg {
  width: calc(var(--lamb-w) + var(--gap) + var(--fw));
  max-width: 100%;
  margin-top: 14px;
  padding-left: calc(var(--lamb-w) + var(--gap));
  font-size: 14px; line-height: 1.4;
  text-shadow: var(--shadow);
  animation: arrive 1s .4s cubic-bezier(.2,.7,.2,1) both;
}
.msg span { display: inline-flex; align-items: center; gap: 9px; }
.msg--error span::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #ff6b5e; box-shadow: 0 0 8px rgba(0,0,0,.4); flex: 0 0 auto;
}

/* Desktop: Login unten links, gleich viel Luft zum linken und unteren Rand */
@media (min-width: 900px) {
  .stage {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 8vh clamp(96px, 11vw, 220px) max(clamp(96px, 11vw, 220px), 22vh);
  }
}
@media (max-width: 600px) {
  :root { --value-size: 16px; }
  :root { --fw: min(250px, calc(100vw - 2 * var(--side) - var(--lamb-w) - var(--gap))); }
  /* Handy: Eingabe im unteren Drittel, wo der Daumen hinkommt */
  .stage {
    justify-content: flex-end;
    padding: 32px var(--side) calc(env(safe-area-inset-bottom) + 16vh);
    transition: padding-bottom .32s cubic-bezier(.2,.7,.2,1);
  }
  /* Beim Tippen: über Tastatur bzw. iOS-Passwortfenster rücken.
     --kb setzt login.js aus dem sichtbaren Bereich (visualViewport);
     46vh deckt das Passwortfenster ab, das den Bereich nicht verkleinert. */
  .typing .stage {
    padding-bottom: max(calc(var(--kb, 0px) + 28px), 46vh);
  }
  .scene { background-position: 58% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .login, .msg, .busy .go span { animation: none; }
  .stage { transition: none !important; }
}
