/* Pantallas de acceso: login, registro, recuperación.
 *
 * Hoja independiente del build de Tailwind para poder trabajar con efectos que
 * no se expresan bien en utilidades: capas de cristal líquido, desenfoque de
 * fondo y transiciones entre pasos del registro.
 *
 * Estructura: dos columnas. A la izquierda el discurso de marca sobre una
 * imagen de fondo; a la derecha el formulario sobre una tarjeta de cristal.
 * Por debajo de 1024 px la columna izquierda se retira y queda solo el
 * formulario con una cabecera compacta.
 */

/* ── Rejilla principal ────────────────────────────────────────────────── */
.auth-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  background: #05070c;
}

@media (min-width: 1024px) {
  .auth-shell { grid-template-columns: 46fr 54fr; }
}

/* ── Columna izquierda: marca ─────────────────────────────────────────── */
.auth-aside {
  display: none;
  position: relative;
  isolation: isolate;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  overflow: hidden;
}

@media (min-width: 1024px) { .auth-aside { display: flex; } }

.auth-aside-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Un desplazamiento lentísimo evita que la imagen se lea como estática. */
  animation: auth-drift 34s ease-in-out infinite alternate;
}

@keyframes auth-drift {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to   { transform: scale(1.14) translate3d(-2%, -2%, 0); }
}

/* Velo para garantizar contraste del texto sobre cualquier zona clara. */
.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, .55) 0%, rgba(5, 7, 12, .2) 40%, rgba(5, 7, 12, .92) 100%),
    linear-gradient(90deg, rgba(5, 7, 12, .7) 0%, transparent 55%);
}

/* El logotipo ya incluye el nombre: no se le añade texto al lado. */
.auth-brand {
  display: inline-block;
  text-decoration: none;
  transition: opacity .2s ease;
}

.auth-brand:hover { opacity: .82; }

.auth-brand img {
  display: block;
  width: auto;
  height: 34px;
}

.auth-aside-body { max-width: 460px; }

.auth-aside-title {
  margin: 0;
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -.025em;
  color: #fff;
}

.auth-aside-text {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, .62);
  font-size: 16px;
  line-height: 1.65;
}

.auth-points {
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.auth-points li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  color: rgba(255, 255, 255, .82);
  font-size: 15px;
  line-height: 1.5;
}

.auth-point-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 9px;
  border: 1px solid rgba(109, 140, 255, .32);
  background: rgba(36, 73, 255, .16);
  color: #8ea6ff;
  font-size: 14px;
}

.auth-aside-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .38);
  font-size: 13px;
}

/* ── Columna derecha: formulario ──────────────────────────────────────── */
.auth-main {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow: hidden;
}

/* Cristal líquido: manchas de color muy desenfocadas que se desplazan lento.
   Son lo que la tarjeta translúcida refracta por detrás. */
.auth-blob {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  will-change: transform;
}

.auth-blob-1 {
  top: -12%;
  right: -8%;
  width: 46vmax;
  height: 46vmax;
  background: radial-gradient(circle, rgba(36, 73, 255, .85) 0%, transparent 70%);
  animation: auth-float-1 22s ease-in-out infinite alternate;
}

.auth-blob-2 {
  bottom: -18%;
  left: -14%;
  width: 40vmax;
  height: 40vmax;
  background: radial-gradient(circle, rgba(120, 48, 255, .7) 0%, transparent 70%);
  animation: auth-float-2 27s ease-in-out infinite alternate;
}

.auth-blob-3 {
  top: 38%;
  left: 30%;
  width: 26vmax;
  height: 26vmax;
  background: radial-gradient(circle, rgba(0, 190, 255, .5) 0%, transparent 70%);
  animation: auth-float-3 19s ease-in-out infinite alternate;
}

@keyframes auth-float-1 { to { transform: translate3d(-12%, 14%, 0) scale(1.16); } }
@keyframes auth-float-2 { to { transform: translate3d(16%, -12%, 0) scale(1.22); } }
@keyframes auth-float-3 { to { transform: translate3d(-18%, -16%, 0) scale(.84); } }

/* Retícula tenue por encima de las manchas: da sensación de superficie. */
.auth-main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 60% at 50% 45%, #000 0%, transparent 100%);
}

.auth-panel {
  width: 100%;
  max-width: 448px;
}

/* Cabecera compacta: solo cuando la columna de marca no está visible. */
.auth-mobile-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
}

@media (min-width: 1024px) { .auth-mobile-brand { display: none; } }

/* ── Tarjeta de cristal ───────────────────────────────────────────────── */
.auth-card {
  position: relative;
  padding: 34px 32px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 22px;
  background: rgba(255, 255, 255, .045);
  backdrop-filter: blur(26px) saturate(165%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .1) inset,
    0 -30px 60px -40px rgba(36, 73, 255, .55) inset,
    0 30px 70px -25px rgba(0, 0, 0, .75);
  animation: auth-card-in .62s cubic-bezier(.16, 1, .3, 1) both;
}

/* Reflejo especular en el borde superior: es lo que lee el ojo como cristal. */
.auth-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
}

