/* ============================================
   AUTH -- Login / Register Seite
   ============================================ */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 18px var(--spacing-xl);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.session-pending .auth-page {
  visibility: hidden;
}

/* ============================================
   Auth Container
   ============================================ */
.auth-container {
  width: 100%;
  max-width: 468px;
  position: relative;
}

/* Logo / Branding */
.auth-header {
  text-align: center;
  margin-bottom: 18px;
}

.auth-hero-icon {
  display: block;
  width: 128px;
  height: 128px;
  object-fit: contain;
  margin: 0 auto 12px;
  image-rendering: auto;
}

.auth-logo {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0;
}

.auth-language-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--surface-border);
  background: #080808;
}

.language-option {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 5px 9px;
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
}

.language-option.active {
  background: #f2f2f2;
  color: #050505;
}

.auth-music-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border: 1px solid var(--surface-border);
  background: #080808;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.auth-music-toggle:hover,
.auth-music-toggle.is-enabled {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: #0c0c0c;
}

/* ============================================
   Auth Card
   ============================================ */
.auth-card {
  padding: 0 22px 22px;
  position: relative;
  min-height: 0;
}

/* Leuchtender Rand oben */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-secondary), transparent);
}

/* ============================================
   Tab-Navigation (Login / Register)
   ============================================ */
.auth-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 14px;
  background: rgba(10, 10, 30, 0.4);
  border-radius: var(--radius-md);
  padding: 3px;
}

.auth-tab {
  flex: 1;
  padding: 12px 10px;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.auth-tab:hover {
  color: var(--text-secondary);
}

.auth-tab--active {
  color: var(--text-primary);
  background: rgba(var(--accent-primary-rgb), 0.1);
  box-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.1);
}

/* ============================================
   Formulare
   ============================================ */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 10px;
  animation: formFadeIn 0.3s ease;
  min-height: 0;
}

.auth-form--active {
  display: flex;
}

.auth-card--login,
.auth-card:has(#login-form.auth-form--active) {
  padding-bottom: 14px;
}

.auth-card--register,
.auth-card:has(#register-form.auth-form--active) {
  padding-bottom: 16px;
}

.auth-form .input-group {
  gap: 5px;
}

.auth-form label {
  font-size: 0.72rem;
}

.auth-form .input-field {
  min-height: 39px;
  padding: 9px 11px;
  font-size: 0.82rem;
}

.auth-form .input-field::placeholder {
  font-size: 0.78rem;
}

@keyframes formFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Formular Footer
   ============================================ */
.auth-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
}

.auth-form-footer .checkbox-group {
  flex: 1 1 auto;
}

.auth-form-footer .checkbox-group input[type="checkbox"] {
  background: linear-gradient(135deg, rgba(48, 4, 10, 0.92), rgba(10, 4, 6, 0.98));
  border-color: rgba(132, 24, 38, 0.55);
  box-shadow: inset 0 0 10px rgba(110, 10, 24, 0.2);
}

.auth-form-footer .checkbox-group input[type="checkbox"]:checked {
  background: #f2f2f2;
  border-color: #f2f2f2;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.12);
}

.auth-form-footer .checkbox-group input[type="checkbox"]:checked::after {
  border-color: #050505;
}

.auth-form-footer--register {
  justify-content: flex-end;
}

.auth-inline-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--text-muted);
  white-space: nowrap;
}

.auth-tool-separator {
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.75rem;
}

.auth-guest-panel {
  justify-content: center;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.auth-forgot {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-base);
}

.auth-forgot:hover {
  color: var(--accent-primary);
}

/* ============================================
   Divider
   ============================================ */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--surface-border);
}

/* ============================================
   Passwort-Staerke-Anzeige
   ============================================ */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}

.password-strength-bar {
  flex: 1;
  height: 3px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  transition: background var(--transition-base);
}

.password-strength-bar--weak {
  background: var(--accent-error);
}

.password-strength-bar--fair {
  background: var(--accent-warning);
}

.password-strength-bar--good {
  background: var(--accent-primary);
}

.password-strength-bar--strong {
  background: var(--accent-success);
}

.password-strength-text {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
  transition: color var(--transition-base);
}

/* ============================================
   hCaptcha Container
   ============================================ */
.captcha-container {
  display: flex;
  justify-content: center;
  min-height: 64px;
  max-height: 70px;
  overflow: hidden;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 480px) {
  .auth-page {
    padding: var(--spacing-md);
    align-items: flex-start;
    padding-top: 4vh;
    overflow-y: auto;
  }

  .auth-card {
    padding: var(--spacing-xl) var(--spacing-lg);
  }

  .auth-form-footer {
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
  }
}

/* Minimal black authentication view */
.auth-page {
  background: transparent;
}

.auth-container {
  max-width: 468px;
}

.auth-header {
  margin-bottom: 18px;
}

.auth-logo {
  font-size: clamp(2.2rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.08em;
}

.auth-card {
  background: #080808;
  padding: 0 22px 22px;
}

.auth-tabs {
  margin: 0 -10px 14px;
  background: transparent;
  border-bottom: 1px solid var(--surface-border);
  border-radius: 0;
}

.auth-tab {
  background: transparent;
  border-radius: 0;
  color: var(--text-muted);
}

.auth-tab--active {
  background: transparent;
  color: var(--text-primary);
  border-bottom: 1px solid var(--text-primary);
}
