/* Toda la página es la consola oscura del NOC: la red a la izquierda y el ingreso en una tarjeta. */
.login-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 1.05fr) minmax(460px, .95fr);
    overflow: hidden;
    color: #fff;
    background: radial-gradient(circle at 40% 45%, rgba(243,21,58,.24), transparent 30%), radial-gradient(circle at 88% 78%, rgba(42,120,214,.26), transparent 34%), radial-gradient(circle at 8% 6%, rgba(42,120,214,.20), transparent 32%), linear-gradient(150deg, #0e1726 0%, #090f1a 55%, #150c16 100%);
}
/* Cuadrícula de consola de monitoreo. */
.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .2;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 85%);
}
.login-visual {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 24px;
    padding: clamp(40px, 5vw, 72px) clamp(40px, 5.5vw, 84px);
    color: #fff;
}
.login-visual-logo {
    position: relative;
    z-index: 3;
    width: 150px;
    height: auto;
}

/* Red HUB → OLT → nodos. */
.noc-stage {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: center;
    gap: 20px;
    min-height: 260px;
}
.noc-map {
    width: 100%;
    max-width: 480px;
    max-height: 100%;
    height: auto;
    justify-self: center;
    overflow: visible;
}
.noc-events {
    display: grid;
    gap: 12px;
}
.noc-links path {
    fill: none;
    stroke: rgba(255,255,255,.18);
    stroke-width: 1.5;
}
.noc-links path.is-alarm {
    stroke: rgba(243,21,58,.75);
    stroke-dasharray: 6 6;
    animation: nocBroken 1.6s linear infinite;
}
.noc-flow path {
    fill: none;
    stroke: #5fd3a6;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 10 220;
    animation: nocFlow 3.2s linear infinite;
}
.noc-flow path:nth-child(2) {
    animation-delay: .8s;
}
.noc-flow path:nth-child(3) {
    animation-delay: 1.6s;
}
.noc-flow path:nth-child(4) {
    animation-delay: 2.4s;
}
.noc-node text {
    fill: rgba(255,255,255,.55);
    font: 800 13px Manrope, sans-serif;
    letter-spacing: .12em;
    text-anchor: middle;
}
.noc-node.is-hub circle {
    fill: #182437;
    stroke: #5fd3a6;
    stroke-width: 2.5;
}
.noc-node.is-olt circle {
    fill: #182437;
    stroke: #5fd3a6;
    stroke-width: 2;
}
.noc-node.is-ok circle {
    fill: #5fd3a6;
    filter: drop-shadow(0 0 6px rgba(95,211,166,.55));
}
.noc-node.is-down circle {
    fill: #f3153a;
    filter: drop-shadow(0 0 10px rgba(243,21,58,.9));
}
.noc-node.is-down text {
    fill: #ff6a82;
}
.noc-node.is-down .noc-ring {
    fill: none;
    stroke: #f3153a;
    stroke-width: 2;
    filter: none;
    transform-box: fill-box;
    transform-origin: center;
    animation: nocAlarm 2.4s ease-out infinite;
}
.noc-node.is-down .noc-ring.is-late {
    animation-delay: 1.2s;
}

/* Tarjetas de eventos alrededor de la red. */
.noc-card {
    position: relative;
    display: grid;
    gap: 3px;
    min-width: 190px;
    padding: 11px 14px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    background: rgba(13,21,34,.78);
    box-shadow: 0 16px 34px rgba(0,0,0,.35);
    backdrop-filter: blur(6px);
    animation: nocFloat 6s ease-in-out infinite;
}
.noc-card strong {
    font: 800 14px Manrope, sans-serif;
}
.noc-card small {
    color: #aeb8c7;
    font-size: 12px;
}
.noc-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font: 800 10px Manrope, sans-serif;
    letter-spacing: .1em;
}
.noc-card-tag i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.noc-card.is-alarm {
    border-color: rgba(243,21,58,.45);
}
.noc-card.is-alarm .noc-card-tag {
    color: #ff6a82;
}
.noc-card.is-alarm .noc-card-tag i {
    animation: nocBlink 1.2s ease-in-out infinite;
}
.noc-card.is-maintenance {
    animation-delay: -2s;
}
.noc-card.is-maintenance .noc-card-tag {
    color: #f7b955;
}
.noc-card.is-sent {
    animation-delay: -4s;
}
.noc-card.is-sent .noc-card-tag {
    color: #5fd3a6;
}

