/* ==========================================================================
   MINDPULSE — AUTHENTICATION STYLESHEET (auth.css)
   Dedicated styling for Login, Registro, 2FA TOTP, Magic Link & Recovery
   ========================================================================== */

/* Full-screen auth layout */
.auth-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  position: relative;
  overflow-x: hidden;
  background: var(--bg-gradient);
}

/* Background Animated Blobs */
.auth-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.7;
}

.auth-blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.45) 0%, rgba(129, 140, 248, 0) 70%);
  top: -150px;
  right: -100px;
  animation: float 18s infinite ease-in-out alternate;
}

.auth-blob-2 {
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.45) 0%, rgba(192, 132, 252, 0) 70%);
  bottom: -180px;
  left: -120px;
  animation: float 22s infinite ease-in-out alternate-reverse;
}

.auth-blob-3 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(103, 232, 249, 0.35) 0%, rgba(103, 232, 249, 0) 70%);
  top: 35%;
  left: 20%;
  animation: float 26s infinite ease-in-out alternate;
}

/* Centered Glass Container */
.auth-container {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 45px -10px rgba(79, 70, 229, 0.18),
              0 10px 20px -5px rgba(0, 0, 0, 0.04);
  padding: 2.5rem 2.25rem;
  position: relative;
  z-index: 10;
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Auth Header */
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  display: inline-block;
  margin-bottom: 1.25rem;
  transition: transform var(--transition-fast);
}

.auth-logo:hover {
  transform: scale(1.03);
}

.auth-logo img,
.auth-logo svg {
  height: 42px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.auth-tagline {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-top: 0.25rem;
}

.auth-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.35rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Form Layout */
.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-form .form-group {
  margin-bottom: 1.15rem;
}

.auth-form .form-input {
  background: rgba(255, 255, 255, 0.9);
  height: 46px;
  font-size: 0.9375rem;
}

.auth-form .form-input:focus {
  background: #FFFFFF;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.25rem 0 1.25rem 0;
  font-size: 0.85rem;
}

.auth-forgot {
  color: var(--primary);
  font-weight: 600;
  transition: color var(--transition-fast);
}

.auth-forgot:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* Dividers */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 0.85rem;
}

/* Auth Footer */
.auth-footer {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
  margin-left: 0.25rem;
}

.auth-footer a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   TOTP 6-Digit Code Input Group (2FA)
   -------------------------------------------------------------------------- */
.totp-input-group {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin: 1.5rem 0;
}

.totp-digit {
  width: 48px;
  height: 56px;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Inter', monospace;
  text-align: center;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.totp-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18);
  transform: translateY(-2px);
}

.totp-digit.filled {
  border-color: var(--secondary-light);
  background: var(--secondary-50);
}

/* QR Code Display Container for 2FA Setup */
.totp-setup-card {
  background: #FFFFFF;
  border: 1px dashed var(--secondary-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.totp-qr-wrapper {
  background: #FFFFFF;
  padding: 0.75rem;
  display: inline-block;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
}

.totp-qr-wrapper img,
.totp-qr-wrapper svg {
  display: block;
  width: 170px;
  height: 170px;
}

.totp-secret-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 0.5rem;
  word-break: break-all;
}

.totp-secret-box button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* --------------------------------------------------------------------------
   Password Strength Meter
   -------------------------------------------------------------------------- */
.password-strength-container {
  margin-top: 0.4rem;
}

.password-strength-track {
  height: 5px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.password-strength-bar {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: var(--radius-full);
}

.password-strength-bar.weak   { width: 25%; background: var(--danger); }
.password-strength-bar.medium { width: 50%; background: var(--warning); }
.password-strength-bar.strong { width: 75%; background: var(--primary); }
.password-strength-bar.secure { width: 100%; background: var(--success); }

.password-strength-label {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Social Proof & Compliance Badges
   -------------------------------------------------------------------------- */
.social-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.proof-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.65);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(226, 232, 240, 0.8);
  user-select: none;
}

.proof-badge svg,
.proof-badge span.icon {
  font-size: 0.8rem;
}

/* Mobile Responsiveness for Auth */
@media (max-width: 480px) {
  .auth-container {
    padding: 2rem 1.5rem;
  }
  .totp-input-group {
    gap: 0.35rem;
  }
  .totp-digit {
    width: 42px;
    height: 50px;
    font-size: 1.25rem;
  }
  .auth-title {
    font-size: 1.45rem;
  }
}
