:root {
    --afi-blue: #2779F1;
    --afi-blue-dark: #1558C8;
    --afi-cyan: #32D7F5;
    --afi-navy: #082B63;
    --afi-navy-soft: #123B78;
    --afi-white: #FFFFFF;
    --afi-bg: #F4F8FC;
    --afi-border: #DDE7F3;
    --afi-muted: #64748B;
    --afi-shadow: 0 28px 90px rgba(8, 43, 99, .16);
}

body.app-body,
body.login-body,
body.posisa-login-body {
    padding-bottom: 42px;
}

/* =========================================================
   BRANDING EMPRESA / POS-ISA
========================================================= */

.company-brand-card {
    display: flex;
    gap: 18px;
    align-items: center;
    background:
        radial-gradient(circle at top left, rgba(50, 215, 245, .16), transparent 32%),
        linear-gradient(135deg, rgba(39, 121, 241, .10), rgba(50, 215, 245, .13));
    border: 1px solid rgba(39, 121, 241, .20);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 22px;
    box-shadow: 0 16px 45px rgba(8, 43, 99, .08);
}

.company-brand-card img,
.company-logo-preview,
.login-company-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #E2E8F0;
    padding: 8px;
    box-shadow: 0 14px 34px rgba(8, 43, 99, .10);
    filter: contrast(1.10) saturate(1.14);
}

.company-chip {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-right: 14px;
    padding: 8px 12px;
    border-radius: 18px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    box-shadow: 0 8px 24px rgba(8, 43, 99, .06);
}

.company-chip img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    filter: contrast(1.10) saturate(1.14);
}

.posisa-fixed-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.posisa-fixed-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: contrast(1.14) saturate(1.18);
}

.sidebar-brand img {
    width: 50px !important;
    height: 50px !important;
    object-fit: contain;
    filter: contrast(1.14) saturate(1.18);
}

.sidebar-brand span {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--afi-navy);
}

.dash-logo-box {
    width: 112px !important;
    height: 112px !important;
}

.dash-logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: contrast(1.10) saturate(1.15);
}

/* =========================================================
   FOOTER FIJO AFI
========================================================= */

.afi-fixed-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    color: #082B63;
    border-top: 1px solid #DDE7F3;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    box-shadow: 0 -8px 28px rgba(8, 43, 99, .06);
}

/* =========================================================
   SISTEMA / CONFIGURACIÓN
========================================================= */

.system-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 26px 0 14px;
    color: #082B63;
    font-size: 18px;
    font-weight: 900;
}

.system-section-title::before {
    content: "";
    width: 7px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--afi-blue), var(--afi-cyan));
    box-shadow: 0 8px 18px rgba(39, 121, 241, .30);
}

.siigo-flow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 18px 0;
}

.siigo-step {
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(8, 43, 99, .06);
}

.siigo-step strong {
    display: block;
    color: var(--afi-navy);
    margin-bottom: 6px;
}

/* =========================================================
   LOGIN PRO V3 - CLASES ÚNICAS SIN CHOQUES
========================================================= */

.posisa-login-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 10% 10%, rgba(50, 215, 245, .28), transparent 25%),
        radial-gradient(circle at 90% 85%, rgba(39, 121, 241, .16), transparent 25%),
        linear-gradient(135deg, #F7FBFF 0%, #EEF5FC 50%, #F8FBFF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    position: relative;
    overflow: hidden;
    padding: 24px;
    box-sizing: border-box;
}

.posisa-login-body::before {
    content: "";
    position: absolute;
    width: 540px;
    height: 540px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(39, 121, 241, .14), rgba(50, 215, 245, .10));
    top: -240px;
    left: -210px;
    filter: blur(2px);
}

.posisa-login-body::after {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(50, 215, 245, .13), rgba(39, 121, 241, .10));
    right: -220px;
    bottom: -240px;
    filter: blur(2px);
}

.posisa-login-shell {
    width: min(1180px, calc(100vw - 48px));
    min-height: 680px;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(430px, .92fr);
    border-radius: 34px;
    overflow: hidden;
    background: rgba(255, 255, 255, .95);
    border: 1px solid rgba(221, 231, 243, .96);
    box-shadow: 0 34px 95px rgba(8, 43, 99, .16);
    backdrop-filter: blur(14px);
    position: relative;
    z-index: 2;
}

.posisa-login-showcase {
    position: relative;
    min-width: 0;
    padding: 56px 48px;
    background:
        radial-gradient(circle at 18% 18%, rgba(50, 215, 245, .26), transparent 30%),
        radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .10), transparent 22%),
        linear-gradient(145deg, #062457 0%, #0B3574 43%, #2779F1 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.posisa-login-showcase::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    top: -90px;
    right: -90px;
}

.posisa-login-showcase::after {
    content: "";
    position: absolute;
    width: 210px;
    height: 210px;
    border-radius: 999px;
    background: rgba(50, 215, 245, .14);
    bottom: -60px;
    left: -40px;
}

.posisa-login-showcase-content {
    position: relative;
    z-index: 2;
    max-width: 560px;
}

.posisa-login-main-logo {
    width: 148px;
    height: 148px;
    object-fit: contain;
    margin-bottom: 18px;
    filter: contrast(1.25) saturate(1.28) drop-shadow(0 18px 30px rgba(0, 0, 0, .18));
}

.posisa-login-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .15);
    color: rgba(255, 255, 255, .92);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 18px;
}

.posisa-login-showcase h1 {
    margin: 0 0 12px;
    font-size: clamp(42px, 5vw, 58px);
    line-height: 1.02;
    font-weight: 950;
    letter-spacing: -0.055em;
    color: #FFFFFF;
}

