﻿*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  background: #c5cafa;
}

.screen {
  position: fixed;
  inset: 0;
  pointer-events: none;
  visibility: hidden;
}

.screen.active {
  pointer-events: auto;
  visibility: visible;
}

.screen-1 {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 500ms ease;
}

.screen-1.fade-out {
  opacity: 0;
  pointer-events: none;
}

.gradient-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.gradient-bg::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background:
    radial-gradient(ellipse at 30% 40%, #c8d0ff 0%, transparent 40%),
    radial-gradient(ellipse at 70% 60%, #b0b8e8 0%, transparent 40%),
    radial-gradient(ellipse at 50% 30%, #d8dfff 0%, transparent 35%),
    radial-gradient(ellipse at 50% 70%, #a0a8d0 0%, transparent 40%);
  background-color: #c5cafa;
}

.landing-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #1a1a1a;
}

.landing-content h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #1a1a1a;
}

.landing-content p {
  font-size: 1.25rem;
  font-weight: 400;
  margin-top: 0.75rem;
  color: #888;
}

.btn-arrow {
  margin-top: 2.5rem;
  width: 88px;
  height: 72px;
  border-radius: 20px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(6px);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0), 0 0 0 0 rgba(255, 255, 255, 0);
  transition: opacity 500ms ease, transform 500ms ease, background 150ms ease;
}

.btn-arrow.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Anillo de glow que rodea el botón — se dispara una vez al entrar
   (.enter-glow, JS lo agrega/quita) y se repite en cada hover (CSS puro). */
.btn-arrow.enter-glow,
.btn-arrow:hover {
  animation: btnArrowGlowRing 900ms ease;
}

@keyframes btnArrowGlowRing {
  0% { border-color: transparent; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0), 0 0 0 0 rgba(255, 255, 255, 0); }
  50% { border-color: rgba(255, 255, 255, 0.95); box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.4), 0 0 28px 10px rgba(255, 255, 255, 0.5); }
  100% { border-color: transparent; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0), 0 0 0 0 rgba(255, 255, 255, 0); }
}

.btn-arrow svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: #1a1a1a;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-arrow:hover {
  background: rgba(255, 255, 255, 0.8);
}

.screen-2 {
  pointer-events: none;
}

.split-left {
  position: fixed;
  left: 0;
  top: 0;
  width: 50vw;
  height: 100vh;
  background: #fff;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transform: translateX(-100%);
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.split-left.slide-in {
  transform: translateX(0);
}

.split-right {
  position: fixed;
  right: 0;
  top: 0;
  width: 50vw;
  height: 100vh;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Al confirmar el correo, lo azul "recorre" hacia la izquierda cubriendo
   toda la pantalla mientras split-left sale (ver .split-left sin .slide-in). */
.split-right.cover {
  width: 100vw;
}

.form-wrap {
  width: 100%;
  max-width: 360px;
  padding: 2rem;
}

.form-accent {
  width: 40px;
  height: 2px;
  background: #8b9aff;
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

.form-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
}

.form-subtitle {
  color: #888;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  margin-bottom: 2.5rem;
}

.form-label {
  display: block;
  color: #888;
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
}

.email-input {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid #e0e0e0;
  padding: 10px 0;
  font-size: 1rem;
  font-family: inherit;
  color: #1a1a1a;
  outline: none;
}

.email-input:focus {
  border-color: #8b9aff;
}

.email-input::placeholder {
  color: #aaa;
}

.btn-continue {
  display: block;
  margin-top: 2rem;
  background: #8b9aff;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 36px;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.btn-continue:hover {
  background: #7a8be8;
}

.info-wrap {
  position: relative;
  z-index: 1;
  color: #1a1a1a;
  text-align: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 600ms ease 150ms;
}

.info-wrap.fade-in {
  opacity: 1;
}

.info-name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

.info-desc {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: #3d3a7a;
}

.info-features {
  list-style: none;
  margin-top: 2rem;
  text-align: left;
  display: inline-block;
}

.info-features li {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: #3d3a7a;
  line-height: 1.4;
}

.curtain {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(197, 202, 250, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
}

.curtain.active {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #8b9aff;
  border-radius: 50%;
}

.screen-3 {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
  overflow-y: auto; /* si el teclado deja poco espacio, la card scrollea en vez de cortarse */
}

/* Separada de .active (visibility, genérica a todo .screen) para poder
   forzar un reflow entre "hacerse visible" y "empezar a animar opacidad". */
.screen-3.show {
  opacity: 1;
  pointer-events: auto;
}

.otp-card {
  position: relative;
  background: #fff;
  border-radius: 22px;
  padding: 3rem 2.5rem;
  width: 400px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.otp-card-body {
  transition: opacity 400ms ease;
}

/* Al validar el OTP: el contenido se apaga y solo queda la card blanca lisa. */
.otp-card-body.hide {
  opacity: 0;
}

/* Luego toda la pantalla se cubre del mismo fondo que welcome.html (#f0f0f0)
   antes de navegar ahí — así no hay salto de color al llegar. */
.whiteout {
  position: fixed;
  inset: 0;
  background: #f0f0f0;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}

.whiteout.show {
  opacity: 1;
}

.otp-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.otp-sub {
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.otp-sub span {
  color: #8b9aff;
  font-weight: 600;
}

.otp-input-wrap {
  position: relative;
  margin-bottom: 1.5rem;
}

#otpInput {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: text;
  font-size: 1.5rem;
  letter-spacing: 2.1rem;
  border: none;
  background: transparent;
  z-index: 2;
}

.otp-segments {
  display: flex;
  gap: 8px;
}

.otp-segments span {
  flex: 1;
  height: 60px;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a1a;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
  cursor: text;
}

.otp-segments span.active {
  border-color: #8b9aff;
  box-shadow: 0 0 0 3px rgba(139, 154, 255, 0.18);
}

@keyframes otpDigitPop {
  0% { transform: scale(0.55); opacity: 0.4; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.otp-segments span.pop {
  animation: otpDigitPop 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.otp-segments span.filled {
  border-color: #8b9aff;
  background: rgba(139, 154, 255, 0.04);
}

.otp-segments span.error {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.05);
}

.otp-attempts {
  font-size: 0.75rem;
  color: #bbb;
  text-align: center;
  margin-bottom: 0.75rem;
}

.otp-timer {
  font-size: 0.8rem;
  color: #8b9aff;
  text-align: center;
  font-weight: 600;
}

.otp-flood {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, #c8d0ff, #b0b8e8);
  border-radius: inherit;
  transform: scale(0);
  transform-origin: center;
  z-index: 10;
  pointer-events: none;
}

.otp-flood.active {
  transform: scale(3);
}

.hidden {
  display: none !important;
}

