/* =========================
   Estilos para Páginas de Autenticación
   Diseño Profesional y Alineado
   ========================= */

.auth-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-md);
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.6s ease-out;
  margin: 0 auto;
  backdrop-filter: blur(10px);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-header h1 {
  font-size: 2rem;
  font-weight: var(--font-weight-extrabold);
  margin-bottom: var(--space-sm);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group:last-of-type {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
}

.form-input {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: var(--text-base);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-sans);
  line-height: 1.6;
  letter-spacing: -0.01em;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1), var(--shadow-md);
  transform: translateY(-1px);
  background: var(--card);
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-input:invalid:not(:placeholder-shown),
.form-input.input-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.field-error {
  display: block;
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: var(--space-xs);
  min-height: 1.25rem;
}

.form-toggle {
  text-align: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.form-toggle a {
  color: var(--primary);
  font-weight: var(--font-weight-bold);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.form-toggle a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.error-message {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
  border: 2px solid var(--danger);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
  color: var(--danger);
  font-size: 0.9375rem;
  line-height: 1.6;
  display: none;
  animation: slideDown 0.3s ease-out;
}

.error-message strong {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 600;
  color: var(--danger);
}

.error-message ul {
  margin: var(--space-xs) 0 0 0;
  padding-left: var(--space-lg);
  list-style-type: disc;
}

.error-message li {
  margin-bottom: var(--space-xs);
  color: var(--danger);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
  }
}

/* Estilo anterior (si existe):
.error-message {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
  border: 2px solid var(--danger);
  border-left: 4px solid var(--danger);
  color: #dc2626;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  margin-bottom: var(--space-lg);
  display: none;
  font-size: 0.9375rem;
  line-height: 1.6;
  animation: slideDown 0.3s ease-out;
  text-align: left;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.error-message strong {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 600;
  color: #dc2626;
}

.error-message ul {
  margin: var(--space-xs) 0 0 0;
  padding-left: var(--space-lg);
  list-style-type: disc;
}

.error-message li {
  margin-bottom: var(--space-xs);
  color: #dc2626;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* Mejoras de accesibilidad */
.form-input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 640px) {
  .auth-card {
    padding: var(--space-xl);
    margin: var(--space-md);
  }

  .auth-header h1 {
    font-size: 1.75rem;
  }

  .form-input {
    padding: 12px 16px;
    font-size: 16px; /* Previene zoom en iOS */
  }
}

/* Animación de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   Indicador de Fortaleza de Contraseña
   ========================= */
.password-strength-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

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

.password-strength-fill.weak {
  width: 33%;
  background: var(--danger);
}

.password-strength-fill.medium {
  width: 66%;
  background: #f59e0b;
}

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

.password-strength-text {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.password-strength-text.weak {
  color: var(--danger);
}

.password-strength-text.medium {
  color: #f59e0b;
}

.password-strength-text.strong {
  color: #10b981;
}

.password-requirements {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  font-size: 0.8125rem;
}

.password-requirements li {
  margin-bottom: 4px;
  padding-left: 20px;
  position: relative;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.password-requirements li::before {
  content: '○';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.password-requirements li.valid {
  color: #10b981;
}

.password-requirements li.valid::before {
  content: '✓';
  color: #10b981;
  font-weight: bold;
}

.password-requirements li.invalid {
  color: var(--text-secondary);
}

.password-match-indicator {
  margin-top: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius);
  display: none;
}

.password-match-indicator.match {
  display: block;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.password-match-indicator.no-match {
  display: block;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Botón deshabilitado */
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* =========================
   Mensaje de Éxito
   ========================= */
.success-message {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 2px solid #10b981;
  border-left: 4px solid #10b981;
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
  color: #059669;
  font-size: 0.9375rem;
  line-height: 1.6;
  display: none;
  animation: slideDown 0.3s ease-out;
}

/* =========================
   Indicador de Disponibilidad de Email
   ========================= */
.email-availability {
  margin-top: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius);
  display: none;
}

.email-availability.available {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.email-availability.unavailable {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}