.posisa-login-showcase p {
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .90);
    max-width: 540px;
}

.posisa-login-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 24px;
}

.posisa-login-feature {
    background: rgba(255, 255, 255, .11);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 18px;
    padding: 15px 16px;
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
}

.posisa-login-feature strong {
    display: block;
    font-size: 15px;
    margin-bottom: 5px;
    font-weight: 950;
    color: #FFFFFF;
}

.posisa-login-feature span {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, .86);
    line-height: 1.45;
}

.posisa-login-note {
    margin-top: 24px;
    padding: 17px 18px 17px 24px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .15);
    color: rgba(255, 255, 255, .93);
    position: relative;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 750;
}

.posisa-login-note::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--afi-cyan), #FFFFFF);
}

.posisa-login-panel {
    min-width: 0;
    background: #FFFFFF;
    padding: 56px 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.posisa-login-formbox {
    width: min(420px, 100%);
}

.posisa-login-company {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.posisa-login-company-logo {
    width: 112px;
    height: 112px;
    object-fit: contain;
    border-radius: 24px;
    background: #FFFFFF;
    border: 1px solid #DDE7F3;
    padding: 9px;
    box-shadow: 0 16px 38px rgba(8, 43, 99, .10);
    filter: contrast(1.16) saturate(1.18);
}

.posisa-login-company-placeholder {
    width: 112px;
    height: 112px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--afi-blue), var(--afi-cyan));
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 950;
    box-shadow: 0 16px 38px rgba(39, 121, 241, .22);
}

.posisa-login-panel h2 {
    color: var(--afi-navy);
    margin: 0 0 10px;
    font-size: 38px;
    line-height: 1.08;
    text-align: center;
    font-weight: 950;
    letter-spacing: -0.045em;
}

.posisa-login-panel p {
    color: #5E718C;
    margin: 0 0 28px;
    text-align: center;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.5;
}

.posisa-login-panel .alert {
    margin-bottom: 18px;
}

.posisa-login-panel .form-group {
    margin-bottom: 17px;
}

.posisa-login-panel label {
    display: block;
    color: var(--afi-navy);
    font-weight: 900;
    font-size: 14px;
    margin-bottom: 8px;
}

.posisa-login-panel input {
    width: 100%;
    box-sizing: border-box;
    min-height: 54px;
    border-radius: 16px;
    border: 1px solid #D8E4F2;
    background: #FFFFFF;
    color: #0F172A;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 650;
    outline: none;
    transition: .22s ease;
}

.posisa-login-panel input:focus {
    border-color: var(--afi-blue);
    box-shadow:
        0 0 0 4px rgba(39, 121, 241, .14),
        0 10px 24px rgba(39, 121, 241, .10);
}

.posisa-login-panel .btn,
.posisa-login-panel button {
    width: 100%;
    min-height: 54px;
    border-radius: 17px;
    font-weight: 950;
    letter-spacing: .01em;
    box-shadow: 0 16px 36px rgba(39, 121, 241, .24);
    cursor: pointer;
    transition: .22s ease;
}

.posisa-login-panel .btn-primary,
.posisa-login-panel button.btn-primary {
    background: linear-gradient(135deg, var(--afi-blue), var(--afi-cyan));
    border: none;
    color: #FFFFFF;
}

.posisa-login-panel .btn-primary:hover,
.posisa-login-panel button.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 42px rgba(39, 121, 241, .30);
}

.posisa-login-mini-footer {
    margin-top: 18px;
    text-align: center;
    color: #7B8CA5;
    font-size: 12px;
    font-weight: 750;
}

/* Mantiene compatibilidad si quedó alguna clase vieja en otro archivo */
.login-card,
.login-wrapper,
.login-showcase {
    box-sizing: border-box;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1080px) {
    .posisa-login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .posisa-login-showcase {
        padding: 42px 34px;
    }

    .posisa-login-main-logo {
        width: 118px;
        height: 118px;
    }

    .posisa-login-panel {
        padding: 42px 34px;
    }
}

@media (max-width: 900px) {
    .siigo-flow {
        grid-template-columns: 1fr;
    }

    .company-chip {
        display: none;
    }

    .posisa-fixed-brand img {
        width: 44px;
        height: 44px;
    }

    .sidebar-brand img {
        width: 44px !important;
        height: 44px !important;
    }
}

@media (max-width: 620px) {
    .posisa-login-body {
        padding: 14px;
        align-items: flex-start;
        overflow-y: auto;
    }

    .posisa-login-shell {
        width: 100%;
        border-radius: 26px;
        margin-top: 14px;
        margin-bottom: 44px;
    }

    .posisa-login-showcase {
        padding: 34px 24px;
    }

    .posisa-login-showcase h1 {
        font-size: 40px;
    }

    .posisa-login-showcase p {
        font-size: 14px;
    }

    .posisa-login-features {
        grid-template-columns: 1fr;
    }

    .posisa-login-panel {
        padding: 34px 24px;
    }

    .posisa-login-company-logo,
    .posisa-login-company-placeholder {
        width: 96px;
        height: 96px;
    }

    .posisa-login-panel h2 {
        font-size: 32px;
    }

    .company-brand-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .company-brand-card img,
    .company-logo-preview {
        width: 86px;
        height: 86px;
    }

    .afi-fixed-footer {
        height: 34px;
        font-size: 10px;
        padding: 0 10px;
        text-align: center;
    }
}

@media print {
    .afi-fixed-footer,
    .sidebar,
    .topbar,
    .no-print,
    .print-actions {
        display: none !important;
    }

    body.app-body {
        padding-bottom: 0;
    }
}
