/* ============================================================================
   Anmelden · Registrieren · Passwort · Team-Login (/BrTeam) · Zugriff-403

   Einheitliches, anthrazit-rotes Design nach den Vorgaben des Betreibers:
   Marke + Begrüßung links, Formularkarte rechts – als ausgewogene Gruppe
   mittig auf der Seite. Der Hintergrund ist eine ruhige, tiefschwarze
   Facettenfläche mit rot leuchtenden Diagonalkanten (assets/images/auth-bg.svg);
   das echte BR-Logo liegt als eigenes Bild darüber. Die Rechts-Links stehen
   als echter, abgegrenzter Bereich UNTEN IN der Karte, nicht frei schwebend
   und nicht im Hintergrundbild. Mobil einspaltig, Formular hat Vorrang.
   ========================================================================= */

:root {
  --auth-bg:       #0b0e13;   /* Eingabefeld-Grund */
  --auth-surface:  rgba(18, 20, 26, 0.86);
  --auth-surface-2:#12151b;
  --auth-line:     rgba(255, 255, 255, 0.08);
  --auth-line-2:   rgba(255, 255, 255, 0.14);
  --auth-copy:     #f5f7fa;
  --auth-copy-2:   #c3cad6;
  --auth-copy-3:   #838d9c;
  --auth-accent:   #e11d2f;   /* kräftiges Markenrot wie in der Vorgabe */
  --auth-accent-h: #f2263a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--auth-copy);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Dunkler Grundton: verhindert ein weisses Aufblitzen, bevor das
     Hintergrundbild geladen ist, und dient zugleich als Fallback. */
  background-color: #07080b;
}

/* ── Hintergrundbild der Authentifizierungsseiten ──────────────────────────
   Bewusst NICHT global auf <body>, sondern nur ueber die Klasse
   .auth-background, die login.php, register.php, reset_password.php,
   brteam.php und die 403-Seite (includes/permissions.php) am <body> setzen.
   So erscheint das Bild ausschliesslich auf Login, Registrierung, Passwort
   vergessen und der 403-Seite - nie auf Dashboard, Panel, Tickets o. ae.

   Reihenfolge der Ebenen (oberste zuerst): dezenter Abdunkel-Verlauf fuer
   Formularkontrast, dann das Titelbild des Betreibers hero-bg.jpg (das dunkle
   Motiv mit den roten Diagonalen); darunter die mitgelieferte Nachbildung
   hero-bg.svg als Fallback, falls die JPG (noch) fehlt; ganz unten der dunkle
   Grundton. Legt der Betreiber sein Originalbild als assets/images/hero-bg.jpg
   ab, erscheint es hier automatisch - ohne Code-Aenderung. background-size:
   cover haelt das Bild randlos und unverzerrt; center haelt es mittig;
   no-repeat verhindert Kacheln. */
.auth-background {
  background-image:
    linear-gradient(180deg, rgba(4, 5, 8, 0.34), rgba(4, 5, 8, 0.58)),
    url('/assets/images/hero-bg.jpg'),
    url('/assets/images/hero-bg.svg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.bg-wrap, .bg-grid, .bg-glow, .bg-orb, .bg-watermark { display: none !important; }

/* ── Seitengerüst ─────────────────────────────────────────────────────────── */
.auth-main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 24px;
}
.auth-grid {
  width: 100%;
  max-width: 1240px;
  display: grid;
  grid-template-columns: 1fr 580px;
  align-items: center;
  gap: 56px;
}

/* ── Linke Spalte: Marke + Begrüßung ──────────────────────────────────────── */
.auth-brand { min-width: 0; }
.auth-brand-logo {
  display: block;
  width: 210px; height: auto;
  margin-bottom: 24px;
  filter: drop-shadow(0 16px 44px rgba(0, 0, 0, 0.62)) drop-shadow(0 0 30px rgba(225, 20, 48, 0.18));
}
.auth-brand-word {
  margin-bottom: 26px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--auth-copy-2);
}
.auth-brand-title {
  margin: 0 0 8px;
  font-size: 2.4rem;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.08;
  color: #fff;
}
.auth-brand-sub {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--auth-copy-3);
}

