/* ICFESSK - Auth and Onboarding Styles */
/* Extracted from pages.css - V7 CSS cleanup */

/* â”€â”€ Auth Pages (Login / Register) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.auth-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-primary);
}

.auth-brand {
  flex: 1.22; /* ~55% width */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 64px;
  background-color: #7235FE;
  background-image: linear-gradient(to right, #7235FE 0%, rgba(114, 53, 254, 0.7) 35%, transparent 60%), url('../assets/images/login.png');
  background-size: cover;
  background-position:10% center;
  background-repeat: no-repeat;
  color: var(--text-inverse);
  position: relative;
  overflow: hidden;
}

.auth-brand-logo {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: var(--fw-bold);
  font-size: 1.25rem;
  letter-spacing: 1px;
  width: max-content; /* Previene que el enlace ocupe todo el ancho */
}

.auth-brand-logo-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand-logo-icon span {
  font-size: 20px;
  color: white;
}

.auth-brand-text {
  position: relative;
  z-index: 10;
  margin: auto 0;
  max-width: 460px;
}

.auth-brand-text h1 {
  color: var(--text-inverse);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.05;
  margin-bottom: 24px;
  letter-spacing: -1.5px;
}

.auth-brand-text p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.2rem;
  line-height: 1.6;
}

.auth-brand-footer {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  z-index: 10;
}

/* Carousel Styles */
.auth-carousel-container {
  flex: 1.22;
  position: relative;
  overflow: hidden;
  background-color: #7545FD;
}

.auth-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  transform: scale(0.8) translateX(15%); /* Reduces size more and shifts further right */
  transform-origin: center right;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: 1;
}

.auth-carousel-slide.active {
  opacity: 1;
  z-index: 2;
}

/* Re-implement gradient overlay to perfectly blend image edges */
.auth-carousel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    /* Left gradient: hides the left edge and provides contrast for text */
    linear-gradient(to right, #7545FD 0%, #7545FD 20%, rgba(117, 69, 253, 0.8) 50%, transparent 80%),
    /* Top gradient: hides the top edge (now needs more coverage due to scale 0.8) */
    linear-gradient(to bottom, #7545FD 0%, #7545FD 12%, transparent 25%),
    /* Bottom gradient: hides the bottom edge */
    linear-gradient(to top, #7545FD 0%, #7545FD 12%, transparent 25%);
  z-index: 3;
  pointer-events: none;
}

/* Original text content positioned over carousel */
.auth-brand-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 4;
  color: var(--text-inverse);
  pointer-events: none; 
}

.auth-brand-content > * {
  pointer-events: auto;
}



.auth-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #F8F9FC;
  position: relative;
  overflow-y: auto; /* Si la tarjeta supera el alto, scrollea en vez de cortarse */
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-white);
  border-radius: 22px;
  padding: 40px;
  border: 1px solid rgba(17, 24, 39, 0.05);
  /* Profundidad por capas: una sombra de contacto fina + una difusa amplia. */
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.04),
    0 16px 40px -16px rgba(16, 24, 40, 0.14);
}

.auth-card h2 {
  font-size: 2rem;
  font-weight: var(--fw-extra);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.auth-card .form-label {
  font-weight: var(--fw-semi);
  color: #444;
  margin-bottom: 6px;
  font-size: 0.9rem;
  display: block;
}

.auth-card .form-input {
  background: #FBFCFE;
  border: 1.5px solid #E8ECF3;
  padding: 12px 15px;
  font-size: 0.95rem;
  border-radius: 10px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.auth-card .form-input:hover:not(:focus) {
  border-color: #D5DCE7;
}

/* Botón principal: estilo movido aquí desde inline para que los estados
   :hover / :active / :focus-visible funcionen (inline los bloqueaba). */
.auth-card .btn-lg {
  padding: 13px 24px;
  font-size: 1rem;
  color: #FFF;
  border: none;
  background: linear-gradient(135deg, #7235FE, #5A24D6);
  box-shadow: 0 4px 14px rgba(114, 53, 254, 0.30);
}

.auth-card .btn-lg:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(114, 53, 254, 0.40);
}

.auth-card .btn-lg:active:not(:disabled) {
  transform: scale(0.985);
  box-shadow: 0 3px 10px rgba(114, 53, 254, 0.28);
}

.auth-card .btn-lg:disabled {
  opacity: 0.55;
  box-shadow: none;
}

/* Anillo de foco por teclado (accesibilidad). */
.auth-card .btn-google:focus-visible,
.auth-card .btn-outline:focus-visible,
.auth-card .btn-lg:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(114, 53, 254, 0.40);
}

.auth-card .form-input:focus {
  background: #FFF;
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(114, 53, 254, 0.13);
}

.auth-card .password-wrapper {
  position: relative;
}

.auth-card .password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-secondary);
  opacity: 0.6;
}

.auth-social-sep {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: #ABB2BF;
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-social-sep::before,
.auth-social-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #EEE;
}

.btn-google {
  background: white;
  border: 1.5px solid #EEE;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: var(--fw-semi);
  border-radius: 10px;
  transition: background 0.2s, border-color 0.2s;
}

.btn-google:hover {
  background: #FAFBFD;
  border-color: #DDD;
}

.btn-google img {
  height: 20px;
  width: 20px;
}

/* Botón secundario "Regístrate / Inicia con tu correo" (estilo Claude) */
.btn-outline {
  background: #FFF;
  border: 1.5px solid #E6E9F0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: var(--fw-semi);
  border-radius: 10px;
  transition: background 0.2s, border-color 0.2s;
}

.btn-outline:hover {
  background: #FAFBFD;
  border-color: #D8DCE6;
}

