/* atraii — páginas de cuenta (/entrar y /registro).
   Se carga después de landing.css: reutiliza sus tokens, .boton, .logo y .pie.
   Superficie «Configure»: el formulario manda; la marca vive en el titular y el campo. */

.auth-body { min-height: 100dvh; display: flex; flex-direction: column; }

/* Cabecera mínima */
.auth-cab {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem var(--margen);
}
.auth-cab .cruce { display: inline-flex; align-items: center; gap: .5rem; color: var(--texto-tenue); font-size: .95rem; font-weight: 600; }
.auth-cab .cruce .boton { min-height: 44px; padding: .5rem 1.1rem; font-size: .95rem; }

/* Escenario */
.auth {
  position: relative; isolation: isolate; flex: 1;
  padding: clamp(1.5rem, 5vw, 5rem) var(--margen) clamp(3rem, 8vw, 6rem);
}
.auth-campo { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.auth-campo svg { position: absolute; left: -12%; top: -6%; width: min(1100px, 130vw); height: auto; opacity: .5; }
.auth-campo .campo { fill: none; stroke: var(--indigo); stroke-width: 1; opacity: .5; }
.auth-campo .campo-ambar { stroke: var(--ambar); opacity: .38; }
.auth-campo .imanta { fill: var(--ambar); }

.auth-grid {
  max-width: var(--ancho); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
  gap: clamp(2rem, 6vw, 7rem); align-items: start;
}

/* Lado editorial */
.auth-lado { padding-top: clamp(0rem, 4vw, 3.5rem); }
.auth-lado h1 {
  font-size: var(--gigante); line-height: .96; letter-spacing: -.055em; font-weight: 800;
  text-wrap: balance; max-width: 11ch;
}
.auth-lado .apoyo { margin-top: 1.5rem; font-size: clamp(1.08rem, 1rem + .45vw, 1.35rem); color: var(--texto-suave); max-width: 34ch; text-wrap: pretty; }

.auth-pasos { margin-top: clamp(2rem, 5vw, 3.5rem); display: grid; gap: 0; max-width: 30rem; counter-reset: paso; }
.auth-pasos li {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .25rem 1rem; align-items: baseline;
  padding: 1rem 0; border-top: 1px solid var(--linea);
}
.auth-pasos li::before {
  counter-increment: paso; content: counter(paso, decimal-leading-zero);
  font-weight: 800; color: var(--ambar); font-variant-numeric: tabular-nums;
}
.auth-pasos b { font-weight: 700; color: var(--texto); }
.auth-pasos span { grid-column: 2; color: var(--texto-tenue); font-size: .95rem; }

/* Panel del formulario */
.panel {
  background: var(--noche-1);
  border: 1px solid var(--linea);
  border-radius: var(--r-l);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  box-shadow: 0 40px 80px -40px oklch(30% 0.2 277 / .7);
}
.panel h2 { font-size: var(--grande); line-height: 1.1; letter-spacing: -.035em; font-weight: 800; }
.panel .bajada { margin-top: .5rem; color: var(--texto-suave); font-size: 1rem; }

.form { margin-top: 1.75rem; display: grid; gap: 1.15rem; }
.campo-f { display: grid; gap: .4rem; }
.campo-f label, .campo-f .etq { font-weight: 700; font-size: .95rem; color: var(--texto); }
.campo-f .opc { font-weight: 600; color: var(--texto-tenue); }
.campo-f .ayuda { font-size: .85rem; color: var(--texto-tenue); }
.campo-f .error { font-size: .88rem; font-weight: 600; color: var(--coral); display: none; }
.campo-f.mal .error { display: block; }

.entrada-f {
  width: 100%; min-height: 52px; padding: .8rem 1rem;
  font: inherit; font-size: 1rem; color: var(--texto);
  background: var(--noche-0); border: 1.5px solid var(--linea-fuerte); border-radius: 12px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.entrada-f::placeholder { color: var(--texto-tenue); opacity: 1; }
.entrada-f:hover { border-color: oklch(100% 0 0 / .3); }
.entrada-f:focus { outline: none; border-color: var(--indigo-300); box-shadow: 0 0 0 4px oklch(62% 0.2 277 / .35); }
.campo-f.mal .entrada-f { border-color: var(--coral); }
.entrada-f:-webkit-autofill { -webkit-text-fill-color: var(--texto); -webkit-box-shadow: 0 0 0 100px var(--noche-0) inset; caret-color: var(--texto); }

/* Contraseña con «Mostrar» */
.clave { position: relative; }
.clave .entrada-f { padding-right: 6rem; }
.clave button {
  position: absolute; right: 4px; top: 4px; bottom: 4px; min-width: 44px; padding: 0 .9rem;
  border-radius: 9px; font-size: .88rem; font-weight: 700; color: var(--indigo-200);
}
.clave button:hover { background: var(--noche-2); color: var(--blanco); }

.fila-clave { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.enlace-btn {
  display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0;
  font-size: .9rem; font-weight: 700; color: var(--indigo-200); text-decoration: underline; text-underline-offset: 3px;
}
.enlace-btn:hover { color: var(--blanco); }

/* Casillas */
.casilla { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: .8rem; align-items: start; font-size: .92rem; line-height: 1.55; color: var(--texto-suave); }
.casilla input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--indigo); cursor: pointer; }
.casilla a { color: var(--indigo-200); font-weight: 700; text-underline-offset: 3px; }
.casilla a:hover { color: var(--blanco); }
.casilla-wrap.mal .casilla input { outline: 2px solid var(--coral); outline-offset: 2px; }
.casilla-wrap .error { margin: .4rem 0 0 calc(22px + .8rem); font-size: .88rem; font-weight: 600; color: var(--coral); display: none; }
.casilla-wrap.mal .error { display: block; }

.form .boton-principal { width: 100%; min-height: 54px; margin-top: .35rem; font-size: 1.05rem; }
.nota { font-size: .88rem; color: var(--texto-tenue); line-height: 1.55; }
.cruce-pie { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--linea); color: var(--texto-tenue); font-size: .95rem; }
.cruce-pie a { color: var(--blanco); font-weight: 700; text-underline-offset: 3px; }

