/* ============================================================
   Auth-Seiten (Login, 2FA, Ersteinrichtung) — eigenständiges
   Theme-Overlay auf Basis der Variablen aus style.css.
   Bewusst in einer eigenen Datei, damit der Rest des Panels
   unangetastet bleibt.
   ============================================================ */

.auth-page {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 120% at 50% 0%, #12151b 0%, var(--bg) 60%);
  --blob-a: var(--accent);
  --blob-b: var(--success);
  --blob-c: #a56bff;
}

/* feines Punktraster im Hintergrund */
.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 50% 40%, black 0%, transparent 75%);
  z-index: 0;
}

/* schwebende Farbflecken */
.auth-blobs {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.auth-blob {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .32;
  mix-blend-mode: screen;
  will-change: transform;
}

.auth-blob.a { background: var(--blob-a); top: -18%; left: -12%; }
.auth-blob.b { background: var(--blob-b); bottom: -22%; right: -10%; }
.auth-blob.c { background: var(--blob-c); top: 38%; left: 58%; width: 34vmax; height: 34vmax; opacity: .22; }

@media (prefers-reduced-motion: no-preference) {
  .auth-blob.a { animation: driftA 22s ease-in-out infinite alternate; }
  .auth-blob.b { animation: driftB 26s ease-in-out infinite alternate; }
  .auth-blob.c { animation: driftC 19s ease-in-out infinite alternate; }
}

@keyframes driftA {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6vmax, 8vmax) scale(1.12); }
}
@keyframes driftB {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-7vmax, -5vmax) scale(1.08); }
}
@keyframes driftC {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-4vmax, 6vmax) scale(1.15); }
}

/* Karte */
.auth-page .auth-box {
  position: relative;
  z-index: 1;
  width: 400px;
  max-width: calc(100vw - 40px);
  padding: 36px 34px 32px;
  background: rgba(28, 33, 41, .62);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(255, 255, 255, .02) inset,
    0 1px 0 rgba(255, 255, 255, .06) inset;
}

/* Logo-Badge mit Sonar-Ringen */
.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.auth-logo {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .auth-logo .ring { animation: sonar 3s ease-out infinite; }
  .auth-logo .ring.r2 { animation-delay: 1s; }
  .auth-logo .ring.r3 { animation-delay: 2s; }
}

@keyframes sonar {
  0%   { transform: scale(.7); opacity: .55; }
  100% { transform: scale(1.9); opacity: 0; }
}

.auth-logo .badge {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: linear-gradient(145deg, var(--accent), #3560c9);
  box-shadow: 0 10px 26px -8px rgba(79, 140, 255, .65), 0 0 0 1px rgba(255, 255, 255, .12) inset;
}

.auth-titles { text-align: center; margin-bottom: 4px; }
.auth-eyebrow {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 14px;
}
.auth-page .auth-box h1 {
  font-size: 21px;
  font-weight: 600;
  margin: 4px 0 0;
  letter-spacing: -.01em;
}
.auth-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
  margin-bottom: 6px;
}

/* Mini-Equalizer-Trenner */
.auth-wave {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 18px;
  margin: 18px 0 4px;
}
.auth-wave span {
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--blob-b));
  opacity: .55;
  height: 30%;
}
@media (prefers-reduced-motion: no-preference) {
  .auth-wave span { animation: eq 1.1s ease-in-out infinite; }
  .auth-wave span:nth-child(1) { animation-delay: -1.0s; }
  .auth-wave span:nth-child(2) { animation-delay: -0.7s; }
  .auth-wave span:nth-child(3) { animation-delay: -0.4s; }
  .auth-wave span:nth-child(4) { animation-delay: -0.9s; }
  .auth-wave span:nth-child(5) { animation-delay: -0.2s; }
  .auth-wave span:nth-child(6) { animation-delay: -0.6s; }
  .auth-wave span:nth-child(7) { animation-delay: -0.1s; }
}
@keyframes eq {
  0%, 100% { height: 20%; opacity: .35; }
  50% { height: 100%; opacity: .9; }
}

/* Eingabefelder mit schwebendem Label */
.auth-page form { margin-top: 4px; }

.field {
  position: relative;
  margin-top: 20px;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  transition: color .18s ease;
  pointer-events: none;
}

.field:focus-within .field-icon { color: var(--accent); }

.auth-page .field input[type=text],
.auth-page .field input[type=password] {
  width: 100%;
  padding: 19px 14px 7px 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 18, 22, .55);
  color: var(--text);
  font-size: 14.5px;
  font-family: var(--font);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  margin-top: 0;
}

.field.has-toggle input { padding-right: 44px; }

.auth-page .field input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(15, 18, 22, .8);
  box-shadow: 0 0 0 4px rgba(79, 140, 255, .16);
}

.field label {
  position: absolute;
  left: 44px;
  top: 15px;
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transform-origin: left top;
  transition: transform .16s ease, color .16s ease, top .16s ease;
  margin: 0;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 6px;
  transform: scale(.78);
  color: var(--accent);
}

.field-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.field-toggle:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

/* Button */
.btn-auth {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 26px;
  padding: 13px 18px;
  border: none;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: white;
  cursor: pointer;
  font-family: var(--font);
  background: linear-gradient(135deg, var(--accent), #3560c9);
  box-shadow: 0 12px 24px -10px rgba(79, 140, 255, .55);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-auth:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 16px 30px -10px rgba(79, 140, 255, .65); }
.btn-auth:active { transform: translateY(0); filter: brightness(.97); }

.btn-auth::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg);
  transition: left .65s ease;
}
.btn-auth:hover::after { left: 130%; }

.btn-auth .btn-label { display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: opacity .15s ease; }
.btn-auth .btn-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s ease;
}
.btn-auth.is-loading .btn-label { opacity: 0; }
.btn-auth.is-loading .btn-spinner { opacity: 1; }
.btn-auth .btn-spinner span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-footnote {
  text-align: center;
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Nachrichten leicht angepasst fürs Glas-Design */
.auth-page .msg { backdrop-filter: blur(6px); }

/* Sanftes Einblenden der Karteninhalte */
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    animation: authReveal .55s cubic-bezier(.16, 1, .3, 1) forwards;
  }
}
@keyframes authReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .auth-page .auth-box {
    animation: cardIn .5s cubic-bezier(.16, 1, .3, 1);
  }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .auth-page .auth-box { padding: 28px 22px 26px; }
}