.btn-outline .material-symbols-outlined {
  font-size: 20px;
  color: var(--violet);
}

/* Contenedor de etapas: morfea su altura al cambiar de etapa para que no haya
   un salto brusco. El JS fija la altura en px para poder transicionarla. */
#reg-stages {
  overflow: hidden;
  transition: height 280ms var(--ease-out-strong);
}

.reg-stage[hidden] { display: none; }

/* Entrada de una etapa: opacity + translateY + blur sutil para enmascarar el
   crossfade (técnica de Emil Kowalski). Easing fuerte ease-out, <300ms. */
.reg-stage.stage-enter {
  animation: stageEnter 260ms var(--ease-out-strong) both;
}

@keyframes stageEnter {
  from { opacity: 0; transform: translateY(8px); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0);   filter: blur(0);   }
}

/* Accesibilidad: sin movimiento, solo un fundido suave. */
@media (prefers-reduced-motion: reduce) {
  #reg-stages { transition: none; }
  .reg-stage.stage-enter { animation: stageFade 160ms ease both; }
  @keyframes stageFade { from { opacity: 0; } to { opacity: 1; } }
}

/* Feedback de pulsación: los botones responden al toque (estilo Emil). */
.auth-card .btn-google,
.auth-card .btn-outline,
.auth-card .btn-lg {
  transition: transform 140ms var(--ease-out-strong),
              background 160ms var(--ease), border-color 160ms var(--ease),
              box-shadow 160ms var(--ease);
}

.auth-card .btn-google:active,
.auth-card .btn-outline:active,
.auth-card .btn-lg:active {
  transform: scale(0.975);
}

/* "Volver" para regresar de la etapa de formulario a la de elección */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0;
  margin-bottom: 18px;
}

.auth-back:hover { color: var(--text-primary); }
.auth-back .material-symbols-outlined { font-size: 18px; }

/* Consentimiento Habeas Data, siempre visible (gobierna ambos métodos) */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-top: 18px;
}

.auth-consent input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: #7235FE;
  cursor: pointer;
}

.auth-consent a { color: #7235FE; font-weight: 600; }

.auth-switch {
  text-align: center;
  font-size: 1rem;
  margin-top: 32px;
  color: var(--text-secondary);
}

.auth-switch a {
  font-weight: var(--fw-bold);
  color: var(--violet);
}

/* ── Recuperar contraseña ────────────────────────────────────────────── */
/* Entrada del modo activo (solicitar / nueva clave): mismo lenguaje que las
   etapas de register — opacity + translateY + blur, ease-out fuerte, <300ms. */
.rp-stage-enter {
  animation: stageEnter 300ms var(--ease-out-strong) both;
}

/* Estado "solicitud enviada": icono Material en un disco suave (nada de emoji). */
.rp-done {
  text-align: center;
  padding: 6px 0 2px;
  animation: stageEnter 320ms var(--ease-out-strong) both;
}

.rp-done-icon {
  font-size: 30px;
  color: #7235FE;
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(114, 53, 254, 0.12), rgba(139, 92, 246, 0.08));
  margin-bottom: 14px;
}

.rp-done-title {
  font-size: 1.15rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: 6px;
}

.rp-done-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 340px;
  margin: 0 auto;
}

/* Accesibilidad: sin movimiento, solo un fundido suave (usa stageFade del bloque
   reduced-motion de arriba). */
@media (prefers-reduced-motion: reduce) {
  .rp-stage-enter,
  .rp-done { animation: stageFade 160ms ease both; }
}

.auth-footer-links {
  margin-top: 48px;
  display: flex;
  gap: 24px;
  font-size: 0.85rem;
  color: #9BABB8;
}

.auth-footer-links a {
  color: inherit;
  transition: color 0.2s;
}

.auth-footer-links a:hover {
  color: var(--text-primary);
}

@media (max-width: 1024px) {
  .auth-layout {
    flex-direction: column;
    height: auto !important;
    overflow-y: auto !important;
  }

  .auth-carousel-container {
    flex: none;
    height: 35vh;
    min-height: 260px;
    width: 100%;
  }

  .auth-carousel-slide {
    transform: scale(1) translateX(0);
    object-position: center;
  }

  .auth-carousel-overlay {
    background: 
      linear-gradient(to top, #7545FD 0%, #7545FD 15%, rgba(117, 69, 253, 0.7) 40%, transparent 100%),
      linear-gradient(to right, #7545FD 0%, rgba(117, 69, 253, 0.4) 40%, transparent 100%);
  }

  .auth-brand-content {
    padding: 24px;
    justify-content: flex-end;
  }

  .auth-brand-logo {
    position: absolute;
    top: 24px;
    left: 24px;
  }

  .auth-brand-footer {
    display: none; /* Hide footer inside carousel on mobile to save space */
  }

  .auth-brand-text {
    margin: 0;
    max-width: 100%;
  }

  .auth-brand-text h1 {
    font-size: 2rem;
    margin-bottom: 8px;
  }

  .auth-brand-text p {
    font-size: 1rem;
    display: none; /* Hide paragraph on smaller tablets/phones to focus on the form */
  }

  .auth-form-panel {
    flex: none;
    min-height: 65vh;
    padding: 32px 16px;
    background: #F8F9FC;
  }

  .auth-card {
    padding: 32px 24px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
  }
}

@media (max-width: 480px) {
  .auth-carousel-container {
    height: 30vh;
    min-height: 220px;
  }

  .auth-brand-text h1 {
    font-size: 1.6rem;
  }

  .auth-card {
    padding: 24px 20px;
  }
  
  .auth-card h2 {
    font-size: 1.8rem;
  }
}


/* Legacy .onboarding-* styles removed — replaced by css/pages/onboarding.css (wizard v2). */

