/**
 * Modern Auth Styles - Dezentes Design für Haushaltsbuch
 * Behält die alte HTML-Struktur bei, stylt nur visuell um
 */

/* Auth Body - Dezenter Hintergrund */
body.auth {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dashboard Content wird zur modernen Card */
body.auth .dashboard-content {
  width: 100%;
  max-width: 520px;
  margin: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  padding: 0;
}

/* Header Styling */
body.auth .dashboard-content h2 {
  text-align: center;
  padding: 3rem 2.5rem 2rem;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  background: white;
}

/* Emojis verstecken für neutrales Design */
body.auth .dashboard-content h2::before,
body.auth .dashboard-content h3::before {
  content: none !important;
}



body.auth h2 {
  font-size: 1.5rem;
  letter-spacing: 0;
}

/* Section Boxes (Passkey & Passwort Bereiche) */
body.auth .dashboard-content>div[style*="background: #f8f9fa"] {
  background: white !important;
  border: none !important;
  padding: 2rem 2.5rem !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

body.auth .dashboard-content>div[style*="background: #f8f9fa"] h3 {
  margin: 0 0 1.5rem 0 !important;
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  color: #2c3e50 !important;
}

/* Labels */
body.auth label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

/* Input Fields */
body.auth input[type="text"],
body.auth input[type="password"],
body.auth input[type="email"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 16px;
  color: #1f2937;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  margin-bottom: 1.25rem;
}

body.auth input[type="text"]:focus,
body.auth input[type="password"]:focus,
body.auth input[type="email"]:focus {
  outline: none;
  background: white;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

body.auth input::placeholder {
  color: #9ca3af;
}

/* Buttons */
body.auth button.user-btn,
body.auth button[type="submit"] {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: white;
  background: #6366f1;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
  margin-top: 0.5rem;
}

body.auth button.user-btn:hover,
body.auth button[type="submit"]:hover {
  background: #4f46e5;
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

body.auth button.user-btn:active,
body.auth button[type="submit"]:active {
  background: #4338ca;
}

body.auth button.user-btn:disabled,
body.auth button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #6366f1;
}

/* Divider (oder) */
body.auth .dashboard-content>div[style*="text-align: center"] {
  text-align: center;
  margin: 1rem 2.5rem !important;
  position: relative;
  color: #9ca3af !important;
  font-size: 0.875rem !important;
}

/* Message Boxes */
body.auth .success-box,
body.auth .error-box {
  margin: 0 2.5rem 1.5rem;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.auth .success-box {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

body.auth .error-box {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Error Box im Passkey Bereich */
body.auth #passkeyError {
  margin-top: 1rem !important;
  margin-bottom: 0;
}

/* Links am Ende */
body.auth .hint,
body.auth p.hint {
  text-align: center;
  margin: 0 !important;
  padding: 1.5rem 2.5rem 2.5rem !important;
  border-top: 1px solid #f0f0f0;
  font-size: 0.9rem;
  color: #6b7280;
}

body.auth .hint a,
body.auth p.hint a {
  color: #6366f1;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

body.auth .hint a:hover,
body.auth p.hint a:hover {
  color: #4f46e5;
  text-decoration: underline;
}

/* QR Code Container */
body.auth .qr-code-container {
  background: #f9fafb;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1rem 2.5rem;
}

body.auth .qr-code-container h3 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  color: #1f2937;
  text-align: center;
}

body.auth .qr-code-container img {
  border: 1px solid #e5e7eb;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  display: block;
  margin: 1rem auto;
}

body.auth .qr-code-manual {
  background: #e5e7eb;
  padding: 0.875rem;
  border-radius: 6px;
  margin-top: 1rem;
  word-break: break-all;
}

body.auth .qr-code-manual code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 0.875rem;
  color: #374151;
}

/* Warning Box */
body.auth .warning-box {
  margin: 0 2.5rem 1.5rem !important;
  background: #fef3c7 !important;
  border: 1px solid #fcd34d !important;
  padding: 1rem !important;
  border-radius: 8px !important;
  color: #92400e;
}

/* Success Actions */
body.auth .success-actions {
  margin: 1rem 2.5rem 2rem !important;
  text-align: center;
}

body.auth .success-actions a.user-btn {
  display: inline-block;
  padding: 0.875rem 1.5rem;
  text-decoration: none;
}

/* Forms */
body.auth form {
  margin: 0;
}

/* Responsive */
@media (max-width: 480px) {
  body.auth .dashboard-content {
    margin: 1rem;
    max-width: 100%;
  }

  body.auth .dashboard-content h2 {
    padding: 2rem 1.5rem 1rem;
    font-size: 1.5rem;
  }

  body.auth .dashboard-content>div[style*="background: #f8f9fa"] {
    padding: 1.5rem !important;
  }

  body.auth .success-box,
  body.auth .error-box,
  body.auth .hint,
  body.auth p.hint {
    margin-left: 1.5rem !important;
    margin-right: 1.5rem !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}

/* Loading State */
.auth-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.auth-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #6366f1;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Delete Button - Danger Style */
body.auth button.user-btn.danger {
  background: #ef4444;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

body.auth button.user-btn.danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* MFA Code Input Special Styling */


/* Auth Card Content Helpers */
.auth-card-center {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.auth-info-box {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.auth-warning {
  color: #dc3545;
  font-size: 0.9em;
  margin-bottom: 1.5rem;
}

.auth-steps-box {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  padding: 1.5rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.auth-steps-box h3 {
  margin: 0 0 1rem;
  color: #1976d2;
  font-size: 1.1em;
}

.auth-steps-box ol {
  margin: 0;
  padding-left: 1.5rem;
  color: #424242;
  line-height: 1.8;
}

.auth-tip-box {
  background: #fffbf0;
  border-left: 4px solid #ffc107;
  padding: 1rem;
  border-radius: 4px;
}

.auth-tip-box p {
  margin: 0;
  color: #856404;
  font-size: 0.9em;
}
/* „Diesem Gerät vertrauen" — Checkbox-Zeile im Login (Passwort- und Passkey-Block) */
body.auth label.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: -0.5rem 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
}
body.auth label.auth-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex-shrink: 0;
  accent-color: #6366f1;
  cursor: pointer;
}
body.auth label.auth-check small {
  display: block;
  font-weight: 400;
  color: #6b7280;
  margin-top: 2px;
}