/* Avisos (entrar) */
.aviso {
  margin-top: 1.25rem; padding: 1.1rem 1.2rem; border-radius: var(--r-m);
  background: var(--noche-2); border: 1px solid var(--linea-fuerte);
}
.aviso[hidden] { display: none; }
.aviso p { color: var(--texto-suave); font-size: .97rem; }
.aviso p b { color: var(--texto); }
.aviso .boton { margin-top: 1rem; min-height: 46px; }
.aviso a:not(.boton) { color: var(--indigo-200); font-weight: 700; }
.aviso.entra { animation: aviso-in .45s var(--ease) both; }
@keyframes aviso-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Pantalla de «¡Listo!» (registro) */
.listo[hidden] { display: none; }
.listo .sello {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ambar); color: var(--tinta); margin-bottom: 1.25rem;
}
.listo .sello svg { width: 28px; height: 28px; }
.listo h2 { outline: none; }
.listo .resumen { margin-top: 1.25rem; display: grid; gap: .1rem; font-size: .95rem; }
.listo .resumen div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .75rem; padding: .55rem 0; border-top: 1px solid var(--linea); }
.listo .resumen dt { color: var(--texto-tenue); }
.listo .resumen dd { color: var(--texto); font-weight: 600; overflow-wrap: anywhere; }
.listo .acciones { margin-top: 1.5rem; flex-direction: column; }
.listo .acciones .boton { width: 100%; }
.listo .nota { margin-top: 1rem; }
.listo .nota a, .listo .nota button { color: var(--indigo-200); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.listo.entra { animation: aviso-in .5s var(--ease) both; }

/* Pie mínimo */
.auth-pie { padding: 1.5rem var(--margen) 2rem; border-top: 1px solid var(--linea); color: var(--texto-tenue); font-size: .88rem; }
.auth-pie div { max-width: var(--ancho); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; align-items: center; }
.auth-pie nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.auth-pie a { display: inline-flex; align-items: center; min-height: 44px; color: var(--texto-suave); text-decoration: none; }
.auth-pie a:hover { color: var(--blanco); text-decoration: underline; text-underline-offset: 3px; }

/* Entrada orquestada: el campo se dibuja una vez */
.js .auth-campo .campo { stroke-dasharray: 1; stroke-dashoffset: 1; animation: trazo 1.6s var(--ease) forwards; }
.js .auth-campo .campo:nth-child(2) { animation-delay: .08s; }
.js .auth-campo .campo:nth-child(3) { animation-delay: .16s; }
.js .auth-campo .campo:nth-child(4) { animation-delay: .24s; }
.js .auth-campo .campo-ambar { stroke-dasharray: 4 10; stroke-dashoffset: 0; animation: none; }
@keyframes trazo { to { stroke-dashoffset: 0; } }

@media (max-width: 960px) {
  .auth-grid { grid-template-columns: minmax(0, 1fr); max-width: 34rem; }
  .auth-lado { padding-top: 0; }
  .auth-lado h1 { font-size: var(--enorme); max-width: 14ch; }
  .auth-pasos { display: none; }
}
@media (max-width: 640px) {
  .auth-cab .cruce span { display: none; }
  .auth-lado .apoyo { margin-top: 1rem; font-size: 1.05rem; }
  .auth-grid { gap: 1.75rem; }
  .panel { border-radius: 22px; padding: 1.4rem 1.15rem 1.5rem; }
  .auth-pie div { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .js .auth-campo .campo { animation: none; stroke-dashoffset: 0; stroke-dasharray: none; }
  .js .auth-campo .campo-ambar { stroke-dasharray: 4 10; }
  .aviso.entra, .listo.entra { animation: none; }
}