/* ── Rechte Spalte: Formularkarte ─────────────────────────────────────────── */
.auth-card {
  min-width: 0;
  align-self: stretch;
  border: 1px solid var(--auth-line);
  border-radius: 22px;
  background: var(--auth-surface);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 48px 50px 40px;
  box-shadow:
    0 44px 100px rgba(0, 0, 0, 0.58),
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
/* Registrieren hat viele Felder: großzügige Felder wie in der Vorlage, aber
   knappere Abstände (und ohne Hinweistexte), damit die Karte nicht zu hoch
   wird. Gilt nur hier; der Login bleibt unverändert. */
.auth-card--dense { padding: 30px 40px 22px; }
.auth-card--dense .auth-card-head { margin-bottom: 16px; }
.auth-card--dense .auth-h1 { font-size: 1.6rem; }
.auth-card--dense .auth-sub { font-size: .9rem; }
.auth-card--dense .field { margin-bottom: 12px; }
.auth-card--dense .field-input { min-height: 48px; }
.auth-card--dense .field-hint { margin-top: 4px; font-size: .75rem; }
.auth-card--dense .divider { margin: 15px 0 11px; }
.auth-card--dense .switch-link { margin-top: 15px; }
.auth-card--dense .auth-legal { margin-top: 20px; padding-top: 15px; }

/* Zweispaltige Feldpaare (Registrierung): auf grossen Bildschirmen zwei
   Spalten, damit die Karte kompakt bleibt; auf schmalen Displays automatisch
   einspaltig. Kein transform/zoom - echte Grid-Umbrueche. */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.field-grid > .field { min-width: 0; }

.auth-eyebrow {
  margin-bottom: 8px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--auth-accent);
}
.auth-card-head { margin-bottom: 26px; }
.auth-h1 {
  margin: 0 0 6px;
  font-size: 1.9rem;
  font-weight: 750;
  letter-spacing: -.015em;
  color: #fff;
}
.auth-sub {
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--auth-copy-3);
}

/* Zentrierte Variante (Passwort vergessen) mit Kreis-Icon */
.auth-card--center { text-align: center; }
.auth-icon-badge {
  width: 62px; height: 62px;
  margin: 0 auto 18px;
  border: 1px solid var(--auth-line-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--auth-copy-2);
  background: rgba(255, 255, 255, 0.02);
}
.auth-card--center .auth-card-head { margin-bottom: 20px; }
.auth-card--center form { text-align: left; }

/* ── Felder ─────────────────────────────────────────────────────────────── */
.field { margin-bottom: 19px; }
.field-label {
  display: block;
  margin-bottom: 9px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--auth-copy-2);
}
.field-wrap, .pw-wrap { position: relative; display: block; }
.field-input {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border: 1px solid var(--auth-line-2);
  border-radius: 10px;
  background: var(--auth-bg);
  color: var(--auth-copy);
  font: inherit;
  font-size: .92rem;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field-input::placeholder { color: #59616e; }
.field-input:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(225, 29, 47, 0.18);
}
.pw-wrap .field-input { padding-right: 46px; }
.field-ico { display: none; }
.field-hint { margin-top: 6px; font-size: .78rem; color: var(--auth-copy-3); }

.pw-btn {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 0; border-radius: 7px;
  background: transparent;
  color: var(--auth-copy-3);
  cursor: pointer;
}
.pw-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--auth-copy); }
.pw-btn:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 1px; }
.opt { font-weight: 400; color: var(--auth-copy-3); text-transform: none; letter-spacing: 0; }