.visual-copy {
    position: relative;
    z-index: 3;
    max-width: 620px;
}
.visual-copy h1 {
    margin: 12px 0 14px;
    font: 800 clamp(32px, 3.6vw, 52px)/1.06 Manrope, sans-serif;
    letter-spacing: -2px;
}
.visual-copy p {
    max-width: 560px;
    margin: 0;
    color: #aeb8c7;
    font-size: 15px;
    line-height: 1.7;
}
.visual-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}
.visual-features li {
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    color: #d6dce6;
    background: rgba(255,255,255,.05);
    font: 700 12px Manrope, sans-serif;
}
.eyebrow.light {
    color: #ff6a82;
}
.login-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 65px clamp(35px, 6vw, 100px) 56px;
}
.login-theme {
    position: absolute;
    top: 26px;
    right: 30px;
    color: #fff;
    border-color: rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
}
.login-theme:hover {
    background: rgba(255,255,255,.12);
}

/* Tarjeta de ingreso: vidrio oscuro con borde rojo → azul y brillo de los dos colores. */
.login-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: 38px 38px 32px;
    border: 1px solid transparent;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(24,34,54,.92), rgba(11,17,29,.94)) padding-box, linear-gradient(135deg, rgba(243,21,58,.85), rgba(255,255,255,.08) 45%, rgba(42,120,214,.9)) border-box;
    box-shadow: 0 30px 80px rgba(0,0,0,.5), -24px -24px 70px rgba(243,21,58,.14), 24px 24px 70px rgba(42,120,214,.18);
    backdrop-filter: blur(10px);
}
/* Franja superior roja → azul, como el acento de las tarjetas del NOC. */
.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 38px;
    right: 38px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, #f3153a, #ff6a82 40%, #2a78d6);
}
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 26px;
}
.login-brand .brand-logo {
    width: 170px;
    height: auto;
}
.login-brand small {
    margin-top: 12px;
    color: #8fa0b8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.35px;
    text-transform: uppercase;
}
/* Barra tipo consola: módulo y hora de Costa Rica. */
.login-console {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 28px;
    padding: 9px 13px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    color: #e6ebf2;
    background: rgba(255,255,255,.04);
    font: 700 12px Manrope, sans-serif;
}
.login-console-dot {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: #f3153a;
    box-shadow: 0 0 0 4px rgba(243,21,58,.18), 0 0 12px rgba(243,21,58,.8);
    animation: nocBlink 1.6s ease-in-out infinite;
}
.login-console-clock {
    margin-left: auto;
    color: #8fa0b8;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.welcome-label {
    display: block;
    margin-bottom: 10px;
    color: #ff6a82;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
}
.login-card h2 {
    margin: 0;
    color: #fff;
    font: 800 36px/1.1 Manrope, sans-serif;
    letter-spacing: -1.4px;
}
.login-card > p {
    margin: 12px 0 28px;
    color: #aeb8c7;
    line-height: 1.7;
}
/* Botón principal en rojo Telecable, con brillo. */
.btn-microsoft {
    width: 100%;
    min-height: 58px;
    justify-content: flex-start;
    gap: 15px;
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, #f3153a 0%, #d10f30 60%, #b30d2a 100%);
    box-shadow: 0 14px 34px rgba(243,21,58,.35), inset 0 1px 0 rgba(255,255,255,.18);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-microsoft:hover {
    filter: brightness(1.08);
    box-shadow: 0 18px 40px rgba(243,21,58,.45), inset 0 1px 0 rgba(255,255,255,.22);
    transform: translateY(-2px);
}
.btn-microsoft:focus-visible {
    outline: 2px solid #5aa2ff;
    outline-offset: 3px;
}
.btn-microsoft > svg {
    width: 20px;
    margin-left: auto;
}
.btn-microsoft-label {
    font-size: 14px;
}
/* Mientras se va a Microsoft: rueda en lugar de la flecha, sin apagar el botón. */
.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    margin-left: auto;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loginSpin .8s linear infinite;
}
.btn-microsoft.is-loading {
    opacity: .9;
}
.btn-microsoft.is-loading .btn-spinner {
    display: block;
}
.btn-microsoft.is-loading .btn-arrow {
    display: none;
}
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(243,21,58,.4);
    color: #ffc2cc;
    background: rgba(243,21,58,.12);
    font-size: 13px;
    line-height: 1.5;
}
.login-alert svg {
    width: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
/* Logo de Microsoft sobre una ficha blanca para que se lea encima del rojo. */
.microsoft-mark {
    display: grid;
    grid-template-columns: repeat(2, 8px);
    gap: 2px;
    padding: 6px;
    border-radius: 7px;
    background: #fff;
}
.microsoft-mark i {
    width: 8px;
    height: 8px;
    background: #f35325;
}
.microsoft-mark i:nth-child(2) {
    background: #81bc06;
}
.microsoft-mark i:nth-child(3) {
    background: #05a6f0;
}
.microsoft-mark i:nth-child(4) {
    background: #ffba08;
}
/* Aviso de seguridad en azul. */
.login-security {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px solid rgba(42,120,214,.35);
    border-radius: 12px;
    color: #b9c4d4;
    background: rgba(42,120,214,.10);
    font-size: 13px;
    line-height: 1.55;
}
.login-security svg {
    width: 19px;
    flex: none;
    color: #5aa2ff;
}
.login-panel footer {
    position: absolute;
    right: 0;
    bottom: 24px;
    left: 0;
    color: #6f7d93;
    font-size: 12px;
    text-align: center;
}
@keyframes loginSpin {
    to {
        transform: rotate(360deg);
    }
}
@keyframes nocFlow {
    from {
        stroke-dashoffset: 230;
    }
    to {
        stroke-dashoffset: 0;
    }
}
@keyframes nocBroken {
    to {
        stroke-dashoffset: -24;
    }
}
@keyframes nocAlarm {
    0% {
        transform: scale(1);
        opacity: .9;
    }
    100% {
        transform: scale(3.6);
        opacity: 0;
    }
}
@keyframes nocBlink {
    50% {
        opacity: .25;
    }
}
@keyframes nocFloat {
    0%, 100% {
        translate: 0 0;
    }
    50% {
        translate: 0 -6px;
    }
}
/* Sin animaciones para quien las tiene desactivadas en el sistema. */
@media (prefers-reduced-motion: reduce) {
    .noc-links path.is-alarm, .noc-flow path, .noc-node.is-down .noc-ring, .noc-card, .noc-card-tag i, .login-console-dot {
        animation: none;
    }
    .noc-flow {
        display: none;
    }
}
/* En pantallas medianas las tarjetas no caben al lado de la red: queda solo la red. */
@media (max-width: 1280px) {
    .noc-stage {
        grid-template-columns: minmax(0, 1fr);
    }
    .noc-events {
        display: none;
    }
}
/* Pantallas bajas: la red se achica para que el texto de abajo siempre se vea. */
@media (max-height: 800px) {
    .noc-stage {
        min-height: 200px;
    }
    .noc-map {
        max-width: 380px;
    }
    .visual-copy h1 {
        font-size: clamp(28px, 3vw, 42px);
    }
}
@media (max-width: 900px) {
    .login-page {
        grid-template-columns: 1fr;
    }
    .login-visual {
        display: none;
    }
    .login-panel {
        min-height: 100vh;
        padding: 70px 24px 60px;
    }
    .login-card {
        padding: 30px 22px 26px;
    }
    .login-card::before {
        left: 22px;
        right: 22px;
    }
}
