/* MAIA Auth Flows - Activation & Password Reset Styles */

/* ---------- Progress Bar ---------- */

.auth-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 0;
}

.auth-progress-step {
  display: flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #4a4a5e;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.auth-progress-step--active {
  color: #3b82f6;
}

.auth-progress-step--done {
  color: #10b981;
}

.auth-progress-dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid #1e1e2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  margin-right: 0.375rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
  background-color: #0a0a0f;
}

.auth-progress-step--active .auth-progress-dot {
  border-color: #3b82f6;
  background-color: #3b82f6;
  color: #ffffff;
}

.auth-progress-step--done .auth-progress-dot {
  border-color: #10b981;
  background-color: #10b981;
  color: #ffffff;
}

.auth-progress-line {
  width: 1.5rem;
  height: 2px;
  background-color: #1e1e2e;
  margin: 0 0.25rem;
  flex-shrink: 0;
  transition: background-color 0.3s ease;
}

.auth-progress-line--done {
  background-color: #10b981;
}

/* ---------- Auth Card — extends .login-card with wider max for multi-step flows ---------- */
/* Use .login-card.login-card--wide for activation/reset pages.
   This inherits ALL login-card styles (bg, border, padding, animation)
   and only overrides the width to fit progress bar + QR code. */

.login-card.login-card--wide {
  max-width: 28rem;
}

/* Legacy selector kept for backward compat */
.auth-card {
  width: 100%;
  max-width: 28rem;
  background-color: #111118;
  border: 1px solid #1e1e2e;
  border-radius: 0.75rem;
  padding: 2.5rem;
  animation: slideUp 300ms ease;
}

/* ---------- Step Containers ---------- */

.auth-step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.auth-step--active {
  display: block;
}

/* ---------- Step Header ---------- */

.auth-step-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-step-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3b82f6;
}

.auth-step-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.auth-step-icon--success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.auth-step-icon--error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.auth-step-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 0.25rem;
}

.auth-step-subtitle {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* ---------- Loading Spinner ---------- */

.auth-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid #1e1e2e;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

/* ---------- Email Display ---------- */

.auth-email-display {
  text-align: center;
  padding: 0.5rem 1rem;
  background-color: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #3b82f6;
  margin-bottom: 1.25rem;
  font-weight: 500;
}

/* ---------- Password Strength ---------- */

.password-requirements {
  margin-bottom: 1.25rem;
}

.password-requirements-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.password-req {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #4a4a5e;
  padding: 0.1875rem 0;
  transition: color 0.2s ease;
}

.password-req--met {
  color: #10b981;
}

.password-req-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-strength-bar {
  height: 4px;
  background-color: #1e1e2e;
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
  width: 0;
}

.password-strength-fill--weak {
  width: 25%;
  background-color: #ef4444;
}

.password-strength-fill--fair {
  width: 50%;
  background-color: #f59e0b;
}

.password-strength-fill--good {
  width: 75%;
  background-color: #06b6d4;
}

.password-strength-fill--strong {
  width: 100%;
  background-color: #10b981;
}

/* ---------- QR Code Display ---------- */

.auth-qr-container {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-qr-box {
  display: inline-block;
  background: #ffffff;
  padding: 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.auth-qr-box canvas,
.auth-qr-box img,
.auth-qr-box svg {
  display: block;
  width: 180px;
  height: 180px;
}

.auth-qr-fallback {
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #64748b;
  text-align: center;
  padding: 1rem;
}

.auth-manual-secret {
  margin-top: 0.75rem;
}

.auth-manual-secret-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.375rem;
}

.auth-manual-secret-value {
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 0.875rem;
  color: #e2e8f0;
  background-color: #0a0a0f;
  border: 1px solid #1e1e2e;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  word-break: break-all;
  letter-spacing: 0.1em;
  display: inline-block;
  user-select: all;
}

/* ---------- Recovery Codes ---------- */

.recovery-codes {
  margin-bottom: 1.5rem;
}

.recovery-codes-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem;
  background-color: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: #f59e0b;
  line-height: 1.4;
}

.recovery-codes-warning svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.0625rem;
}

.recovery-codes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.recovery-code {
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 0.8125rem;
  color: #e2e8f0;
  background-color: #0a0a0f;
  border: 1px solid #1e1e2e;
  border-radius: 0.375rem;
  padding: 0.375rem 0.625rem;
  text-align: center;
  letter-spacing: 0.05em;
}

.recovery-codes-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #e2e8f0;
  background-color: #1e1e2e;
  border: 1px solid #2d2d3e;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: 1;
  justify-content: center;
}

.btn-copy:hover {
  background-color: #2d2d3e;
  border-color: #3b82f6;
}

.btn-copy--copied {
  color: #10b981;
  border-color: #10b981;
}

.btn-copy svg {
  width: 1rem;
  height: 1rem;
}

/* ---------- TOTP Input ---------- */

.auth-totp-input {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.75rem;
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  padding: 0.875rem 1rem;
  padding-left: 1.75rem;
}

.auth-totp-input::placeholder {
  letter-spacing: 0.75rem;
  font-weight: 400;
  color: #4a4a5e;
}

/* ---------- Success State ---------- */

.auth-success-check {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
}

.auth-success-check svg {
  width: 2rem;
  height: 2rem;
}

/* ---------- Redirect Notice ---------- */

.auth-redirect-notice {
  text-align: center;
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.75rem;
  line-height: 1.4;
}

.auth-redirect-notice span {
  font-weight: 600;
  color: #3b82f6;
  font-variant-numeric: tabular-nums;
}

/* ---------- Error State ---------- */

.auth-error-box {
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  margin-bottom: 1rem;
  text-align: center;
}

/* ---------- Info Box ---------- */

.auth-info-box {
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  background-color: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  margin-bottom: 1rem;
  text-align: center;
}

/* ---------- Success Box ---------- */

.auth-success-box {
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #10b981;
  margin-bottom: 1rem;
  text-align: center;
}

/* ---------- Auth Links ---------- */

.auth-links {
  text-align: center;
  margin-top: 1.25rem;
}

.auth-links a {
  font-size: 0.8125rem;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-links a:hover {
  color: #3b82f6;
}

/* ---------- Buttons (auth-specific) ---------- */

.auth-card .btn-primary,
.login-card--wide .btn-primary {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.auth-card .btn-secondary,
.login-card--wide .btn-secondary {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  background: #1e1e2e;
  border: 1px solid #2d2d3e;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  text-decoration: none;
}

.auth-card .btn-secondary:hover,
.login-card--wide .btn-secondary:hover {
  background: #2d2d3e;
  color: #e2e8f0;
}

/* ---------- Error Actions ---------- */

.auth-error-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  width: 100%;
}

.auth-error-actions .btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
}

/* ---------- Hidden ---------- */

.auth-hidden {
  display: none !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .auth-card {
    max-width: 100%;
    margin: 1rem;
    padding: 1.5rem;
  }

  .auth-progress {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .auth-progress-step {
    font-size: 0.625rem;
  }

  .auth-progress-line {
    width: 1rem;
  }

  .auth-qr-box canvas,
  .auth-qr-box img,
  .auth-qr-box svg {
    width: 150px;
    height: 150px;
  }

  .recovery-codes-grid {
    grid-template-columns: 1fr;
  }
}
