:root {
    --primary: #2563eb;
    --primary-2: #4f46e5;
    --primary-soft: rgba(37, 99, 235, 0.10);

    --bg-1: #07111f;
    --bg-2: #0b1730;

    --surface: rgba(255, 255, 255, 0.08);
    --surface-2: rgba(255, 255, 255, 0.12);

    --text: #f8fafc;
    --muted: #a9b4c7;

    --border: rgba(255, 255, 255, 0.10);

    --shadow:
        0 30px 80px
        rgba(0, 0, 0, 0.30);
}

body {
    background:
        radial-gradient(
            circle at top left,
            #13254b 0%,
            transparent 38%
        ),
        radial-gradient(
            circle at bottom right,
            #172554 0%,
            transparent 42%
        ),
        linear-gradient(
            135deg,
            var(--bg-1),
            var(--bg-2)
        );

    color: var(--text);
}


/* =========================
   GENERAL
========================= */

.login-page {
    min-height: 100vh;

    position: relative;

    overflow: hidden;

    display: flex;

    align-items: center;

    justify-content: center;

    padding:
        36px
        22px;
}

.shell {
    width: 100%;

    max-width: 1180px;

    position: relative;

    z-index: 2;
}


/* =========================
   AMBIENTE
========================= */

.ambient {
    position: absolute;

    border-radius: 50%;

    filter: blur(70px);

    opacity: 0.45;

    pointer-events: none;
}

.ambient-1 {
    width: 340px;
    height: 340px;

    background: #2563eb;

    top: -120px;
    left: -100px;
}

.ambient-2 {
    width: 430px;
    height: 430px;

    background: #7c3aed;

    right: -160px;
    bottom: -170px;
}

.ambient-3 {
    width: 250px;
    height: 250px;

    background: #0ea5e9;

    top: 40%;
    left: 45%;

    opacity: 0.18;
}


/* =========================
   BRAND
========================= */

.brand {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 22px;

    margin-bottom: 34px;
}

.brand-logo {
    width: 92px;
    height: 92px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 26px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.16),
            rgba(255, 255, 255, 0.06)
        );

    border:
        1px solid
        rgba(255, 255, 255, 0.14);

    backdrop-filter: blur(18px);

    box-shadow:
        0 16px 50px
        rgba(0, 0, 0, 0.25);
}

.brand-logo img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    padding: 14px;
}

.brand-logo-fallback {
    font-size: 40px;

    font-weight: 900;

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #9ec5ff
        );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}

.brand-text {
    max-width: 650px;
}

.brand-system {
    display: inline-block;

    margin-bottom: 5px;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 4px;

    color: #8bb7ff;
}

.brand-text h1 {
    font-size:
        clamp(
            30px,
            4vw,
            46px
        );

    line-height: 1.05;

    margin-bottom: 8px;
}

.brand-text p {
    color: var(--muted);

    font-size: 16px;

    line-height: 1.6;
}


/* =========================
   TARJETA
========================= */

.main-card {
    width: 100%;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,0.10),
            rgba(255,255,255,0.055)
        );

    border:
        1px solid
        rgba(255,255,255,0.10);

    backdrop-filter:
        blur(24px);

    border-radius: 34px;

    padding:
        44px
        clamp(24px, 5vw, 60px);

    box-shadow:
        var(--shadow);

    overflow: hidden;
}


/* =========================
   VISTAS
========================= */

.view {
    display: none;
}

.view.active {
    display: block;

    animation:
        fadeUp
        0.45s ease;
}


/* =========================
   INTRO
========================= */

.intro {
    text-align: center;

    margin-bottom: 38px;
}

.eyebrow {
    display: inline-flex;

    align-items: center;

    padding:
        8px
        13px;

    margin-bottom: 14px;

    border-radius: 999px;

    background:
        rgba(96, 165, 250, 0.10);

    border:
        1px solid
        rgba(96, 165, 250, 0.20);

    color: #9ec5ff;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 2px;
}

.intro h2 {
    font-size:
        clamp(
            28px,
            4vw,
            40px
        );

    margin-bottom: 8px;
}

.intro p {
    color: var(--muted);

    font-size: 15px;
}


/* =========================
   ROLES
========================= */

