/*
 * LOGIN
 * Escritorio: formulario a la izquierda y, a la derecha, la marca sobre un
 * mapa de calles con trayectos de taxis que se van trazando.
 * Celular y tableta: el mapa queda de fondo y el formulario en una tarjeta.
 */
:root {
  --ink: #0c1424; --muted: #6b7382; --line: #d6dae2;
  --azul: #001789; --azul-2: #1a2fa0; --azul-soft: #e8ebf8;
  --celeste: #3fb4f0;
  --rojo: #c8102e; --rojo-soft: #fbe9ec;
  --fondo-oscuro: #050c45;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--fondo-oscuro); -webkit-font-smoothing: antialiased; }

.login { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 34%) 1fr; }

/* Formulario */
.login-panel {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px; background: #fff;
  box-shadow: 12px 0 40px rgba(0, 0, 0, .25);
}
.login-contenido { width: 100%; max-width: 380px; animation: entrada .5s ease-out both; }
.login-logo { display: block; width: 230px; max-width: 100%; height: auto; margin-bottom: 30px; }
h1 { margin: 0 0 6px; font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.subtitulo { margin: 0 0 30px; color: var(--muted); font-size: 15px; }

form { display: grid; gap: 18px; }
.campo label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.campo-caja { position: relative; }
.campo-icono {
  position: absolute; top: 50%; left: 16px; width: 20px; height: 20px; transform: translateY(-50%);
  fill: none; stroke: #8b93a3; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none; transition: stroke .15s;
}
.campo-caja input {
  width: 100%; height: 52px; padding: 0 14px 0 46px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: #f6f7fa; border: 1px solid var(--line); border-radius: 12px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.campo-caja input::placeholder { color: #a7adba; }
.campo-caja input:focus { background: #fff; border-color: var(--azul); box-shadow: 0 0 0 4px var(--azul-soft); }
.campo-caja:focus-within .campo-icono { stroke: var(--azul); }

.campo-password input { padding-right: 52px; }
.ver-password {
  position: absolute; top: 0; right: 0; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; background: none; border: 0; border-radius: 0 12px 12px 0;
  color: #8b93a3; cursor: pointer;
}
.ver-password:hover, .ver-password:focus-visible { color: var(--azul); outline: none; }
.ver-password svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ver-password .ojo-tachado, .ver-password.visible .ojo { display: none; }
.ver-password.visible .ojo-tachado { display: block; }

.msg { margin: 0; padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.msg-error { background: var(--rojo-soft); color: var(--rojo); }
.msg-aviso { background: var(--azul-soft); color: var(--azul); }

.recordar {
  display: inline-flex; align-items: center; gap: 8px; justify-self: start;
  font-size: 14px; color: var(--muted); cursor: pointer; user-select: none;
}
.recordar input { width: 17px; height: 17px; margin: 0; accent-color: var(--azul); cursor: pointer; }

.btn-entrar {
  height: 52px; margin-top: 6px; border: 0; border-radius: 12px;
  font: inherit; font-size: 15px; font-weight: 800; letter-spacing: .08em;
  background: var(--azul); color: #fff; cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 23, 137, .28);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn-entrar::after { content: '→'; display: inline-block; margin-left: 10px; transition: transform .15s; }
.btn-entrar:hover, .btn-entrar:focus-visible { background: var(--azul-2); box-shadow: 0 12px 28px rgba(0, 23, 137, .36); outline: none; }
.btn-entrar:hover::after { transform: translateX(4px); }
.btn-entrar:active { transform: translateY(1px); }
.btn-entrar:disabled { background: #4a5590; box-shadow: none; cursor: wait; }
.btn-entrar:disabled::after {
  content: ''; width: 14px; height: 14px; margin-left: 12px; vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%;
  animation: girar .7s linear infinite;
}

.instalar { margin: 22px 0 0; }
.instalar button { padding: 0; font: inherit; font-size: 14px; background: none; border: 0; color: var(--azul); text-decoration: underline; cursor: pointer; }

/* Marca sobre la red de calles */
.login-visual {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 55% 45%, rgba(26, 47, 160, .9), transparent 65%),
    linear-gradient(150deg, #0a1a8a 0%, #06105a 55%, #030838 100%);
}
/* Mapa: manzanas rectas, avenidas y trayectos que se trazan con un destello en la punta.
   Ruta y destello usan pathLength=1400 y la misma curva, así el destello va en la punta del trazo. */
.mapa { position: absolute; inset: 0; width: 100%; height: 100%; }
.mapa .manzana { fill: rgba(255, 255, 255, .025); }
.mapa .calle { fill: none; stroke: rgba(160, 190, 255, .08); stroke-width: 1; }
.mapa .avenida { fill: none; stroke: rgba(160, 190, 255, .18); stroke-width: 2; }
.mapa .ruta, .mapa .destello { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mapa .ruta {
  stroke: var(--celeste); stroke-width: 2; opacity: .4;
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: trazo 11s cubic-bezier(.45, .05, .35, 1) infinite;
}
.mapa .destello {
  stroke: #dff4ff; stroke-width: 3.2;
  stroke-dasharray: 70 2800; stroke-dashoffset: 70; opacity: 0;
  filter: drop-shadow(0 0 4px #7fd0ff) drop-shadow(0 0 10px var(--celeste));
  animation: destello 11s cubic-bezier(.45, .05, .35, 1) infinite;
}
.mapa .pin { fill: var(--celeste); opacity: .85; }
.mapa .pin-onda {
  fill: none; stroke: var(--celeste); stroke-width: 1.4;
  transform-box: fill-box; transform-origin: center;
  animation: onda 3.4s ease-out infinite;
}
.mapa .trayecto-b .ruta, .mapa .trayecto-b .destello { animation-duration: 14s; animation-delay: 2.6s; }
.mapa .trayecto-b .ruta { opacity: .28; }
.mapa .trayecto-b .pin-onda { animation-delay: 1.1s; }
.mapa .trayecto-c .ruta, .mapa .trayecto-c .destello { animation-duration: 9s; animation-delay: 5.2s; }
.mapa .trayecto-c .ruta { opacity: .3; }
.mapa .trayecto-c .pin-onda { animation-delay: 2.2s; }
.mapa .trayecto-d .ruta, .mapa .trayecto-d .destello { animation-duration: 12s; animation-delay: 7.4s; }
.mapa .trayecto-d .ruta { opacity: .32; }
.mapa .trayecto-d .pin-onda { animation-delay: .5s; }
.mapa .pin-suelto .pin { opacity: .7; }
.mapa .ps-1 .pin-onda { animation-delay: 1.7s; animation-duration: 3.9s; }
.mapa .ps-2 .pin-onda { animation-delay: 2.8s; animation-duration: 3.1s; }
.mapa .ps-3 .pin-onda { animation-delay: .8s; animation-duration: 3.6s; }

.login-marca { position: relative; text-align: center; color: #fff; padding: 0 40px; animation: entrada .7s ease-out .1s both; }
.login-marca img { display: block; width: min(620px, 50vw); height: auto; margin: 0 auto 18px; filter: drop-shadow(0 26px 34px rgba(0, 0, 0, .45)); }
.login-marca b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.login-marca p {
  margin: 14px 0 0; font-size: 13px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
}
.login-marca p span { margin: 0 6px; color: var(--celeste); }
.login-marca small { display: block; margin-top: 14px; font-size: 14px; color: rgba(255, 255, 255, .6); }

/* Animaciones */
@keyframes entrada { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes trazo { 0% { stroke-dashoffset: 1400; } 45%, 62% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1400; } }
@keyframes destello {
  0% { stroke-dashoffset: 70; opacity: 0; }
  4% { opacity: 1; }
  43% { opacity: 1; }
  45% { stroke-dashoffset: -1330; opacity: 0; }
  100% { stroke-dashoffset: -1330; opacity: 0; }
}
@keyframes onda { 0% { transform: scale(.6); opacity: .55; } 70%, 100% { transform: scale(2.4); opacity: 0; } }
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .login-contenido, .login-marca, .mapa .pin-onda, .mapa .destello { animation: none; }
  .mapa .ruta { animation: none; stroke-dashoffset: 0; }
}

/* Celular y tableta: el mapa de fondo, el formulario en tarjeta */
@media (max-width: 991px) {
  .login { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
  .login-visual { position: fixed; inset: 0; z-index: 0; }
  .login-marca { display: none; }
  .login-panel { width: 100%; max-width: 440px; padding: 36px 28px; border-radius: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
  .login-logo { width: 210px; margin: 0 auto 22px; }
  h1, .subtitulo { text-align: center; }
}
