/* ============================================================
   BaseCamp Partnerportal — Auth-Strecke (W5)
   ------------------------------------------------------------
   Layout-Schicht NUR fuer die Login-/Auth-/Onboarding-Screens
   (Spec §9 / Screens 0, 13, 15, 16). Baut additiv auf dem
   W4-Fundament auf: alle Farben/Masze via var() aus
   ../css/ds/* (kanonische DS-Tokens) bzw. tokens.css. KEINE
   Hardcode-Brandfarben, KEIN CDN, KEINE Secrets.

   Register-Profil (Spec §4 Screen 0):
   - Backdrop:  DUNKEL Navy-Vollflaeche (--fr-navy) mit ruhiger,
     gedaempfter Aurora-Tonung (Brand-Tokens, niedrige Alpha).
   - Karte:     HELLES Register (weiss, Hairline, weicher Schatten)
     — exakt das „Portal/Hell"-DS wie in components.css.
   - Wortmarke: FinanzRanger als Serif (Newsreader) + Goldraute.
   - Gold:      genau EIN CTA-Moment je Screen (--fr-btn--gold).

   Die echten Auth-Seiten und die Offline-Demo (login-demo.html)
   nutzen dieselbe Datei — ein Stil, eine Wahrheit.
   ============================================================ */

/* ---------- 1) Backdrop (Navy-Vollflaeche, ruhige Aurora) ---- */
.fr-auth {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5) var(--sp-4);
  box-sizing: border-box;
  color: var(--text-on-dark);
  background:
    radial-gradient(60% 50% at 78% 6%, rgba(201, 161, 78, .10) 0%, transparent 58%),
    radial-gradient(72% 64% at 96% 10%, rgba(22, 160, 110, .26) 0%, transparent 60%),
    radial-gradient(70% 76% at 4% 98%, rgba(28, 76, 143, .40) 0%, transparent 62%),
    var(--fr-navy);
}

.fr-auth__inner {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-4);
}
.fr-auth__inner--wide { max-width: 520px; }

/* ---------- 2) Marke (Goldraute + Serif-Wortmarke) ----------- */
.fr-auth__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  text-align: center;
  margin-bottom: var(--sp-2);
}
.fr-auth__mark {
  width: 40px;
  height: 40px;
  border: 1.75px solid var(--fr-gold);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
}
.fr-auth__mark::after {
  content: "";
  width: 13px;
  height: 13px;
  background: var(--fr-gold);
  transform: rotate(45deg);
  border-radius: 2px;
}
.fr-auth__word {
  font-family: var(--fr-serif);
  font-weight: var(--fw-medium);
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--text-on-dark);
  line-height: 1;
}
.fr-auth__tag {
  font-family: var(--fr-sans);
  font-weight: var(--fw-bold);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fr-gold);
}

