/* ==========================================================================
   ALEZUX / CREZCA CUSTOM AUTHENTICATION STYLES (IMAGE 2 DESIGN SPEC)
   High-contrast split-screen: Vibrant Blue Hero + Crisp White Form Card
   ========================================================================== */

:root {
  --auth-page-bg: #090d16;
  --auth-card-bg: #ffffff;
  --auth-text-dark: #0f172a;
  --auth-text-muted: #64748b;
  --auth-text-subtle: #94a3b8;
  --auth-input-bg: #f8fafc;
  --auth-input-border: #e2e8f0;
  --auth-input-focus: #1d68ed;
  --auth-primary: #1d68ed;
  --auth-primary-hover: #1e40af;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body.alezux-auth-body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Fondo de página completo standalone (100% Pantalla Completa Edge-to-Edge) */
body.alezux-auth-body {
  font-family: var(--font-family);
  background: #ffffff;
  color: var(--auth-text-dark);
  min-height: 100vh;
  height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
  display: block;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Modo embebido / shortcode */
div.alezux-auth-body {
  font-family: var(--font-family);
  color: var(--auth-text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  -webkit-font-smoothing: antialiased;
  width: 100%;
}

div.alezux-auth-body .alezux-auth-wrapper {
  max-width: 1100px;
  min-height: auto;
  height: auto;
}

div.alezux-auth-body .alezux-auth-card {
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  min-height: 640px;
  height: auto;
  padding: 12px;
  gap: 12px;
}

div.alezux-auth-body .alezux-hero-panel {
  border-radius: 20px;
  min-height: auto;
}

div.alezux-auth-body .alezux-form-panel {
  border-radius: 20px;
  min-height: auto;
}

/* Wrapper pantalla completa */
.alezux-auth-wrapper {
  width: 100%;
  min-height: 100vh;
  height: 100vh;
  margin: 0;
  padding: 0;
}

/* Tarjeta Split-Screen Pantalla Completa (Edge-to-Edge) */
.alezux-auth-card {
  background: var(--auth-card-bg);
  border-radius: 0;
  box-shadow: none;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  padding: 0;
  gap: 0;
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   PANEL IZQUIERDO: HERO VIBRANT BLUE (Fiel a Imagen 2)
   ========================================================================== */
.alezux-hero-panel {
  background: linear-gradient(150deg, #1d63ed 0%, #2563eb 50%, #3b82f6 100%);
  border-radius: 0;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  color: #ffffff;
  min-height: 100vh;
  box-sizing: border-box;
}

/* Glow interior sutil */
.alezux-hero-panel::before {
  content: "";
  position: absolute;
  top: -25%;
  right: -25%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, transparent 70%);
  pointer-events: none;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-decoration: none;
  z-index: 2;
}

.hero-brand svg {
  flex-shrink: 0;
}

.hero-middle {
  margin: auto 0;
  padding: 40px 0;
  z-index: 2;
  max-width: 520px;
}

/* Píldora translúcida */
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 9999px;
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 22px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Título Hero */
.hero-title {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin-bottom: 14px;
}

/* Subtítulo Hero */
.hero-subtitle {
  font-size: 15.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  max-width: 460px;
}

/* Grid de las 3 tarjetas inferiores */
.hero-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  z-index: 2;
  max-width: 580px;
}

.hero-step-card {
  border-radius: 16px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 122px;
  transition: all 0.25s ease;
}

/* Tarjeta 1: Blanca activa */
.hero-step-card.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hero-step-card.active .card-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1d63ed;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.hero-step-card.active .card-text {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

/* Tarjetas 2 y 3: Glass translúcidas */
.hero-step-card.glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.hero-step-card.glass .card-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.hero-step-card.glass .card-text {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}

/* ==========================================================================
   PANEL DERECHO: FORMULARIOS (FONDO BLANCO LIMPIO - IMAGEN 2)
   ========================================================================== */
.alezux-form-panel {
  padding: 50px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #ffffff;
  border-radius: 0;
  min-height: 100vh;
  box-sizing: border-box;
  overflow-y: auto;
}

.form-header {
  text-align: center;
  margin-bottom: 24px;
}

.form-title {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.form-subtitle {
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.45;
}

/* Alertas de Notificación */
.auth-alert-container {
  margin-bottom: 16px;
}

.auth-alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: authAlertFadeIn 0.25s ease;
}

@keyframes authAlertFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-alert.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.auth-alert.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
}

/* Campos de Formulario */
.auth-field {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

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

.auth-input {
  width: 100%;
  height: 48px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 0 16px;
  color: #0f172a;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.auth-input:focus {
  border-color: #1d63ed;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(29, 99, 237, 0.12);
}

.auth-input::placeholder {
  color: #94a3b8;
}

/* Fila de 2 Columnas (Nombre Completo & Usuario en Registro) */
.auth-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Icono de Checkmark verde en campo de usuario */
.input-check-icon {
  position: absolute;
  right: 14px;
  color: #10b981;
  display: flex;
  align-items: center;
  pointer-events: none;
}

/* Botón Ojo (Mostrar / Ocultar contraseña) */
.toggle-pwd-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.toggle-pwd-btn:hover {
  color: #0f172a;
}

/* Helper text debajo de la contraseña */
.field-helper-text {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.4;
}

/* Medidor de contraseña */
.password-meter-bar {
  height: 4px;
  width: 100%;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.password-meter-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.meter-weak { width: 33%; background: #ef4444; }
.meter-medium { width: 66%; background: #f59e0b; }
.meter-strong { width: 100%; background: #10b981; }

/* Fila de Recordarme & Olvidé contraseña */
.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 20px 0;
  font-size: 13px;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.remember-label input[type="checkbox"] {
  accent-color: #1d63ed;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.auth-link {
  color: #1d63ed;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
  cursor: pointer;
}

.auth-link:hover {
  color: #1e40af;
  text-decoration: underline;
}

/* Botón de Enviar (Continue / Iniciar Sesión) */
.auth-submit-btn {
  width: 100%;
  height: 50px;
  background: #1d63ed;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(29, 99, 237, 0.32);
  transition: all 0.2s ease;
}

.auth-submit-btn:hover {
  background: #1e40af;
  box-shadow: 0 6px 20px rgba(29, 99, 237, 0.42);
  transform: translateY(-1px);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* 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;
  display: none;
}

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

/* Switcher entre vistas */
.auth-switch-row {
  text-align: center;
  margin-top: 20px;
  font-size: 13.5px;
  color: #64748b;
}

.auth-switch-row a {
  margin-left: 4px;
}

/* Footer con Términos */
.auth-terms-footer {
  width: 100%;
  max-width: 440px;
  text-align: center;
  font-size: 11.5px;
  color: #94a3b8;
  margin: 24px auto 0 auto;
  line-height: 1.5;
}

.auth-terms-footer a {
  color: #64748b;
  text-decoration: underline;
}

/* ==========================================================================
   VISTAS DINÁMICAS (LOGIN / REGISTRO / RECUPERACIÓN / RESET)
   ========================================================================== */
.auth-view {
  width: 100%;
  max-width: 440px;
  margin: auto 0;
  display: block;
  animation: authViewFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes authViewFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE)
   ========================================================================== */
@media (max-width: 900px) {
  body.alezux-auth-body {
    height: auto;
    overflow-y: auto;
  }

  .alezux-auth-wrapper {
    height: auto;
    min-height: 100vh;
  }

  .alezux-auth-card {
    grid-template-columns: 1fr;
    min-height: 100vh;
    height: auto;
  }

  .alezux-hero-panel {
    min-height: auto;
    padding: 40px 24px;
  }

  .hero-middle {
    margin: 24px 0;
    padding: 0;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-cards-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    max-width: 100%;
  }

  .hero-step-card {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .hero-step-card .card-badge {
    margin-bottom: 0 !important;
  }

  .alezux-form-panel {
    min-height: auto;
    padding: 40px 24px 60px 24px;
  }

  .auth-row-2col {
    grid-template-columns: 1fr;
  }
}
