:root {
  --sky-900: #061427;
  --sky-700: #102e57;
  --warn: #ffb020;
  --paper: #ffffff;
  --line: rgba(255,255,255,0.14);
  --danger: #ff3b30;
  --safe: #3ecf8e;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* html und body trennen, weil padding auf BEIDEN bei min-height:100vh
   (vh ist viewport-relativ, nicht parent-relativ) den body 48 px größer als
   den html-Content-Bereich macht → Scroll. Padding lebt nur am body. */
html { margin: 0; }
body {
  margin: 0; min-height: 100vh;
  box-sizing: border-box;
  background:
    linear-gradient(rgba(6,20,39,0.12), rgba(6,20,39,0.32)),
    url('/login-bg.jpg') center/cover no-repeat fixed,
    var(--sky-900);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
  align-items: flex-end; justify-content: center;
  padding: 24px clamp(8px, 2vw, 24px) 24px 24px;
}

/* ── Sprachen-Switch oben rechts ────────────────────── */
.lang-switch {
  position: fixed; top: 18px; right: 18px;
  display: flex;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px; overflow: hidden;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  z-index: 10;
}
.lang-switch button {
  appearance: none; cursor: pointer;
  background: transparent; border: 0; margin: 0;
  padding: 8px 14px; color: rgba(255,255,255,0.7);
  font-family: var(--sans); font-size: 13px;
  font-weight: 600; letter-spacing: 0.06em;
  transition: background 140ms ease, color 140ms ease;
}
.lang-switch button.active {
  background: var(--warn); color: var(--sky-900);
}
.lang-switch button:hover:not(.active) { color: #fff; }

.login-card {
  width: min(420px, 92vw);
  background: rgba(10,20,35,0.78);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 44px 42px 36px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  z-index: 1;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 28px;
  font-weight: 500;
}
.brand .mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--warn);
  color: var(--sky-900);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.05;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.lead {
  margin: 0 0 28px;
  color: rgba(255,255,255,0.6);
  font-size: 15px;
  line-height: 1.45;
}

form { display: flex; flex-direction: column; gap: 16px; }

label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}
label span { user-select: none; }

input {
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--paper);
  font-size: 16px;
  font-family: inherit;
  letter-spacing: normal; text-transform: none;
  outline: none;
  transition: border-color 140ms ease, background 140ms ease;
}
input:focus {
  border-color: var(--warn);
  background: rgba(255,255,255,0.10);
}

button {
  appearance: none; border: 0;
  margin-top: 12px;
  padding: 14px 18px;
  border-radius: 999px;
  background: var(--warn);
  color: var(--sky-900);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 80ms ease, filter 140ms ease;
}
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.6; cursor: progress; }

button.link {
  margin-top: 6px;
  padding: 6px 0;
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 0;
  transition: color 140ms ease;
}
button.link:hover { color: var(--warn); filter: none; }
button.link:active { transform: none; }

/* Passkey-Login-Button — gleiche Form wie Submit, aber als Sekundär-CTA. */
button.link-strong {
  margin-top: 10px;
  padding: 12px 16px;
  background: rgba(255,176,32,0.12);
  border: 1px solid rgba(255,176,32,0.4);
  color: var(--warn);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  border-radius: 8px;
}
button.link-strong:hover { background: rgba(255,176,32,0.20); }

.error {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,59,48,0.14);
  border: 1px solid rgba(255,59,48,0.4);
  color: #ffb1ac;
  font-size: 13px;
}

.info {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(62,207,142,0.14);
  border: 1px solid rgba(62,207,142,0.4);
  color: #b8f0d4;
  font-size: 13px;
  line-height: 1.45;
}

/* ── Footer mit Impressum/Datenschutz + powered by ─── */
.legal-footer {
  position: fixed; bottom: 14px; left: 14px; right: 14px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  z-index: 10;
  pointer-events: none;
}
.legal-footer > * { pointer-events: auto; }
.legal-footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 140ms ease;
}
.legal-footer a:hover { color: var(--warn); }
.legal-links { display: flex; gap: 8px; align-items: center; letter-spacing: 0.04em; }
.legal-links .sep { opacity: 0.4; }
.powered-by { letter-spacing: 0.04em; }
.powered-by a { font-weight: 600; margin-left: 4px; }

@media (max-width: 640px) {
  /* Mobil: Card mittig statt rechts, Footer aus fixed raus + zentriert
     stapeln (sonst überlappen Footer und Card auf engen Höhen). */
  body {
    align-items: center;
    justify-content: flex-start;
    padding: 20px 14px 14px;
  }
  .login-card {
    margin-top: auto;
    margin-bottom: 18px;
    padding: 32px 26px 28px;
  }
  .legal-footer {
    position: static;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: auto;
    width: 100%;
    gap: 4px;
    left: auto; right: auto; bottom: auto;
  }
  .legal-links { justify-content: center; }
  .lang-switch { top: 12px; right: 12px; }
}


/* ── Legal pages (Impressum, Datenschutz) ─────────── */
body.legal {
  display: block;
  align-self: stretch;
  width: 100%;
  padding: 80px 24px 80px;
}
.legal-card {
  width: min(820px, 96vw);
  margin: 0 auto;
  background: rgba(10,20,35,0.82);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 44px 48px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}
.legal-card h1 { margin: 8px 0 28px; }
.legal-card h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.01em;
  margin: 36px 0 12px;
  color: var(--warn);
}
.legal-card h3 {
  font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600;
  margin: 24px 0 8px;
  color: rgba(255,255,255,0.85);
}
.legal-card p, .legal-card li, .legal-card td, .legal-card th {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255,255,255,0.78);
}
.legal-card a { color: var(--warn); }
.legal-card a:hover { text-decoration: underline; }
.legal-card ul { padding-left: 22px; margin: 8px 0 12px; }
.legal-card ul li { margin: 4px 0; }
.legal-card .placeholder {
  background: rgba(255,176,32,0.10);
  border: 1px dashed rgba(255,176,32,0.45);
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--warn);
  font-style: italic;
}
.legal-card .meta {
  margin-top: 36px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.04em;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
}
.legal-card table {
  width: 100%; border-collapse: collapse;
  margin: 8px 0 16px;
}
.legal-card th, .legal-card td {
  text-align: left; padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: top;
}
.legal-card th {
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
}

.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.6); font-size: 13px;
  text-decoration: none; margin-bottom: 8px;
}
.back-link:hover { color: var(--warn); }