.roles {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap:
        clamp(
            20px,
            3vw,
            34px
        );

    max-width: 900px;

    margin: 0 auto;
}

.role-option {
    border: none;

    background: transparent;

    color: inherit;

    display: flex;

    flex-direction: column;

    align-items: center;

    text-align: center;

    padding:
        22px
        14px;

    border-radius: 28px;

    transition:
        transform 0.25s ease,
        background 0.25s ease;
}

.role-option:hover {
    transform:
        translateY(-8px);

    background:
        rgba(255,255,255,0.045);
}

.role-orbit {
    width: 160px;
    height: 160px;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    position: relative;

    background:
        radial-gradient(
            circle at 30% 25%,
            rgba(255,255,255,0.15),
            rgba(255,255,255,0.04)
        );

    border:
        1px solid
        rgba(255,255,255,0.12);

    box-shadow:
        inset
        0 0 30px
        rgba(255,255,255,0.03),
        0 20px 55px
        rgba(0,0,0,0.22);

    transition:
        transform 0.3s ease,
        border 0.3s ease,
        box-shadow 0.3s ease;
}

.role-orbit::before {
    content: "";

    position: absolute;

    inset: 10px;

    border-radius: 50%;

    border:
        1px solid
        rgba(96,165,250,0.14);
}

.role-orbit::after {
    content: "";

    position: absolute;

    inset: -1px;

    border-radius: 50%;

    background:
        conic-gradient(
            from 180deg,
            transparent,
            rgba(96,165,250,0.35),
            transparent 35%
        );

    opacity: 0;

    transition:
        opacity 0.3s ease;
}

.role-option:hover .role-orbit {
    transform:
        scale(1.05);

    border-color:
        rgba(96,165,250,0.35);

    box-shadow:
        0 24px 60px
        rgba(37,99,235,0.22);
}

.role-option:hover .role-orbit::after {
    opacity: 1;
}

.role-icon {
    width: 72px;
    height: 72px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 22px;

    background:
        linear-gradient(
            135deg,
            rgba(37,99,235,0.28),
            rgba(79,70,229,0.24)
        );

    position: relative;

    z-index: 2;

    color: #cfe1ff;
}

.role-icon svg {
    width: 34px;
    height: 34px;

    stroke-width: 1.8;
}

.role-option strong {
    display: block;

    margin-top: 18px;

    font-size: 19px;
}

.role-option > span {
    display: block;

    margin-top: 5px;

    max-width: 200px;

    color: var(--muted);

    font-size: 12px;

    line-height: 1.5;
}


/* =========================
   LOGIN
========================= */

.login-top {
    max-width: 470px;

    margin:
        0 auto
        24px;
}

.back-button {
    display: inline-flex;

    align-items: center;

    gap: 7px;

    border: none;

    background: transparent;

    color: var(--muted);

    padding: 0;

    margin-bottom: 26px;

    font-size: 13px;

    font-weight: 600;
}

.back-button svg {
    width: 17px;
}

.back-button:hover {
    color: white;
}

.selected-profile {
    display: flex;

    align-items: center;

    gap: 14px;
}

.selected-profile-icon {
    width: 58px;
    height: 58px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 18px;

    background:
        rgba(96,165,250,0.10);

    border:
        1px solid
        rgba(96,165,250,0.17);

    color: #b9d6ff;
}

.selected-profile-icon svg {
    width: 26px;
    height: 26px;
}

.selected-profile span {
    display: block;

    color: var(--muted);

    font-size: 12px;

    margin-bottom: 2px;
}

.selected-profile h3 {
    font-size: 22px;
}


/* =========================
   FORM
========================= */

.login-form {
    max-width: 470px;

    margin: 0 auto;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;

    margin-bottom: 8px;

    font-size: 13px;

    font-weight: 700;
}

.field-control {
    position: relative;

    display: flex;

    align-items: center;
}

.field-control > svg {
    position: absolute;

    left: 14px;

    width: 18px;
    height: 18px;

    color: #72819a;

    pointer-events: none;
}

