/* ==========================================================================
   Fahrklar - Anmeldeseiten (Login, Registrieren, Passwort vergessen)

   Bewusst eigenstaendig: diese Datei ersetzt 1:1 die bestehende
   public/css/auth.css der Anwendung. Sie bringt ihre eigenen Token und
   Schriften mit und braucht site.css NICHT. Die Klassennamen sind exakt
   die der bestehenden Blade-Vorlagen, damit die Uebernahme ein reiner
   Stylesheet-Tausch bleibt.
   ========================================================================== */

@font-face {
  font-family: "Bespoke Slab";
  src: url("../fonts/BespokeSlab-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:        #14120f;
  --surface:   #1e1b16;
  --ink:       #f4efe6;
  --ink-2:     #cfc7ba;
  --muted:     #a49a8c;
  --signal:    #8ecfae;
  --danger:    #e0a08c;
  --line:      rgba(244, 239, 230, 0.11);
  --line-soft: rgba(244, 239, 230, 0.06);
  --display: "Bespoke Slab", "Iowan Old Style", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Atmosphaere: ein ruhiges Motiv, stark heruntergetont, plus feines Korn.
   Nichts blinkt, nichts bewegt sich - hier will jemand sich anmelden. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--auth-bild, none);
  background-size: cover;
  background-position: center;
  filter: saturate(0.4) brightness(0.85) contrast(1.02);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(130% 100% at 50% 42%, rgba(20,18,15,0.42) 0%, rgba(20,18,15,0.78) 55%, rgba(20,18,15,0.95) 100%),
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}

[x-cloak] { display: none !important; }

/* --- Rahmen --------------------------------------------------------------- */
.auth-wrap {
  width: 100%;
  max-width: 27rem;
  position: relative;
  z-index: 1;
}

/* --- Marke ---------------------------------------------------------------- */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 2.2rem;
  color: var(--ink);
}
.auth-brand a {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.auth-brand svg { width: 2rem; height: 2rem; flex: none; }
.auth-brand span {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: 0.012em;
}

/* --- Karte ---------------------------------------------------------------- */
.auth-card {
  position: relative;
  background: var(--surface);
  border-radius: 4px;
  padding: clamp(1.6rem, 5vw, 2.2rem);
  box-shadow: inset 0 1px 0 rgba(244, 239, 230, 0.07),
              0 1px 0 rgba(0, 0, 0, 0.45);
}
/* Eine schmale Signallinie an der Oberkante: das einzige farbige Element. */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(1.6rem, 5vw, 2.2rem);
  width: 2.6rem;
  height: 2px;
  border-radius: 2px;
  background: var(--signal);
}

.auth-card h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1.15;
  letter-spacing: -0.012em;
  margin-bottom: 1.6rem;
}

/* --- Felder --------------------------------------------------------------- */
.form-group { margin-bottom: 1.15rem; }

.form-group label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: rgba(20, 18, 15, 0.55);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  font: 400 1rem/1.4 var(--body);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.form-group input::placeholder { color: var(--muted); }
.form-group input:hover { border-color: rgba(244, 239, 230, 0.2); }
.form-group input:focus {
  outline: none;
  border-color: var(--signal);
  background: rgba(20, 18, 15, 0.75);
}
.form-group input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #1a1712 inset;
}

/* iOS zoomt beim Fokussieren in Felder mit weniger als 16px Schrift hinein */
@media (max-width: 640px) {
  .form-group input[type="text"],
  .form-group input[type="email"],
  .form-group input[type="password"] { font-size: 16px; }
}

.code-input {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  font-size: 1.4rem;
  letter-spacing: 0.42em;
  text-align: center;
}

/* Zustimmung zur Datenschutzerklaerung */
.form-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  margin-bottom: 1.4rem;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.form-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  background: rgba(20, 18, 15, 0.55);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.form-check input[type="checkbox"]:hover { border-color: rgba(244, 239, 230, 0.24); }
.form-check input[type="checkbox"]::before {
  content: "";
  width: 0.62rem;
  height: 0.36rem;
  border-left: 2px solid var(--bg);
  border-bottom: 2px solid var(--bg);
  transform: rotate(-45deg) translate(0.03rem, -0.06rem);
  opacity: 0;
}
.form-check input[type="checkbox"]:checked {
  background: var(--signal);
  border-color: var(--signal);
}
.form-check input[type="checkbox"]:checked::before { opacity: 1; }
.form-check a { color: var(--signal); }

/* --- Schaltflaechen ------------------------------------------------------- */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.92rem 1.5rem;
  background: var(--ink);
  color: #16130f;
  border: 0;
  border-radius: 2px;
  font: 500 1rem/1 var(--body);
  cursor: pointer;
  transition: background-color 0.25s var(--ease);
}
.btn-primary:hover:not(:disabled) { background: var(--signal); }
.btn-primary:disabled { opacity: 0.55; cursor: default; }

.btn-ghost {
  display: block;
  width: 100%;
  margin-top: 0.8rem;
  padding: 0.6rem 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: 400 0.94rem/1 var(--body);
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.btn-ghost:hover { color: var(--ink); }

/* --- Hinweise und Wechsel ------------------------------------------------- */
.auth-switch {
  margin-top: 1.3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  font-size: 0.94rem;
  color: var(--muted);
}
.auth-switch a { color: var(--signal); }
.auth-switch a:hover { color: var(--ink); }
.auth-switch + .auth-switch { margin-top: 0.9rem; padding-top: 0.9rem; }

.hint-text {
  margin-bottom: 1.2rem;
  font-size: 0.94rem;
  color: var(--ink-2);
}

.alert-error,
.alert-success {
  margin-bottom: 1.3rem;
  padding: 0.8rem 0.95rem;
  border-radius: 3px;
  border-left: 2px solid var(--danger);
  background: rgba(224, 160, 140, 0.09);
  color: var(--ink);
  font-size: 0.94rem;
}
.alert-success {
  border-left-color: var(--signal);
  background: rgba(142, 207, 174, 0.09);
}

/* --- Fusszeile ------------------------------------------------------------ */
.auth-footer {
  margin-top: 1.8rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}
.auth-footer a { color: var(--muted); transition: color 0.2s var(--ease); }
.auth-footer a:hover { color: var(--signal); }

/* --- Die Zusicherung unter der Karte -------------------------------------- */
.auth-assure {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1.25rem;
  width: min(34rem, calc(100vw - 2.5rem));
  margin-top: 1.5rem;
  margin-inline: auto;
  font-size: 0.84rem;
  color: var(--muted);
}
.auth-assure span {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}
.auth-assure svg { width: 0.95rem; height: 0.95rem; color: var(--signal); flex: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
