/* Pantallas de acceso (/login, /cuenta/login, /admin/login): fondo animado + tarjeta.
   Paleta del logo: navy #1b2350 / cyan #4dc0dd. Toda la animación respeta
   prefers-reduced-motion. El fondo de partículas lo pinta login.js sobre #login-net. */
:root {
  --navy: #1b2350; --navy-dark: #0c1028; --navy-mid: #232c63; --cyan: #4dc0dd; --cyan-soft: #8fdcee;
  --panel: #ffffff; --border: #e1e5ee; --text: #1c2233; --muted: #6b7280;
  --danger: #c0362c; --danger-bg: #fdecea; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 55%, #141a3d 100%);
  overflow-x: hidden; position: relative;
}

/* ---------- Fondo ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; will-change: transform; }
.bg .b1 { width: 46vmax; height: 46vmax; left: -14vmax; top: -16vmax; background: radial-gradient(circle, rgba(77,192,221,.55), transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.bg .b2 { width: 40vmax; height: 40vmax; right: -12vmax; bottom: -14vmax; background: radial-gradient(circle, rgba(59,76,190,.65), transparent 65%); animation: drift2 32s ease-in-out infinite alternate; }
.bg .b3 { width: 26vmax; height: 26vmax; right: 12vmax; top: -8vmax; background: radial-gradient(circle, rgba(77,192,221,.28), transparent 65%); animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-12vmax, -9vmax) scale(1.18); } }
@keyframes drift3 { to { transform: translate(-16vmax, 14vmax) scale(.9); } }

/* Rejilla técnica con máscara radial: da "seriedad" de panel de control */
.bg .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(143,220,238,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(143,220,238,.07) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 72%);
  animation: gridmove 40s linear infinite;
}
@keyframes gridmove { to { background-position: 52px 52px, 52px 52px; } }

#login-net { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Anillos de radar concéntricos (eco de la lupa del logo) centrados tras la tarjeta */
.radar { position: fixed; left: 50%; top: 50%; z-index: 0; pointer-events: none; width: 0; height: 0; }
.radar i {
  position: absolute; left: 0; top: 0; border-radius: 50%;
  border: 1px solid rgba(77,192,221,.30);
  transform: translate(-50%, -50%) scale(.2); opacity: 0;
  width: min(120vmin, 980px); height: min(120vmin, 980px);
  animation: ping 9s cubic-bezier(.2,.6,.3,1) infinite;
}
.radar i:nth-child(2) { animation-delay: 3s; }
.radar i:nth-child(3) { animation-delay: 6s; }
@keyframes ping { 0% { transform: translate(-50%,-50%) scale(.2); opacity: 0; } 12% { opacity: .9; } 100% { transform: translate(-50%,-50%) scale(1); opacity: 0; } }

/* ---------- Tarjeta ---------- */
.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 400px; margin: 24px; animation: rise .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.98); } to { opacity: 1; transform: none; } }

/* Borde luminoso giratorio (conic-gradient animado vía @property; sin soporte = borde estático) */
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.login-card {
  position: relative; background: var(--panel); border-radius: var(--radius); padding: 38px 34px 30px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.06);
  isolation: isolate;
}
.login-card::before {
  content: ""; position: absolute; inset: -1.5px; z-index: -1; border-radius: calc(var(--radius) + 1.5px);
  background: conic-gradient(from var(--ang), transparent 0 55%, var(--cyan) 75%, #fff 80%, var(--cyan) 85%, transparent 100%);
  animation: spin 7s linear infinite;
}
.login-card::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: var(--radius); background: var(--panel); }
@keyframes spin { to { --ang: 360deg; } }

.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.logo-ring { position: relative; width: 54px; height: 54px; flex: none; display: grid; place-items: center; }
.logo-ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--cyan); border-right-color: rgba(77,192,221,.35); animation: rot 3.2s linear infinite; }
.logo-ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: radial-gradient(circle, rgba(77,192,221,.14), transparent 70%); animation: breathe 3.6s ease-in-out infinite; }
.logo-ring img { position: relative; z-index: 1; width: 34px; height: 34px; margin: 0; border-radius: 0; }
@keyframes rot { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.25); opacity: .5; } }
.brand-name { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; line-height: 1.35; }
.brand-name b { display: block; color: var(--navy); font-size: 13px; letter-spacing: .12em; }

.badge { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #168aa8; background: rgba(77,192,221,.14); border-radius: 999px; padding: 3px 10px; margin-bottom: 8px; }
.login-card h1 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.01em; color: var(--navy); }
.login-card p.sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }

/* Entrada escalonada de los elementos internos */
.login-card .brand, .login-card h1, .login-card .badge, .login-card p.sub, .login-card .alert, .login-card form > *, .login-card .aux-link, .login-card .back-link {
  animation: fadeup .6s cubic-bezier(.2,.8,.2,1) both;
}
.login-card .brand { animation-delay: .15s; } .login-card .badge { animation-delay: .2s; } .login-card h1 { animation-delay: .25s; }
.login-card p.sub { animation-delay: .3s; } .login-card .alert { animation-delay: .32s; }
.login-card form > :nth-child(1) { animation-delay: .36s; } .login-card form > :nth-child(2) { animation-delay: .42s; }
.login-card form > :nth-child(3) { animation-delay: .48s; } .login-card form > :nth-child(4) { animation-delay: .54s; }
.login-card form > :nth-child(5) { animation-delay: .6s; } .login-card form > :nth-child(6) { animation-delay: .66s; }
.login-card form > :nth-child(7) { animation-delay: .72s; }
.login-card .aux-link, .login-card .back-link { animation-delay: .78s; }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; color: var(--navy); }
input[type=email], input[type=password] {
  width: 100%; padding: 11px 13px; border: 2px solid #aab6d3; border-radius: 9px;
  font-size: 14px; font-family: inherit; margin-bottom: 16px; background: #fff; color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:hover { border-color: #7f8fbb; }
input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(77,192,221,.2); }
/* Ojo mostrar/ocultar contraseña (lo inyecta password-toggle.js): cian claro del logo */
.login-card .pw-wrap > .pw-eye { color: #4dc0dd; transition: color .2s ease, transform .15s ease; }
.login-card .pw-wrap > .pw-eye:hover, .login-card .pw-wrap > .pw-eye:focus-visible, .login-card .pw-wrap > .pw-eye.is-active { color: #1fa5c7; }
.login-card .pw-wrap > .pw-eye:hover { transform: scale(1.12); }
.hint { color: var(--muted); font-size: 12px; margin: -10px 0 18px; }

button[type=submit] {
  position: relative; overflow: hidden; width: 100%; border: none; padding: 12px 22px; border-radius: 9px;
  font-size: 14px; font-weight: 700; letter-spacing: .02em; cursor: pointer; font-family: inherit; color: #fff;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  box-shadow: 0 8px 20px -8px rgba(27,35,80,.7);
  transition: transform .15s ease, box-shadow .2s ease;
}
button[type=submit]::after { /* destello que cruza el botón al pasar el ratón */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent); transform: skewX(-20deg); transition: left .6s ease;
}
button[type=submit]:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(27,35,80,.85), 0 0 0 3px rgba(77,192,221,.25); }
button[type=submit]:hover::after { left: 130%; }
button[type=submit]:active { transform: translateY(0); }
button[type=submit].is-loading { pointer-events: none; opacity: .85; }
button[type=submit].is-loading::before { content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 9px; vertical-align: -2px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }

.alert { background: var(--danger-bg); color: var(--danger); border: 1px solid #f3c6c2; border-radius: 9px; padding: 10px 12px; margin-bottom: 18px; font-size: 13px; font-weight: 600; }
.alert { animation-name: fadeup, shake !important; animation-duration: .6s, .45s !important; animation-delay: .32s, .5s !important; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.aux-link, .back-link { display: block; text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--muted); text-decoration: none; transition: color .2s ease; }
.aux-link:hover, .back-link:hover { color: var(--navy); text-decoration: underline; }

.foot { position: relative; z-index: 1; text-align: center; margin-top: 18px; font-size: 11.5px; letter-spacing: .08em; color: rgba(255,255,255,.45); animation: fadeup .8s .9s both; }


/* ---------- Transición login -> panel ---------- */
.enter-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; opacity: 0; transition: opacity .45s ease;
  background: radial-gradient(circle at 50% 45%, #1b2350 0%, #0c1028 75%); overflow: hidden; }
.enter-overlay.on { opacity: 1; }
body.is-entering .v-tip-bubble { display: none !important; }
body.is-entering .login-wrap { transition: transform .6s cubic-bezier(.5,0,.2,1), opacity .5s ease; transform: scale(.92) translateY(-14px); opacity: 0; }
.enter-core { position: relative; z-index: 1; text-align: center; color: #fff; transform: scale(.85); opacity: 0; animation: coreIn .7s .25s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes coreIn { to { transform: none; opacity: 1; } }
.enter-core img { width: 64px; height: 64px; display: block; margin: 0 auto; position: relative; filter: drop-shadow(0 0 18px rgba(77,192,221,.55)); }
.enter-ring { position: absolute; left: 50%; top: 0; width: 104px; height: 104px; margin: -20px 0 0 -52px; border-radius: 50%; border: 3px solid transparent; border-top-color: #4dc0dd; border-right-color: rgba(77,192,221,.3); animation: rot 1.1s linear infinite; }
.enter-core p { margin: 38px 0 14px; font-size: 12px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: #8fdcee; }
.enter-bar { width: 180px; height: 3px; margin: 0 auto; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.enter-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #4dc0dd, #fff); animation: fill 1.4s .3s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes fill { to { width: 100%; } }
.enter-pulse { position: absolute; left: 50%; top: 50%; width: 120vmax; height: 120vmax; margin: -60vmax 0 0 -60vmax; border-radius: 50%; border: 1px solid rgba(77,192,221,.35); transform: scale(.05); animation: pulse 1.5s .2s ease-out forwards; }
@keyframes pulse { to { transform: scale(1); opacity: 0; } }

/* ---------- Móvil ---------- */
@media (max-width: 480px) {
  .login-wrap { margin: 16px; }
  .login-card { padding: 30px 22px 24px; }
  .bg .blob { filter: blur(50px); }
  .bg .grid { background-size: 40px 40px; }
}
@media (max-height: 560px) { .login-wrap { margin: 12px; } .brand { margin-bottom: 14px; } }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition: none !important; }
  .radar { display: none; }
}