/* ---------- 3) Karte (Portal/Hell) --------------------------- */
.fr-auth__card {
  background: var(--fr-white);
  border: 1px solid var(--fr-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  padding: var(--sp-5);
  color: var(--text-body);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.fr-auth__head { text-align: center; }
.fr-auth__title {
  font-family: var(--fr-serif);
  font-weight: var(--fw-medium);
  font-size: var(--fs-h2);
  letter-spacing: var(--ls-h2);
  color: var(--fr-blue);
  line-height: 1.1;
  margin: 0 0 var(--sp-2);
}
.fr-auth__lead {
  color: var(--fr-muted);
  font-size: var(--fs-small);
  margin: 0;
}

/* ---------- 4) Formfelder (nach DS Input.jsx) ---------------- */
.fr-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.fr-field { display: flex; flex-direction: column; gap: 6px; }
.fr-label {
  font-family: var(--fr-sans);
  font-weight: var(--fw-semibold);
  font-size: 13px;
  color: var(--fr-blue);
}
.fr-input {
  font-family: var(--fr-sans);
  font-size: 15px;
  color: var(--fr-blue);
  background: var(--fr-white);
  border: 1px solid var(--fr-line);
  border-radius: var(--radius-btn);
  padding: 11px 14px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.fr-input::placeholder { color: var(--fr-muted); }
.fr-input:focus {
  border-color: var(--fr-pine);
  box-shadow: 0 0 0 3px rgba(20, 105, 74, .12);
}
.fr-input[aria-invalid="true"] {
  border-color: var(--fr-danger-line);
  box-shadow: 0 0 0 3px var(--fr-danger-bg);
}
.fr-field__hint { font-size: 12px; color: var(--fr-muted); }

/* 6-stelliger TOTP-Code: zentriert, weite Laufweite, tabular */
.fr-input--code {
  text-align: center;
  font-size: 26px;
  letter-spacing: .42em;
  padding-left: .42em; /* optische Mitte trotz Laufweite */
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-semibold);
}

/* ---------- 5) Aktionen / Links ------------------------------ */
.fr-auth__actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.fr-auth__links {
  display: flex;
  justify-content: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  font-size: var(--fs-small);
}
.fr-link { color: var(--fr-pine); font-weight: var(--fw-semibold); cursor: pointer; background: none; border: none; padding: 0; font: inherit; }
.fr-link:hover { text-decoration: underline; }
.fr-link--muted { color: var(--fr-muted); font-weight: var(--fw-medium); }

/* Button-Spinner (Inhalt im .fr-btn) */
.fr-spin {
  width: 15px; height: 15px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: currentColor;
  display: inline-block;
  animation: fr-spin 720ms linear infinite;
}
@keyframes fr-spin { to { transform: rotate(360deg); } }

/* ---------- 6) Alerts (Fehler / Info / Erfolg) --------------- */
.fr-alert {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  line-height: 1.45;
}
.fr-alert__icon { flex: 0 0 auto; margin-top: 1px; }
.fr-alert--error {
  background: var(--fr-danger-bg);
  border: 1px solid var(--fr-danger-line);
  color: var(--fr-danger);
}
.fr-alert--info {
  background: var(--pill-navy-bg);
  border: 1px solid rgba(14, 39, 71, .18);
  color: var(--fr-blue);
}
.fr-alert--success {
  background: var(--pill-green-bg);
  border: 1px solid rgba(47, 196, 137, .40);
  color: var(--fr-pine);
}
.fr-alert--warn {
  background: var(--pill-gold-bg);
  border: 1px solid rgba(201, 161, 78, .30);
  color: var(--pill-gold-fg);
}

/* ---------- 7) Captcha-Platzhalter (Turnstile) --------------- */
/* Sichtbarer Platzhalter. Das ECHTE Widget braucht das Cloudflare-
   Turnstile-CDN-Script + Site-Key und wird ERST bei Aktivierung
   eingebaut (siehe TODO im HTML + README). NICHT still aktivieren. */
.fr-turnstile {
  border: 1.5px dashed var(--fr-line);
  border-radius: var(--radius-sm);
  background: var(--fr-ice);
  color: var(--fr-muted);
  font-size: 12px;
  text-align: center;
  padding: var(--sp-4);
  line-height: 1.4;
}

/* ---------- 8) MFA-Enroll: QR + Secret + Recovery ------------ */
.fr-qr {
  width: 168px;
  height: 168px;
  margin: 0 auto;
  border: 1px solid var(--fr-line);
  border-radius: var(--radius-sm);
  background: var(--fr-white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fr-qr img, .fr-qr svg { width: 100%; height: 100%; display: block; }
/* Offline-/Demo-Platzhalter (kein echter QR-Code) */
.fr-qr--placeholder {
  background:
    repeating-conic-gradient(var(--fr-blue) 0% 25%, var(--fr-white) 0% 50%) 50% / 22px 22px;
  position: relative;
}
.fr-qr--placeholder::after {
  content: "QR";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  background: var(--fr-white);
  color: var(--fr-blue);
  font-family: var(--fr-sans);
  font-weight: var(--fw-bold);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--fr-line);
}
.fr-secret {
  display: block;
  text-align: center;
  font-family: var(--fr-sans);
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-semibold);
  letter-spacing: .12em;
  word-break: break-all;
  background: var(--fr-ice);
  color: var(--fr-blue);
  border: 1px solid var(--fr-line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
}

.fr-recovery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}
.fr-recovery__code {
  font-family: var(--fr-sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  font-weight: var(--fw-semibold);
  font-size: 14px;
  color: var(--fr-blue);
  background: var(--fr-ice);
  border: 1px solid var(--fr-line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
}

.fr-checkline {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-small);
  color: var(--fr-blue);
  cursor: pointer;
}
.fr-checkline input { margin-top: 3px; flex: 0 0 auto; accent-color: var(--fr-pine); width: 16px; height: 16px; }

/* ---------- 9) Mandant-/Zugang-Auswahl (Screen 15) ----------- */
.fr-mandant { display: flex; flex-direction: column; gap: var(--sp-3); }
.fr-mandant__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  text-align: left;
  padding: var(--sp-4);
  border-radius: var(--radius-card);
  background: var(--fr-white);
  border: 1px solid var(--fr-line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  font: inherit;
  color: var(--fr-blue);
}
.fr-mandant__item:hover {
  background: var(--fr-ice);
  transform: var(--hover-lift);
  box-shadow: var(--shadow-card);
  border-color: rgba(201, 161, 78, .45); /* Gold-Hairline leitet */
}
.fr-mandant__icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fr-white);
  background: var(--fr-grad-cta);
  font-weight: var(--fw-bold);
}
.fr-mandant__body { flex: 1 1 auto; min-width: 0; }
.fr-mandant__name { font-weight: var(--fw-semibold); color: var(--fr-blue); }
.fr-mandant__meta { font-size: var(--fs-eyebrow); color: var(--fr-muted); margin-top: 2px; }
.fr-mandant__chev { flex: 0 0 auto; color: var(--fr-muted); }

/* ---------- 10) Account-Status-Gate (Screen 16) -------------- */
.fr-gate__badge {
  width: 52px; height: 52px;
  margin: 0 auto var(--sp-3);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fr-gate__badge--locked { background: var(--fr-danger-bg); color: var(--fr-danger); border: 1px solid var(--fr-danger-line); }
.fr-gate__badge--wait   { background: var(--pill-gold-bg); color: var(--pill-gold-fg); border: 1px solid rgba(201, 161, 78, .30); }
.fr-gate__contact {
  text-align: center;
  font-size: var(--fs-small);
  color: var(--fr-muted);
}
.fr-gate__contact a { color: var(--fr-pine); font-weight: var(--fw-semibold); }

/* ---------- 11) Footer (Pflichtangaben §8) ------------------- */
.fr-auth__foot {
  text-align: center;
  font-size: 12px;
  color: var(--text-on-dark-muted);
  line-height: 1.5;
}
.fr-auth__foot a { color: var(--text-on-dark-muted); text-decoration: underline; }
.fr-auth__foot a:hover { color: var(--text-on-dark); }
.fr-auth__sep { opacity: .5; margin: 0 6px; }

/* ---------- 12) Utilities ------------------------------------ */
.is-hidden { display: none !important; }

/* ---------- 13) Responsiv ------------------------------------ */
@media (max-width: 480px) {
  .fr-auth { padding: var(--sp-4) var(--sp-3); }
  .fr-auth__card { padding: var(--sp-4); }
  .fr-recovery { grid-template-columns: 1fr; }
}
