/* =====================================================================
   Login — pantalla partida: panel de identidad a la izquierda (color del
   menú de Personalización, fondo de login opcional y un disco olímpico
   dibujado) y formulario a la derecha sobre blanco.

   Antes: naranja #ff6a3d fijo con texto blanco encima (2,85:1), una tarjeta
   de cristal casi transparente sobre una ola de color y un personaje de
   clipart. Los colores ahora llegan de _MarcaVariables.cshtml.
   ===================================================================== */

* { box-sizing: border-box; }

:root {
  --tinta: #0f172a;
  --tinta-2: #475569;
  --borde: #e2e8f0;
  --fondo: #ffffff;
  --fondo-suave: #f6f7f9;
  --error: #b91c1c;
  --exito: #15803d;
  --ease-suave: cubic-bezier(0.22, 1, 0.36, 1);
}

html, body { height: 100%; margin: 0; }
body.login-body {
  font-family: var(--fuente-base, "Segoe UI", system-ui, sans-serif);
  color: var(--tinta);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}

.acceso {
  display: grid;
  grid-template-columns: minmax(360px, 44%) 1fr;
  min-height: 100vh;
}

/* ---------------------------------------------------------------- */
/* Panel de identidad                                                 */
/* ---------------------------------------------------------------- */
.acceso-marca {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 44px 48px 36px;
  color: var(--sobre-marca, #fff);
  background-color: var(--marca, #0f172a);
}
/* Fondo de login elegido en Personalización, teñido con el color de marca
   para que el texto siga legible sea cual sea la foto. */
.acceso-marca::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background-image: var(--fondo-marca, none);
  background-size: cover;
  background-position: center;
  opacity: .35;
  mix-blend-mode: luminosity;
}
.acceso-marca::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(180deg, transparent 40%, rgba(0,0,0,.18));
}

.acceso-marca__cabecera { display: flex; align-items: center; gap: 12px; }
.acceso-marca__logo {
  display: grid; place-items: center;
  height: 44px; padding: 6px 10px;
  background: #fff; border-radius: 10px;
}
.acceso-marca__logo img { max-height: 32px; max-width: 120px; object-fit: contain; display: block; }
.acceso-marca__nombre { font-weight: 700; font-size: 15px; letter-spacing: .01em; }

