/* ============================================================
   LOGIN METRÍA — BLUEPRINT OSCURO + PANEL BLANCO NEÓN
============================================================ */

:root {
    color-scheme: dark;
}

/* ============================================================
   1) FONDO BLUEPRINT OSCURO
============================================================ */
body {
    margin: 0;
    padding: 0;
    font-family: "Inter", sans-serif;

    background: radial-gradient(circle at top left, #0d1b2a 0%, #0a1522 40%, #050910 100%);
    height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;
    position: relative;
}

/* Grid blueprint */
body::before {
    content: "";
    position: absolute;
    inset: 0;

    background-image:
        linear-gradient(#1b2e47 1px, transparent 1px),
        linear-gradient(90deg, #1b2e47 1px, transparent 1px);
    background-size: 26px 26px;

    opacity: 0.35;
    z-index: 0;
}

/* Líneas técnicas animadas */
body::after {
    content: "";
    position: absolute;
    inset: 0;

    background-image:
        linear-gradient(135deg, rgba(0, 180, 255, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(0, 180, 255, 0.35), transparent 55%);
    mix-blend-mode: screen;

    animation: blueprintGlow 8s ease-in-out infinite alternate;
    z-index: 0;
}

/* ============================================================
   2) CONTENEDOR PRINCIPAL
============================================================ */
.container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;

    position: relative;
    z-index: 2;
}

/* ============================================================
   3) LOGIN-BOX — PANEL BLANCO NEÓN
============================================================ */
.login-box {
    background: #0f2235;
    backdrop-filter: blur(14px);

    padding: 40px;
    width: 360px;

    border-radius: 20px;
    border: 1px solid rgba(0, 180, 255, 0.55);
    /* neón suave */
    box-shadow:
        0 0 0 1px rgba(0, 180, 255, 0.35),
        0 18px 40px rgba(0, 0, 0, 0.45);

    position: relative;
    text-align: center;

    animation: panelIn 0.9s ease-out forwards;
}

/* Esquinas blueprint claras */
.login-box::before,
.login-box::after {
    content: "";
    position: absolute;
    width: 60px;
    height: 60px;
    border: 1px solid rgba(0, 180, 255, 0.55);
    border-radius: 12px;
    opacity: 0.55;
}

.login-box::before {
    top: -18px;
    left: -18px;
    border-right: none;
    border-bottom: none;
}

.login-box::after {
    bottom: -18px;
    right: -18px;
    border-left: none;
    border-top: none;
}

/* Coordenadas neón */
.login-box::after {
    content: "X: 240 | Y: 180";
    font-size: 10px;
    color: rgba(0, 200, 255, 0.85);
    /* neón brillante */
    position: absolute;
    bottom: -26px;
    right: 4px;
}

/* ============================================================
   4) LOGO METRÍA — TRAZO NEÓN
============================================================ */
.metria-title {
    font-family: "Orbitron", sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: #8bdcff;
    letter-spacing: 4px;

    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.metria-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(14px) scale(0.9);
    border-bottom: 1px solid rgba(0, 180, 255, 0.55);
    padding-bottom: 4px;

    animation: logoDraw 0.6s ease-out forwards;
}

.metria-title span:nth-child(1) {
    animation-delay: 0.05s;
}

.metria-title span:nth-child(2) {
    animation-delay: 0.10s;
}

.metria-title span:nth-child(3) {
    animation-delay: 0.15s;
}

.metria-title span:nth-child(4) {
    animation-delay: 0.20s;
}

.metria-title span:nth-child(5) {
    animation-delay: 0.25s;
}

.metria-title span:nth-child(6) {
    animation-delay: 0.30s;
}

/* Mini texto técnico */
.metria-sub {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: #8bbbd6;
    margin-bottom: 22px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 1.2s ease-out forwards;
}

/* ============================================================
   5) INPUTS — PANEL TÉCNICO SOBRIO
============================================================ */

.input-group {
    margin-bottom: 18px;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

.input-group label {
    display: block;
    margin-bottom: 6px;

    font-size: 13px;
    font-weight: 600;
    color: #d7e5f2;
    letter-spacing: 0.3px;
}

.input-group input {
    width: 100%;
    padding: 10px 12px;

    font-size: 14px;
    color: #e8f4ff;

    background: #102b43;
    border: 1px solid #52758f;
    border-radius: 8px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;

    box-sizing: border-box;
}

.input-group input:hover {
    border-color: #79b4d5;
}

.input-group input:focus {
    border-color: #8bdcff;
    background: #143552;
    box-shadow: 0 0 0 3px rgba(139, 220, 255, 0.18);
    outline: none;
}

/* ============================================================
   6) BOTONES
============================================================ */

.btn,
.btn-secundario {

    width: 100%;
    padding: 11px;

    border-radius: 9px;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    display: block;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;

    transition:
        background 0.22s ease,
        border-color 0.22s ease,
        color 0.22s ease,
        transform 0.22s ease,
        box-shadow 0.22s ease;
}


/* ============================================================
   BOTÓN PRINCIPAL
============================================================ */

.btn {

    background: linear-gradient(135deg,
            #1f9dff,
            #0a5fb8);

    border: 1px solid #0a5fb8;

    color: #ffffff;

}


.btn:hover {

    background: linear-gradient(135deg,
            #37a9ff,
            #0f6fd0);

    transform: translateY(-1px);

    box-shadow:
        0 4px 10px rgba(30, 58, 95, 0.20);

}


/* ============================================================
   BOTÓN SECUNDARIO
   Complementario del principal
============================================================ */

.btn-secundario {

    margin-top: 10px;

    background: #173752;
    border: 1px solid #527d9d;

    color: #a9ddf5;

    box-shadow:
        0 2px 6px rgba(30, 58, 95, 0.08);

}


.btn-secundario:hover {

    background: #214866;
    border-color: #8bdcff;

    color: #d8f3ff;

    transform: translateY(-1px);

    box-shadow:
        0 4px 10px rgba(30, 58, 95, 0.15);

}

/* El modo claro solo se activa cuando el sistema o la preferencia guardada lo indican. */
@media (prefers-color-scheme: light) {
    html:not([data-theme="dark"]) {
        color-scheme: light;
    }

    html:not([data-theme="dark"]) .login-box {
        background: #ffffff;
    }

    html:not([data-theme="dark"]) .metria-title {
        color: #003f7f;
    }

    html:not([data-theme="dark"]) .metria-sub {
        color: #4a7fb8;
    }

    html:not([data-theme="dark"]) .input-group label {
        color: #334155;
    }

    html:not([data-theme="dark"]) .input-group input {
        color: #1e293b;
        background: #ffffff;
        border-color: #cbd5e1;
    }

    html:not([data-theme="dark"]) .input-group input:hover {
        border-color: #94a3b8;
    }

    html:not([data-theme="dark"]) .input-group input:focus {
        border-color: #475569;
        background: #ffffff;
        box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.15);
    }

    html:not([data-theme="dark"]) .btn-secundario {
        background: #f3f8fc;
        border-color: #8fb6d3;
        color: #0a5f8f;
    }

    html:not([data-theme="dark"]) .btn-secundario:hover {
        background: #e7f1f8;
        border-color: #5f94b8;
        color: #084d73;
    }
}

html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="light"] .login-box {
    background: #ffffff;
}

html[data-theme="light"] .metria-title {
    color: #003f7f;
}

html[data-theme="light"] .metria-sub {
    color: #4a7fb8;
}

html[data-theme="light"] .input-group label {
    color: #334155;
}

html[data-theme="light"] .input-group input {
    color: #1e293b;
    background: #ffffff;
    border-color: #cbd5e1;
}

html[data-theme="light"] .btn-secundario {
    background: #f3f8fc;
    border-color: #8fb6d3;
    color: #0a5f8f;
}

@media (max-width: 768px) {
    body {
        padding: 20px;
    }

    .login-box {
        width: min(100%, 360px);
        padding: 28px 22px;
    }

    .metria-title {
        font-size: 26px;
        letter-spacing: 2.5px;
    }
}

@media (max-width: 420px) {
    body {
        padding: 16px;
    }

    .login-box {
        padding: 22px 18px;
        border-radius: 16px;
    }

    .metria-title {
        font-size: 22px;
        letter-spacing: 2px;
    }

    .metria-sub {
        letter-spacing: 1px;
    }
}

/* ============================================================
   7) ANIMACIONES
============================================================ */
@keyframes blueprintGlow {
    0% {
        opacity: 0.7;
        transform: translateX(0);
    }

    100% {
        opacity: 1;
        transform: translateX(12px);
    }
}

@keyframes panelIn {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes logoDraw {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.9);
    }

    60% {
        opacity: 1;
        transform: translateY(-3px) scale(1.03);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ============================================================
   8) PULSO NEÓN TÉCNICO — VERSIÓN VISIBLE
============================================================ */

.login-box {
    animation: panelIn 0.9s ease-out forwards,
        neonPulse 2.8s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    0% {
        box-shadow:
            0 0 0 1px rgba(0, 180, 255, 0.45),
            0 0 10px rgba(0, 200, 255, 0.35),
            0 18px 40px rgba(0, 0, 0, 0.45);
        border-color: rgba(0, 180, 255, 0.65);
        transform: scale(1);
    }

    100% {
        box-shadow:
            0 0 0 1px rgba(0, 200, 255, 0.85),
            0 0 22px rgba(0, 200, 255, 0.75),
            0 18px 40px rgba(0, 0, 0, 0.45);
        border-color: rgba(0, 200, 255, 1);
        transform: scale(1.012);
    }
}