/* ════════════════════════════════════════════
   Auth Pages (Login / Register)
   ════════════════════════════════════════════ */

/* ── Sidebar: nur Logo + Footer-Toggles sichtbar ── */
body.is-auth nav.sb {
  display: none;
}
/* Footer ohne nav.sb nach unten drücken */
body.is-auth .sb__footer {
  margin-top: auto;
}

/* ── Formular-Wrapper zentriert im Content-Bereich ── */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: var(--space-6) var(--space-4);
}

/* ── Card ────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.auth-card--register {
  max-width: 440px;
}

/* ── Logo ────────────────────────────────────── */
.auth-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.auth-logo-ring {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: var(--pill);
  background: radial-gradient(circle at 30% 30%, rgba(59,130,246,.2), rgba(10,15,30,.95) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 32px rgba(59,130,246,.25);
  overflow: visible;
  animation: auth-float 5s ease-in-out infinite alternate;
}
.auth-logo-glow {
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    rgba(59,130,246,0),
    rgba(59,130,246,.35),
    rgba(16,185,129,0),
    rgba(59,130,246,.4),
    rgba(16,185,129,.1),
    rgba(59,130,246,0)
  );
  opacity: .5;
  filter: blur(6px);
  animation: auth-spin 12s linear infinite;
}
.auth-logo-img {
  position: relative;
  width: 80px;
  height: auto;
  border-radius: var(--radius-lg);
  z-index: 1;
}
.auth-brand {
  font-size: 1.35rem;
  font-weight: 400;
  font-family: var(--font);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
  text-align: center;
}
.auth-brand strong {
  font-weight: 700;
  font-style: normal;
}
.auth-brand em {
  font-style: italic;
  font-weight: 500;
}

@keyframes auth-float {
  0%   { transform: translateY(2px); }
  50%  { transform: translateY(-5px); }
  100% { transform: translateY(2px); }
}
@keyframes auth-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Headings ────────────────────────────────── */
.auth-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  margin: 0;
}
.auth-subtitle {
  font-size: .85rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* ── Flash ───────────────────────────────────── */
.auth-flash {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: .84rem;
  font-weight: 500;
}
.auth-flash--error   { background: color-mix(in oklab,#ef4444 12%,transparent); color:#ef4444; border:1px solid color-mix(in oklab,#ef4444 25%,transparent); }
.auth-flash--success { background: color-mix(in oklab,#10b981 12%,transparent); color:#10b981; border:1px solid color-mix(in oklab,#10b981 25%,transparent); }
.auth-flash--info    { background: color-mix(in oklab,var(--primary) 12%,transparent); color:var(--primary); border:1px solid color-mix(in oklab,var(--primary) 25%,transparent); }

/* ── Form ────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.auth-field label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.auth-field input {
  padding: 11px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: .9rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.auth-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab,var(--primary) 15%,transparent);
}
.auth-field input::placeholder { color: var(--text-muted); opacity: .6; }

/* Password toggle */
.auth-pw-wrap { position: relative; }
.auth-pw-wrap input { padding-right: 44px; }
.auth-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--dur-fast);
}
.auth-pw-toggle:hover { color: var(--text-primary); }

/* Submit */
.auth-submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--brand-gradient-btn);
  color: #fff;
  border: none;
  border-radius: var(--pill);
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: var(--space-1);
  transition: filter var(--dur-fast), transform var(--dur-fast);
}
.auth-submit-btn:hover  { filter: brightness(1.1); }
.auth-submit-btn:active { transform: scale(.98); }

/* Consent & Trust hint */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: .82rem;
  color: var(--text-muted);
  cursor: pointer;
}
.auth-consent:not(.auth-consent--custom) input { flex-shrink: 0; width: auto; margin-top: 3px; cursor: pointer; }
.auth-consent__text { flex: 1; min-width: 0; line-height: 1.4; }
.auth-consent a { color: var(--primary); text-decoration: none; }
.auth-consent a:hover { text-decoration: underline; }

/* Custom-Häkchen wie im Onboarding (Quick-Log / KI-Zustimmung) */
.auth-consent--custom {
  gap: var(--space-3);
  align-items: flex-start;
}
.auth-consent__check {
  flex-shrink: 0;
  position: relative;
  width: 26px;
  height: 26px;
  margin-top: 2px;
}
.auth-consent__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
.auth-consent__faux {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  pointer-events: none;
}
.auth-consent__tick {
  width: 14px;
  height: 14px;
  color: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-consent__input:checked + .auth-consent__faux {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.auth-consent__input:checked + .auth-consent__faux .auth-consent__tick {
  opacity: 1;
  transform: scale(1);
}
.auth-consent__input:focus-visible + .auth-consent__faux {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
[data-theme="light"] .auth-consent__faux {
  background: #fff;
  border-color: #cbd5e1;
}
.auth-trust-hint {
  font-size: .78rem;
  color: var(--text-dim);
  margin: 0;
  text-align: center;
}

/* Switch */
.auth-forgot {
  margin-top: var(--space-2);
  font-size: .85rem;
  text-align: center;
}
.auth-forgot a { color: var(--text-muted); text-decoration: none; }
.auth-forgot a:hover { color: var(--primary); text-decoration: underline; }

.auth-switch {
  text-align: center;
  font-size: .83rem;
  color: var(--text-muted);
}
.auth-switch a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ── Light Mode ──────────────────────────────── */
[data-theme="light"] .auth-logo-ring {
  background: radial-gradient(circle at 30% 30%, rgba(37,99,235,.12), #f1f5f9 70%);
}
[data-theme="light"] .auth-field input {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

/* Konto-Typ (Registrierung) */
.auth-kind-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.auth-kind-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
@media (max-width: 420px) {
  .auth-kind-grid {
    grid-template-columns: 1fr;
  }
}
.auth-kind-opt {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.65rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.auth-kind-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.auth-kind-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}
.auth-kind-desc {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-dim);
}
.auth-kind-opt:has(.auth-kind-input:checked) {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 1px var(--primary-soft);
}
.auth-kind-opt:hover {
  border-color: rgba(255, 255, 255, 0.22);
}
[data-theme="light"] .auth-kind-opt {
  border-color: #e2e8f0;
  background: #fff;
}
[data-theme="light"] .auth-kind-opt:has(.auth-kind-input:checked) {
  background: rgba(37, 99, 235, 0.06);
}