/* ── „Angemeldet bleiben" + „Passwort vergessen?" ────────────────────────── */
.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 24px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: .86rem;
  color: var(--auth-copy-2);
  user-select: none;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
  flex: none;
  width: 19px; height: 19px;
  border: 1.5px solid var(--auth-line-2);
  border-radius: 6px;
  background: var(--auth-bg);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  transition: background .12s ease, border-color .12s ease;
}
.check-box svg { opacity: 0; transition: opacity .1s ease; }
.check input:checked + .check-box { background: var(--auth-accent); border-color: var(--auth-accent); }
.check input:checked + .check-box svg { opacity: 1; }
.check input:focus-visible + .check-box { outline: 2px solid var(--auth-accent); outline-offset: 2px; }
.field-link {
  color: var(--auth-copy-2);
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.field-link:hover { color: var(--auth-accent); text-decoration: underline; }
.field-row { display: flex; justify-content: flex-start; margin-top: 9px; }

/* ── Schaltflächen ──────────────────────────────────────────────────────── */
.btn-submit, .btn-discord, .btn-resend, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: .95rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.btn-submit, .btn-red {
  background: var(--auth-accent);
  border-color: var(--auth-accent);
  color: #fff;
  box-shadow: 0 10px 26px rgba(225, 29, 47, 0.28);
}
.btn-submit:hover, .btn-red:hover { background: var(--auth-accent-h); border-color: var(--auth-accent-h); }
.btn-submit:active { transform: translateY(1px); }
.btn-discord {
  margin-top: 0;
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--auth-line-2);
  color: var(--auth-copy);
}
.btn-discord:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--auth-line-2); }
.btn-discord svg { color: #dfe3f0; }
.btn-ghost {
  margin-top: 0;
  background: transparent;
  border-color: var(--auth-line-2);
  color: var(--auth-copy);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }
.btn-resend {
  min-height: 42px;
  background: transparent;
  border-color: var(--auth-line-2);
  color: var(--auth-copy-2);
  font-size: .88rem;
}
.btn-resend:hover { background: rgba(255, 255, 255, 0.05); color: var(--auth-copy); }
.btn-submit:focus-visible, .btn-discord:focus-visible, .btn-resend:focus-visible, .btn-ghost:focus-visible {
  outline: 2px solid var(--auth-accent); outline-offset: 2px;
}
.btn-submit[disabled], .btn-resend[disabled] { opacity: .5; cursor: not-allowed; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 13px;
  font-size: .78rem;
  color: var(--auth-copy-3);
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--auth-line); }

.switch-link {
  margin-top: 18px;
  font-size: .86rem;
  color: var(--auth-copy-3);
  text-align: center;
}
.switch-link a { color: var(--auth-copy-2); font-weight: 600; text-decoration: none; }
.switch-link a:hover { color: var(--auth-accent); text-decoration: underline; }

/* ── Hinweis „Nur für das Team" (/BrTeam) ─────────────────────────────────── */
.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  font-size: .84rem;
  line-height: 1.5;
  color: var(--auth-copy-3);
}
.auth-note svg { flex: none; margin-top: 2px; color: var(--auth-copy-3); }

