/* ==========================================================================
   ARISA - Componente de Autenticación Unificado (Modal & Tarjeta de Login)
   Alineado con el sistema de diseño institucional de ARISA
   ========================================================================== */

:root {
  --auth-navy: #0f4c85;
  --auth-navy-dark: #0a335a;
  --auth-blue-vibrant: #1a73e8;
  --auth-blue-ice: #f0f6fc;
  --auth-gold: #b79347;
  --auth-gold-hover: #9c7b35;
  --auth-text-title: #0a192f;
  --auth-text-muted: #64748b;
  --auth-border: rgba(15, 76, 133, 0.14);
  --auth-radius: 14px;
  --auth-shadow: 0 20px 45px -10px rgba(15, 76, 133, 0.18), 0 0 1px 1px rgba(15, 76, 133, 0.08);
}

/* Backdrop / Fondo Oscurecido */
.auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 47, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

/* Tarjeta / Modal */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  border: 1px solid var(--auth-border);
  padding: 2.25rem 2rem;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
}

.auth-backdrop.is-active .auth-card {
  transform: translateY(0) scale(1);
}

/* Botón de cerrar */
.auth-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text-muted);
  transition: all 0.2s;
}

.auth-close-btn:hover {
  background: var(--auth-blue-ice);
  color: var(--auth-navy);
}

/* Cabecera */
.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  background: var(--auth-blue-ice);
  border: 1px solid var(--auth-border);
  border-radius: 999px;
  color: var(--auth-navy);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.auth-title {
  color: var(--auth-text-title);
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}

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

/* Pestañas (Tabs) */
.auth-tabs {
  display: flex;
  background: var(--auth-blue-ice);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--auth-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: #ffffff;
  color: var(--auth-navy);
  box-shadow: 0 2px 6px rgba(15, 76, 133, 0.08);
}

/* Formularios y Campos */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.auth-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--auth-text-title);
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 0.85rem;
  color: #94a3b8;
  pointer-events: none;
  display: flex;
}

.auth-input {
  width: 100%;
  padding: 0.72rem 0.9rem 0.72rem 2.45rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  font-size: 0.92rem;
  color: var(--auth-text-title);
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  border-color: var(--auth-navy);
  box-shadow: 0 0 0 3px rgba(15, 76, 133, 0.12);
}

/* Botones */
.auth-btn-primary {
  width: 100%;
  padding: 0.85rem;
  background: var(--auth-navy);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  margin-top: 0.35rem;
}

.auth-btn-primary:hover {
  background: var(--auth-navy-dark);
  box-shadow: 0 6px 14px rgba(15, 76, 133, 0.22);
}

.auth-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Botón Google */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0;
  color: #94a3b8;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

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

.auth-btn-google {
  width: 100%;
  padding: 0.75rem;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  transition: all 0.2s;
}

.auth-btn-google:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Alertas de error / éxito */
.auth-alert {
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  font-size: 0.86rem;
  line-height: 1.4;
  display: none;
  margin-bottom: 1rem;
}

.auth-alert.is-error {
  display: block;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-alert.is-success {
  display: block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Enlaces secundarios */
.auth-extra-links {
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.auth-link {
  color: var(--auth-navy);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

/* Spinner de carga */
.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

/* Ocultar botón de inicio de sesión en dispositivos móviles */
@media (max-width: 768px) {
  .header-auth-btn {
    display: none !important;
  }
}

