/* Pantallas de acceso (ingresar, recuperar clave, clave nueva) - oct-2026.
   Sin librerías externas: cargan rápido en el celular. Colores del ERP (morado #894ab4).
   Tema: el mismo del ERP (localStorage erp_tema); si nunca lo escogió, el del sistema. */
:root {
    --a-acento: #894ab4; --a-acento-2: #6d28a8; --a-acento-hover: #7a3fa3;
    --a-fondo: #f3eff8; --a-tarjeta: #ffffff; --a-borde: #ddd5ea; --a-texto: #1f2937; --a-suave: #5b6170;
    --a-campo: #faf8fd; --a-campo-borde: #cfc6df; --a-foco: rgba(137, 74, 180, .22);
    --a-error-fondo: #fdecef; --a-error-texto: #9f1239; --a-error-borde: #f6c4cf;
    --a-aviso-fondo: #fff7e6; --a-aviso-texto: #92400e; --a-aviso-borde: #f7d9a3;
    --a-ok-fondo: #e9f8f1; --a-ok-texto: #065f46; --a-ok-borde: #b5e6cf;
    --a-sombra: 0 18px 50px rgba(60, 25, 100, .14);
    color-scheme: light;
}
:root[data-theme="dark"] {
    --a-fondo: #0f1220; --a-tarjeta: #181c2b; --a-borde: #2a2f45; --a-texto: #eef0f6; --a-suave: #a3abbd;
    --a-campo: #11141f; --a-campo-borde: #343a55; --a-foco: rgba(192, 132, 252, .25);
    --a-error-fondo: rgba(244, 63, 94, .12); --a-error-texto: #fda4af; --a-error-borde: rgba(244, 63, 94, .35);
    --a-aviso-fondo: rgba(245, 158, 11, .12); --a-aviso-texto: #fcd34d; --a-aviso-borde: rgba(245, 158, 11, .35);
    --a-ok-fondo: rgba(16, 185, 129, .12); --a-ok-texto: #6ee7b7; --a-ok-borde: rgba(16, 185, 129, .35);
    --a-sombra: 0 18px 50px rgba(0, 0, 0, .45);
    color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    position: relative; min-height: 100vh; background: var(--a-fondo); color: var(--a-texto);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 1.5;
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px;
}
.a-marco {
    position: relative; isolation: isolate;
    width: 100%; max-width: 980px; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--a-tarjeta);
    border: 1px solid var(--a-borde); border-radius: 22px; overflow: hidden; box-shadow: var(--a-sombra);
    animation: a-entrar .75s cubic-bezier(.2, .8, .2, 1) both;
}
.a-marco.a-solo { max-width: 460px; grid-template-columns: 1fr; }
/* panel de la marca */
.a-marca {
    position: relative; padding: 44px 40px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
    background: radial-gradient(120% 90% at 0% 0%, #a463d1 0%, rgba(164, 99, 209, 0) 55%), linear-gradient(150deg, #894ab4 0%, #5e1f96 60%, #3d1068 100%);
}
.a-marca:after {
    content: ""; position: absolute; right: -80px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%;
    background: rgba(255, 255, 255, .07); pointer-events: none;
}
.a-logo { display: flex; align-items: center; gap: 12px; }
.a-logo img { width: 56px; height: 56px; border-radius: 14px; background: #fff; padding: 6px; object-fit: contain; }
.a-logo b { font-size: 21px; letter-spacing: .01em; }
.a-marca .a-titulo-marca { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 800; color: #fff; }
.a-marca p { margin: 10px 0 0; color: rgba(255, 255, 255, .85); font-size: 15px; }
.a-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.a-lista li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: rgba(255, 255, 255, .92); }
.a-lista svg { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .14); }
.a-pie-marca { font-size: 12.5px; color: rgba(255, 255, 255, .7); display: flex; align-items: center; gap: 8px; }
.a-pie-marca svg { width: 15px; height: 15px; }
/* formulario */
.a-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.a-encabezado { margin-bottom: 22px; }
.a-encabezado .a-logo-movil { display: none; }
.a-encabezado h1 { margin: 0; font-size: 24px; font-weight: 800; color: var(--a-texto); }
.a-h1 { margin: 0 0 8px; font-size: 22px; font-weight: 800; color: var(--a-texto); }
.a-encabezado p { margin: 6px 0 0; color: var(--a-suave); font-size: 14px; }
.a-campo { margin-bottom: 16px; }
.a-campo label, .a-etiqueta { display: block; font-size: 13px; font-weight: 700; color: var(--a-texto); margin-bottom: 6px; }
.a-entrada { position: relative; }
.a-entrada > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--a-suave); pointer-events: none; }
.a-entrada input {
    width: 100%; height: 48px; padding: 0 46px 0 44px; border-radius: 12px; border: 1px solid var(--a-campo-borde); background: var(--a-campo);
    color: var(--a-texto); font: inherit; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;  /* 16 px: el iPhone no agranda la página al tocar */
}
.a-entrada input::placeholder { color: var(--a-suave); opacity: .8; }
.a-entrada input:focus { border-color: var(--a-acento); box-shadow: 0 0 0 4px var(--a-foco); }
.a-entrada input:focus ~ svg { color: var(--a-acento); }
:root[data-theme="dark"] .a-entrada input:focus ~ svg { color: #c084fc; }
.a-ojo {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px;
    background: transparent; color: var(--a-suave); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.a-ojo:hover { background: var(--a-foco); color: var(--a-texto); }
.a-ojo svg { width: 19px; height: 19px; }
.a-mayus { display: none; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--a-aviso-texto); }
.a-mayus.a-ver { display: block; }
.a-entorno { display: flex; padding: 4px; gap: 4px; border-radius: 12px; border: 1px solid var(--a-campo-borde); background: var(--a-campo); }
.a-entorno label { flex: 1; margin: 0; cursor: pointer; }
.a-entorno input { position: absolute; opacity: 0; pointer-events: none; }
.a-entorno span {
    display: flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border-radius: 9px; font-size: 14px; font-weight: 700;
    color: var(--a-suave); transition: background-color .15s, color .15s;
}
.a-entorno span svg { width: 16px; height: 16px; }
.a-entorno input:checked + span { background: var(--a-acento); color: #fff; box-shadow: 0 4px 12px rgba(137, 74, 180, .35); }
.a-entorno input:focus-visible + span { outline: 2px solid var(--a-acento); outline-offset: 2px; }
.a-boton {
    width: 100%; height: 50px; margin-top: 8px; border: 0; border-radius: 12px; cursor: pointer; font: inherit; font-size: 15.5px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--a-acento) 0%, var(--a-acento-2) 100%); box-shadow: 0 8px 20px rgba(137, 74, 180, .32);
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .12s, box-shadow .12s, opacity .12s;
}
.a-boton:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(137, 74, 180, .42); }
.a-boton:disabled { opacity: .7; cursor: wait; transform: none; }
.a-boton svg { width: 18px; height: 18px; }
.a-boton.a-secundario { background: transparent; color: var(--a-acento); border: 1px solid var(--a-campo-borde); box-shadow: none; }
:root[data-theme="dark"] .a-boton.a-secundario { color: #d8b4fe; }
.a-girando { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: a-giro .7s linear infinite; }
@keyframes a-giro { to { transform: rotate(360deg); } }
.a-enlaces { margin-top: 18px; text-align: center; font-size: 14px; }
.a-enlaces a { color: var(--a-acento); font-weight: 700; text-decoration: none; }
:root[data-theme="dark"] .a-enlaces a { color: #d8b4fe; }
.a-enlaces a:hover { text-decoration: underline; }
.a-alerta { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 18px; border: 1px solid; }
.a-alerta svg { flex: none; width: 19px; height: 19px; margin-top: 1px; }
.a-alerta.a-error { background: var(--a-error-fondo); color: var(--a-error-texto); border-color: var(--a-error-borde); }
.a-alerta.a-aviso { background: var(--a-aviso-fondo); color: var(--a-aviso-texto); border-color: var(--a-aviso-borde); }
.a-alerta.a-ok { background: var(--a-ok-fondo); color: var(--a-ok-texto); border-color: var(--a-ok-borde); }
.a-reglas { list-style: none; margin: -4px 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; color: var(--a-suave); }
.a-reglas li { display: flex; align-items: center; gap: 7px; }
.a-reglas li:before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--a-campo-borde); flex: none; }
.a-reglas li.a-cumple { color: var(--a-ok-texto); font-weight: 600; }
.a-reglas li.a-cumple:before { background: #10b981; }
.a-icono-grande { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.a-icono-grande svg { width: 30px; height: 30px; }
.a-icono-grande.a-ok { background: var(--a-ok-fondo); color: var(--a-ok-texto); }
.a-icono-grande.a-aviso { background: var(--a-aviso-fondo); color: var(--a-aviso-texto); }
.a-centro { text-align: center; }
.a-centro p { color: var(--a-suave); }
.a-trampa { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.a-pie { position: fixed; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 12px; color: var(--a-suave); pointer-events: none; }
.a-tema {
    position: fixed; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--a-borde);
    background: var(--a-tarjeta); color: var(--a-suave); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.a-tema:hover { color: var(--a-texto); }
.a-tema svg { width: 19px; height: 19px; }
@media (max-width: 860px) {
    body { justify-content: flex-start; padding-top: 68px; }   /* el botón de tema (fijo arriba) no tapa la tarjeta */
    .a-marco { grid-template-columns: 1fr; max-width: 460px; }
    .a-marca { display: none; }
    .a-form { padding: 30px 24px; }
    .a-encabezado .a-logo-movil { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
    .a-encabezado .a-logo-movil img { width: 44px; height: 44px; border-radius: 12px; background: #fff; padding: 4px; object-fit: contain; border: 1px solid var(--a-borde); }
    .a-encabezado .a-logo-movil b { font-size: 18px; }
    .a-pie { position: static; margin-top: 18px; }
}
@media (max-width: 420px) { .a-reglas { grid-template-columns: 1fr; } }
/* pantallas bajas (celular acostado, portátil con zoom): el pie va debajo de la tarjeta y no encima */
@media (max-height: 700px) { body { justify-content: flex-start; } .a-pie { position: static; margin-top: 16px; } }
/* «reducir movimiento»: nada se mueve (también la aurora y el borde, que van en :before/:after) */
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { transition: none !important; animation: none !important; } }

/* ================================================================== animación «tecnológica» (oct-2026)
   Todo se apaga con «reducir movimiento» (regla de arriba) y nada depende de la animación para funcionar. */
@property --a-angulo { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes a-entrar { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes a-subir { from { opacity: 0; transform: translateY(10px); } }
@keyframes a-aurora {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
    50%  { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.08); }
    100% { transform: translate3d(-3%, 4%, 0) rotate(-6deg) scale(1.02); }
}
@keyframes a-girar-borde { to { --a-angulo: 360deg; } }
@keyframes a-parpadeo { 50% { opacity: 0; } }
@keyframes a-latido { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 100% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } }
@keyframes a-halo { 0%, 100% { box-shadow: 0 0 0 0 rgba(233, 213, 255, .35), 0 0 22px rgba(192, 132, 252, .35); }
                    50% { box-shadow: 0 0 0 6px rgba(233, 213, 255, 0), 0 0 34px rgba(192, 132, 252, .55); } }
@keyframes a-trazo { from { stroke-dashoffset: 120; } }
@keyframes a-brillo { from { left: -60%; } to { left: 130%; } }
@keyframes a-degradado { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* fondo de la página: aurora que se mueve despacio + cuadrícula de puntos que se desvanece en los bordes */
body:before {
    content: ""; position: fixed; inset: -25%; z-index: -1; pointer-events: none; filter: blur(40px);
    background:
        radial-gradient(32% 32% at 22% 28%, rgba(137, 74, 180, .26), transparent 70%),
        radial-gradient(26% 26% at 78% 22%, rgba(34, 211, 238, .14), transparent 70%),
        radial-gradient(36% 36% at 68% 82%, rgba(168, 85, 247, .20), transparent 70%);
    animation: a-aurora 24s ease-in-out infinite alternate;
}
:root[data-theme="dark"] body:before {
    background:
        radial-gradient(32% 32% at 22% 28%, rgba(137, 74, 180, .42), transparent 70%),
        radial-gradient(26% 26% at 78% 22%, rgba(34, 211, 238, .20), transparent 70%),
        radial-gradient(36% 36% at 68% 82%, rgba(168, 85, 247, .32), transparent 70%);
}
body:after {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image: radial-gradient(rgba(137, 74, 180, .22) 1px, transparent 1.2px); background-size: 24px 24px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 72%); mask-image: radial-gradient(ellipse at center, #000 20%, transparent 72%);
}
:root[data-theme="dark"] body:after { background-image: radial-gradient(rgba(192, 132, 252, .20) 1px, transparent 1.2px); }

/* la tarjeta: una luz morada y cian recorre el borde */
.a-marco:before {
    content: ""; position: absolute; inset: 0; z-index: 5; border-radius: inherit; padding: 1.5px; pointer-events: none;
    background: conic-gradient(from var(--a-angulo), transparent 0 68%, rgba(168, 85, 247, .95) 80%, rgba(34, 211, 238, .95) 88%, transparent 97%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
    animation: a-girar-borde 7s linear infinite; opacity: .85;
}
:root:not([data-theme="dark"]) .a-marco:before { opacity: .6; }
/* el formulario entra por partes */
.a-form > *, .a-form form > * { animation: a-subir .6s cubic-bezier(.2, .8, .2, 1) both; }
.a-form > :nth-child(2), .a-form form > :nth-child(1) { animation-delay: .12s; }
.a-form > :nth-child(3), .a-form form > :nth-child(2) { animation-delay: .2s; }
.a-form > :nth-child(4), .a-form form > :nth-child(3) { animation-delay: .28s; }
.a-form form > :nth-child(5), .a-form form > :nth-child(6) { animation-delay: .36s; }

/* panel de la marca: red animada detrás, contenido encima */
.a-marca { overflow: hidden; }
.a-red { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.a-marca > :not(.a-red) { position: relative; z-index: 1; }
.a-marca:after { z-index: 0; }
.a-logo-anillo { display: inline-flex; border-radius: 16px; animation: a-halo 4s ease-in-out infinite; }
.a-logo-anillo img { display: block; }
.a-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.a-marca .a-terminal {
    display: inline-flex; align-items: center; gap: 2px; margin: 14px 0 0; padding: 7px 12px; min-height: 34px; max-width: 100%;
    border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(18, 4, 38, .28);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 13.5px; color: #f3e8ff;
    white-space: nowrap; overflow: hidden;
}
.a-prompt { color: #67e8f9; font-weight: 700; margin-right: 6px; }
.a-cursor { display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; background: #e9d5ff; animation: a-parpadeo 1s steps(1) infinite; }
/* avisos del sistema (vidrio): entran arriba, salen abajo */
.a-avisos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; height: 188px; overflow: hidden; }
.a-evento {
    flex: none; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 12px; border-radius: 14px;
    background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .18);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 8px 24px rgba(20, 0, 50, .18);
    transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .45s ease;
}
.a-evento.a-entra { opacity: 0; transform: translateY(-14px) scale(.97); }
.a-evento.a-sale { opacity: 0; transform: translateY(12px) scale(.97); }
.a-ev-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.a-ev-ico svg { width: 18px; height: 18px; }
.a-ev-verde .a-ev-ico { background: rgba(16, 185, 129, .24); color: #6ee7b7; }
.a-ev-lila .a-ev-ico { background: rgba(216, 180, 254, .24); color: #f3e8ff; }
.a-ev-cian .a-ev-ico { background: rgba(34, 211, 238, .22); color: #a5f3fc; }
.a-ev-ambar .a-ev-ico { background: rgba(245, 158, 11, .24); color: #fcd34d; }
.a-ev-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.a-ev-txt b { font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-ev-txt small { font-size: 12px; color: rgba(255, 255, 255, .84); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-spark { flex: none; margin-left: auto; width: 64px; height: 24px; }
.a-spark path { stroke: #a5f3fc; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 120; stroke-dashoffset: 0;
                animation: a-trazo 1.4s ease-out .25s both; }
.a-pie-marca { gap: 18px; flex-wrap: wrap; }
.a-pie-marca span { display: inline-flex; align-items: center; gap: 8px; }
.a-estado i { width: 8px; height: 8px; border-radius: 50%; background: #34d399; animation: a-latido 1.8s ease-out infinite; }
/* botón: el degradado se mueve y un brillo lo cruza al pasar el mouse */
.a-boton:not(.a-secundario) {
    position: relative; overflow: hidden; background-image: linear-gradient(110deg, #894ab4 0%, #6d28a8 35%, #8b5cf6 65%, #894ab4 100%);
    background-size: 220% 100%; animation: a-degradado 7s ease infinite;
}
.a-boton:not(.a-secundario):after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent); transform: skewX(-20deg);
}
.a-boton:not(.a-secundario):hover:after { animation: a-brillo .9s ease; }
.a-boton svg { transition: transform .2s ease; }
.a-boton:hover svg { transform: translateX(3px); }
:root[data-theme="dark"] .a-entrada input:focus { box-shadow: 0 0 0 4px var(--a-foco), 0 0 22px rgba(168, 85, 247, .25); }
@media (max-height: 760px) { .a-avisos { height: 122px; } .a-marca { padding-top: 32px; padding-bottom: 32px; gap: 20px; } }