/* ── Meldungen ──────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 15px;
  padding: 11px 13px;
  border: 1px solid var(--auth-line-2);
  border-left-width: 3px;
  border-radius: 9px;
  font-size: .84rem;
  line-height: 1.5;
  text-align: left;
}
.alert svg { flex: none; margin-top: 2px; }
.alert-err { border-left-color: var(--auth-accent); background: rgba(225, 29, 47, 0.09); color: #fca5a5; }
.alert-ok  { border-left-color: #34d399;           background: rgba(52, 211, 153, 0.08); color: #6ee7b7; }
.alert--session { display: block; border-left-color: #60a5fa; background: rgba(96, 165, 250, 0.08); color: var(--auth-copy-2); }
.alert--session .alert__acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.alert--session a { color: #93c5fd; font-weight: 600; text-decoration: none; white-space: nowrap; }
.alert--session a:hover { text-decoration: underline; }

/* ── Bestätigungs-Mail erneut anfordern ─────────────────────────────────── */
.verify-resend-box { margin-bottom: 15px; padding: 13px; border: 1px solid var(--auth-line-2); border-radius: 10px; }
.verify-resend-box p { margin: 0 0 8px; font-size: .84rem; color: var(--auth-copy-2); }
.verify-resend-row { display: flex; gap: 8px; }
.verify-resend-row input {
  flex: 1; min-width: 0; min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--auth-line-2);
  border-radius: 8px;
  background: var(--auth-bg);
  color: var(--auth-copy);
  font: inherit; font-size: .84rem;
}
.verify-resend-row button {
  flex: none; min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--auth-line-2);
  border-radius: 8px;
  background: transparent;
  color: var(--auth-copy-2);
  font: inherit; font-size: .84rem; font-weight: 650;
  cursor: pointer; white-space: nowrap;
}
.verify-resend-row button:hover { background: rgba(255, 255, 255, 0.05); color: var(--auth-copy); }
.verify-resend-msg, .resend-msg { margin-top: 6px; font-size: .78rem; min-height: 1em; }
.verify-resend-live { margin-top: 6px; font-size: .78rem; color: var(--auth-copy-3); }
.verify-resend-live.is-done { color: #6ee7b7; }

/* ── Registrierung: Erfolgsansicht ──────────────────────────────────────── */
.ok-box { text-align: left; }
.ok-icon { display: none; }
.ok-title { margin-bottom: 6px; font-size: 1.15rem; font-weight: 700; color: #fff; }
.ok-text { margin: 0 0 12px; font-size: .84rem; line-height: 1.6; color: var(--auth-copy-2); }
.ok-warn, .ok-hint {
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid var(--auth-line-2);
  border-left-width: 3px;
  border-radius: 9px;
  font-size: .84rem;
  line-height: 1.55;
  color: var(--auth-copy-2);
}
.ok-warn { border-left-color: var(--auth-accent); background: rgba(225, 29, 47, 0.08); }
.ok-hint { border-left-color: var(--auth-line-2); }
.verify-poll { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; font-size: .84rem; line-height: 1.55; color: var(--auth-copy-3); }
.verify-poll-dot { flex: none; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--auth-copy-3); }
.verify-poll.is-done { color: #6ee7b7; }
.verify-poll.is-done .verify-poll-dot { background: #34d399; }

/* ── Echter Fuß IN der Karte: Rechts-Links ────────────────────────────────── */
.auth-legal {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--auth-line);
  text-align: center;
}
.auth-legal-home {
  display: inline-block;
  margin-bottom: 9px;
  font-size: .86rem;
  font-weight: 650;
  color: var(--auth-copy);
  text-decoration: none;
}
.auth-legal-home:hover { color: var(--auth-accent); }
.auth-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: .8rem;
  color: var(--auth-copy-3);
}
.auth-legal-links a { color: var(--auth-copy-3); text-decoration: none; }
.auth-legal-links a:hover { color: var(--auth-accent); }
.auth-legal-links .sep { color: var(--auth-line-2); }

/* ── Einzelkarte mittig (403 Zugriff nicht erlaubt) ───────────────────────── */
.auth-solo {
  width: 100%;
  max-width: 480px;
  align-self: center;
  text-align: center;
}
.auth-solo .auth-brand-mini { margin-bottom: 22px; }
.auth-solo .auth-brand-mini img { width: 46px; height: auto; display: block; margin: 0 auto 8px; }
.auth-solo .auth-brand-mini .auth-brand-word { margin: 0; font-size: .78rem; letter-spacing: .3em; }
.status-icon {
  width: 60px; height: 60px;
  margin: 4px auto 14px;
  border: 1px solid var(--auth-line-2);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--auth-accent);
  background: rgba(225, 29, 47, 0.06);
}
.status-actions { display: flex; gap: 12px; margin-top: 20px; }
.status-actions .btn-submit, .status-actions .btn-ghost { margin-top: 0; }
.status-hint { margin-top: 16px; font-size: .82rem; line-height: 1.55; color: var(--auth-copy-3); }

/* ── Schmale Bildschirme: einspaltig, Formular hat Vorrang ────────────────── */
@media (max-width: 900px) {
  .auth-grid { grid-template-columns: 1fr; max-width: 460px; gap: 28px; }
  .auth-brand { text-align: center; }
  .auth-brand-logo { width: 104px; margin: 0 auto 14px; }
  .auth-brand-word { margin-bottom: 10px; letter-spacing: .28em; }
  .auth-brand-title { font-size: 1.7rem; }
  .auth-brand-sub { font-size: .98rem; }
}
@media (max-width: 700px) {
  /* Auf Mobilgeraeten kein background-attachment: fixed (ruckelt/springt in
     mobilen Browsern); stattdessen mitscrollen. Etwas staerkerer Abdunkel-
     Verlauf, damit die Formularkarte auf kleinen Displays klar hervortritt. */
  .auth-background {
    background-image:
      linear-gradient(180deg, rgba(4, 5, 8, 0.58), rgba(4, 5, 8, 0.82)),
      url('/assets/images/hero-bg.jpg'),
      url('/assets/images/hero-bg.svg');
    background-attachment: scroll;
  }
}
/* Feldpaare der Registrierung werden auf schmalen Displays einspaltig, damit
   Eingabefelder bedienbar bleiben und nichts aus dem Bildschirm ragt. */
@media (max-width: 560px) {
  .field-grid { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 480px) {
  .auth-main { padding: 26px 15px; }
  .auth-card { padding: 24px 20px 20px; border-radius: 16px; }
  .auth-brand-title, .auth-brand-sub { display: none; }
  .auth-brand-logo { width: 78px; margin-bottom: 10px; }
  .auth-brand-word { font-size: .92rem; margin-bottom: 2px; }
  .auth-h1 { font-size: 1.5rem; }
  .status-actions { flex-direction: column; }
}