.acceso-marca__mensaje { max-width: 30ch; animation: accesoSube .7s var(--ease-suave) both; }
.acceso-marca__antetitulo {
  margin: 0 0 14px;
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  opacity: .9;
}
.acceso-marca__titulo {
  margin: 0 0 16px;
  font-family: var(--fuente-display);
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.acceso-marca__texto { margin: 0; font-size: 15px; line-height: 1.6; opacity: .92; max-width: 38ch; }
.acceso-marca__pie { margin: 0; font-size: 12px; opacity: .9; position: relative; }

/* Disco olímpico: gira muy despacio, recortado por la esquina. */
.acceso-disco {
  position: absolute; z-index: -1;
  width: 560px; height: 560px;
  right: -190px; bottom: -170px;
  color: var(--sobre-marca, #fff);
  animation: accesoGira 120s linear infinite;
}
.acceso-disco__borde   { fill: currentColor; fill-opacity: .07; }
.acceso-disco__cara    { fill: none; stroke: currentColor; stroke-opacity: .22; stroke-width: 2; }
.acceso-disco__marcas line { stroke: currentColor; stroke-opacity: .32; stroke-width: 2; stroke-linecap: round; }
.acceso-disco__texto   { fill: currentColor; fill-opacity: .42; font: 800 34px var(--fuente-display); letter-spacing: .18em; }
.acceso-disco__texto--chico { font-size: 15px; letter-spacing: .32em; fill-opacity: .34; }
.acceso-disco__anillo  { fill: none; stroke: currentColor; stroke-opacity: .22; stroke-width: 14; }
.acceso-disco__cubo    { fill: currentColor; fill-opacity: .12; }
.acceso-disco__agujero { fill: var(--marca, #0f172a); stroke: currentColor; stroke-opacity: .3; stroke-width: 3; }

/* ---------------------------------------------------------------- */
/* Formulario                                                         */
/* ---------------------------------------------------------------- */
.acceso-formulario {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: var(--fondo);
}

.login-escenario { display: grid; width: 100%; max-width: 380px; }
.login-escenario > .login-tarjeta { grid-area: 1 / 1; }

.login-tarjeta { width: 100%; animation: accesoSube .5s var(--ease-suave) .08s both; }

.login-titulo {
  margin: 0 0 8px;
  font-family: var(--fuente-display);
  font-size: 30px; line-height: 1.15; font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--tinta);
}
.login-subtitulo { margin: 0 0 28px; font-size: 14.5px; line-height: 1.55; color: var(--tinta-2); }

.login-paso { overflow: visible; }
.login-paso--saliendo-izq { animation: loginSalirIzq .28s ease forwards; }
.login-paso--entrando-der { animation: loginEntrarDer .35s var(--ease-suave) both; }
.login-paso--saliendo-der { animation: loginSalirDer .28s ease forwards; }
.login-paso--entrando-izq { animation: loginEntrarIzq .35s var(--ease-suave) both; }

.login-campo { margin-bottom: 18px; }
.login-campo label { display: block; font-size: 13px; font-weight: 600; color: var(--tinta); margin-bottom: 7px; }
.login-campo input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font: 400 15.5px var(--fuente-base);
  color: var(--tinta);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.login-campo input::placeholder { color: #94a3b8; }
.login-campo input:hover { border-color: #94a3b8; }
.login-campo input:focus {
  outline: none;
  border-color: var(--acento);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--acento) 18%, transparent);
}
.login-campo input.input-validation-error { border-color: var(--error); }

.login-clave { position: relative; }
.login-clave input { padding-right: 88px; }
.login-clave__ver {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  height: 36px; padding: 0 12px;
  background: none; border: 0; border-radius: 8px;
  font: 600 13px var(--fuente-base); color: var(--tinta-2);
  cursor: pointer;
}
.login-clave__ver:hover { background: var(--fondo-suave); color: var(--tinta); }
.login-clave__ver:focus-visible { outline: 2px solid var(--acento); outline-offset: 1px; }

.login-correo-seleccionado {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--fondo-suave);
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 10px 8px 10px 14px;
  margin-bottom: 20px;
  font-size: 14px; color: var(--tinta);
}
.login-correo-seleccionado span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-correo-seleccionado button {
  flex-shrink: 0; height: 32px; padding: 0 10px;
  background: none; border: 0; border-radius: 8px;
  color: var(--tinta); font: 600 13px var(--fuente-base);
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.login-correo-seleccionado button:hover { background: #fff; }

.login-checkbox { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--tinta-2); margin: 2px 0 22px; cursor: pointer; }
.login-checkbox input { accent-color: var(--acento); width: 17px; height: 17px; margin: 0; }

.login-btn {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--acento);
  color: var(--sobre-acento, #fff);
  font: 600 15px var(--fuente-base);
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, box-shadow .2s ease;
}
.login-btn:hover { background: var(--acento-oscuro); box-shadow: 0 8px 18px -10px var(--acento); }
.login-btn:active { transform: scale(.98); }
.login-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--acento); }
.login-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.login-enlaces { text-align: center; margin-top: 20px; font-size: 14px; }
.login-enlaces a { color: var(--tinta-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #cbd5e1; }
.login-enlaces a:hover { color: var(--tinta); text-decoration-color: currentColor; }
.login-enlaces a:focus-visible, .login-correo-seleccionado button:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 4px; }

.login-error {
  display: flex; flex-direction: column; gap: 2px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid var(--error);
  color: var(--error);
  font-size: 13.5px; line-height: 1.45;
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 20px;
  animation: loginSacudida .4s ease .1s;
}
.login-campo-error { color: var(--error); font-size: 12.5px; margin-top: 6px; display: block; }

.login-link-volver { background: none; border: none; font-size: 14px; cursor: pointer; padding: 0; }

.login-confirmacion-icono {
  display: block;
  width: 56px; height: 56px; padding: 14px;
  margin: 0 0 20px;
  border-radius: 50%;
  background: #dcfce7;
  color: var(--exito);
  animation: loginRebote .5s var(--ease-suave) .15s backwards;
}
.login-confirmacion-mensaje {
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
  font-size: 14px; line-height: 1.55;
  padding: 12px 14px; border-radius: 10px;
  margin: 8px 0 14px;
}
.login-confirmacion-nota { font-size: 13px; color: var(--tinta-2); margin: 0; }

/* ---------------------------------------------------------------- */
/* Animaciones                                                       */
/* ---------------------------------------------------------------- */
@keyframes accesoSube { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes accesoGira { to { transform: rotate(360deg); } }
@keyframes loginSalirIzq { to { opacity: 0; transform: translateX(-20px); } }
@keyframes loginEntrarDer { from { opacity: 0; transform: translateX(20px); } }
@keyframes loginSalirDer { to { opacity: 0; transform: translateX(20px); } }
@keyframes loginEntrarIzq { from { opacity: 0; transform: translateX(-20px); } }
@keyframes loginRebote { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes loginSacudida { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Cambio entre iniciar sesión / recuperar / confirmación. Las clases las pone
   el script de la vista; antes era un volteo 3D de 100°, ahora un relevo corto. */
.login-tarjeta--doblar-salida  { animation: loginTarjetaSale .45s ease forwards; }
.login-tarjeta--doblar-entrada { animation: loginTarjetaEntra .45s var(--ease-suave) forwards; }
@keyframes loginTarjetaSale  { to { opacity: 0; transform: translateY(-10px); } }
@keyframes loginTarjetaEntra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- */
/* Responsive: el panel de identidad pasa a ser una franja superior   */
/* ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .acceso { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .acceso-marca { padding: 22px 20px 24px; gap: 18px; min-height: 0; }
  .acceso-marca__mensaje { max-width: none; }
  .acceso-marca__titulo { font-size: 24px; margin-bottom: 0; }
  .acceso-marca__antetitulo, .acceso-marca__texto, .acceso-marca__pie { display: none; }
  .acceso-disco { width: 300px; height: 300px; right: -110px; bottom: -150px; }
  .acceso-formulario { align-items: flex-start; padding: 32px 20px 40px; }
  .login-titulo { font-size: 26px; }
}