.field-control input {
    width: 100%;

    height: 52px;

    padding:
        0
        68px
        0
        45px;

    border:
        1px solid
        rgba(255,255,255,0.10);

    border-radius: 14px;

    background:
        rgba(255,255,255,0.055);

    color: white;

    outline: none;

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

.field-control input::placeholder {
    color: #718096;
}

.field-control input:focus {
    border-color:
        rgba(96,165,250,0.45);

    background:
        rgba(255,255,255,0.075);

    box-shadow:
        0 0 0 4px
        rgba(37,99,235,0.10);
}

.password-button {
    position: absolute;

    right: 13px;

    border: none;

    background: transparent;

    color: #a9c9ff;

    font-size: 12px;

    font-weight: 700;
}

.login-message {
    min-height: 18px;

    margin-bottom: 10px;

    color: #fca5a5;

    font-size: 12px;
}

.primary-button {
    width: 100%;

    height: 52px;

    border: none;

    border-radius: 14px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 9px;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #4f46e5
        );

    color: white;

    font-size: 14px;

    font-weight: 800;

    box-shadow:
        0 14px 30px
        rgba(37,99,235,0.28);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.primary-button svg {
    width: 18px;
}

.primary-button:hover {
    transform:
        translateY(-2px);

    box-shadow:
        0 18px 38px
        rgba(37,99,235,0.34);
}

.forgot-button {
    width: 100%;

    margin-top: 15px;

    border: none;

    background: transparent;

    color: #a9c9ff;

    font-size: 12px;

    font-weight: 600;
}

.security-note {
    max-width: 470px;

    margin:
        25px auto
        0;

    padding-top: 19px;

    border-top:
        1px solid
        rgba(255,255,255,0.08);

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    color: #7f8da3;

    font-size: 11px;
}

.security-note svg {
    width: 15px;
}


/* =========================
   FOOTER
========================= */

.footer {
    display: flex;

    justify-content: center;

    align-items: center;

    flex-wrap: wrap;

    gap: 6px;

    margin-top: 28px;

    color: #718096;

    font-size: 11px;
}

.footer strong {
    color: #a9c9ff;
}

.footer-dot {
    color: #475569;
}


/* =========================
   ANIMACIÓN
========================= */

@keyframes fadeUp {

    from {
        opacity: 0;

        transform:
            translateY(18px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }

}


/* =========================
   TABLET
========================= */

@media (max-width: 820px) {

    .brand {
        flex-direction: column;

        text-align: center;
    }

    .roles {
        grid-template-columns:
            repeat(3, 1fr);
    }

    .role-orbit {
        width: 125px;
        height: 125px;
    }

    .role-icon {
        width: 60px;
        height: 60px;
    }

}


/* =========================
   CELULAR
========================= */

@media (max-width: 620px) {

    .login-page {
        padding:
            24px
            12px;
    }

    .brand {
        margin-bottom: 24px;
    }

    .brand-logo {
        width: 76px;
        height: 76px;

        border-radius: 22px;
    }

    .brand-text h1 {
        font-size: 29px;
    }

    .brand-text p {
        font-size: 14px;
    }

    .main-card {
        padding:
            28px
            14px;

        border-radius: 26px;
    }

    .intro {
        margin-bottom: 26px;
    }

    .roles {
        grid-template-columns:
            repeat(3, 1fr);

        gap: 6px;
    }

    .role-option {
        padding:
            12px
            2px;
    }

    .role-orbit {
        width: 90px;
        height: 90px;
    }

    .role-icon {
        width: 47px;
        height: 47px;

        border-radius: 15px;
    }

    .role-icon svg {
        width: 24px;
        height: 24px;
    }

    .role-option strong {
        margin-top: 11px;

        font-size: 13px;
    }

    .role-option > span {
        display: none;
    }

    .login-top,
    .login-form,
    .security-note {
        max-width: 100%;
    }

}

/* ---------- seguridad: código 2FA y equipo por aprobar ---------- */
.field-ayuda { display: block; margin-top: 6px; font-size: 12px; color: #93a3bd; line-height: 1.4; }

.equipo-aviso {
    margin-top: 4px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.10);
    color: #fde68a;
    font-size: 13px;
    line-height: 1.5;
}
.equipo-aviso.bloqueado { border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.10); color: #fecaca; }
.equipo-aviso b { color: #fff; }
.equipo-aviso .equipo-codigo {
    display: block;
    margin: 8px 0;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 3px;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.equipo-aviso button {
    margin-top: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.equipo-aviso button:hover { background: rgba(255, 255, 255, 0.08); }