@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(22px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.auth-head { margin-bottom: 26px; }

.auth-title {
  margin: 0;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: #fff;
}

.auth-sub {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, .5);
  font-size: 14.5px;
  line-height: 1.55;
}

/* Los campos entran escalonados tras la tarjeta. */
.auth-stagger > * {
  animation: auth-field-in .5s cubic-bezier(.16, 1, .3, 1) both;
}

.auth-stagger > *:nth-child(1) { animation-delay: .10s; }
.auth-stagger > *:nth-child(2) { animation-delay: .16s; }
.auth-stagger > *:nth-child(3) { animation-delay: .22s; }
.auth-stagger > *:nth-child(4) { animation-delay: .28s; }
.auth-stagger > *:nth-child(5) { animation-delay: .34s; }
.auth-stagger > *:nth-child(6) { animation-delay: .40s; }

@keyframes auth-field-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Campos ───────────────────────────────────────────────────────────── */
.auth-field { display: block; }
.auth-field + .auth-field { margin-top: 16px; }

.auth-label {
  display: block;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, .72);
  font-size: 13.5px;
  font-weight: 500;
}

.auth-hint {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, .35);
  font-size: 12.5px;
}

.auth-input-wrap { position: relative; }

.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.auth-input::placeholder { color: rgba(255, 255, 255, .3); }

.auth-input:hover { border-color: rgba(255, 255, 255, .2); }

.auth-input:focus {
  border-color: rgba(109, 140, 255, .75);
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 3px rgba(36, 73, 255, .22);
}

.auth-input:autofill,
.auth-input:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px #101426 inset;
}

.auth-input-icon { padding-right: 44px; }

.auth-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, .45);
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease;
}

.auth-eye:hover { color: #fff; background: rgba(255, 255, 255, .07); }

/* Casillas y filas auxiliares */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: rgba(255, 255, 255, .6);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}

.auth-check input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: #2449ff;
  cursor: pointer;
}

.auth-link {
  color: #8ea6ff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color .18s ease;
}

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

/* ── Botones ──────────────────────────────────────────────────────────── */
.auth-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2449ff 0%, #4d6bff 55%, #7830ff 100%);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .22s ease, filter .18s ease;
  box-shadow: 0 10px 30px -12px rgba(36, 73, 255, .9);
}

.auth-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 16px 40px -14px rgba(36, 73, 255, 1);
}

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

.auth-btn-ghost {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: none;
  font-weight: 500;
}

.auth-btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, .09);
  box-shadow: none;
  filter: none;
}

.auth-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.auth-actions .auth-btn-ghost { flex: 0 0 38%; }

.auth-foot {
  margin: 22px 0 0;
  text-align: center;
  color: rgba(255, 255, 255, .5);
  font-size: 14px;
}

.auth-legal {
  margin: 22px 0 0;
  text-align: center;
  color: rgba(255, 255, 255, .33);
  font-size: 12.5px;
  line-height: 1.6;
}

.auth-legal a { color: rgba(255, 255, 255, .55); }

/* ── Registro en dos pasos ────────────────────────────────────────────── */
.auth-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-step-dot {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .11);
  overflow: hidden;
}

.auth-step-dot::after {
  content: "";
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #2449ff, #7830ff);
  transition: width .45s cubic-bezier(.16, 1, .3, 1);
}

.auth-step-dot.is-done::after,
.auth-step-dot.is-active::after { width: 100%; }

.auth-step-label {
  color: rgba(255, 255, 255, .45);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

/* Los pasos se apilan en la misma caja y solo uno es visible.
   La altura la anima el contenedor para que la tarjeta no dé un salto. */
.auth-step-viewport {
  position: relative;
  transition: height .42s cubic-bezier(.16, 1, .3, 1);
}

.auth-step {
  transition: opacity .3s ease, transform .42s cubic-bezier(.16, 1, .3, 1);
}

.auth-step[hidden] {
  display: block;
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.auth-step[hidden].is-behind  { transform: translateX(-26px); }
.auth-step[hidden].is-ahead   { transform: translateX(26px); }

/* Medidor de contraseña */
.auth-meter {
  display: flex;
  gap: 5px;
  margin-top: 9px;
}

.auth-meter span {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
  transition: background-color .25s ease;
}

.auth-meter[data-score="1"] span:nth-child(-n+1) { background: #f0554b; }
.auth-meter[data-score="2"] span:nth-child(-n+2) { background: #f5af3c; }
.auth-meter[data-score="3"] span:nth-child(-n+3) { background: #3ecf8e; }
.auth-meter[data-score="4"] span                 { background: #3ecf8e; }

.auth-meter-text {
  margin-top: 7px;
  color: rgba(255, 255, 255, .42);
  font-size: 12.5px;
}

.auth-error {
  margin-top: 7px;
  color: #ff8a80;
  font-size: 13px;
}

/* ── Accesibilidad ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .auth-aside-bg,
  .auth-blob,
  .auth-card,
  .auth-stagger > * {
    animation: none !important;
  }

  .auth-step,
  .auth-step-viewport,
  .auth-step-dot::after {
    transition: none !important;
  }
}
