﻿
:root {
    --navy: #012187;
    --navy-mid: #0036DC;
    --navy-light: #1E50DC;
    --teal: #1D9E75;
    --teal-light: #E1F5EE;
    --red: #E24B4A;
    --red-light: #FCEBEB;
    --gray-100: #F1F3F5;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gray-700: #616569;
    --gray-900: #212529;
    --white: #FFFFFF;
    --radius: 16px;
    --radius-sm: 8px;
    --shadow-md: 0px 12px 24px 0px #BFCDF6;
    --font: 'Montserrat', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: #F0F4FF;
    min-height: 100vh;
    display: flex;
    font-size: 14px;
    color: var(--gray-900);
}

/* ── PANEL IZQUIERDO ── */
.side-brand {
    width: 420px;
    flex-shrink: 0;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 44px;
    position: relative;
    overflow: hidden;
}

    .side-brand::before {
        content: '';
        position: absolute;
        width: 480px;
        height: 480px;
        border-radius: 50%;
        background: rgba(255,255,255,0.04);
        top: -120px;
        right: -160px;
        pointer-events: none;
    }

    .side-brand::after {
        content: '';
        position: absolute;
        width: 300px;
        height: 300px;
        border-radius: 50%;
        background: rgba(255,255,255,0.04);
        bottom: -80px;
        left: -80px;
        pointer-events: none;
    }

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .brand-logo .icon {
        width: 42px;
        height: 42px;
        background: var(--navy-mid);
        border-radius: 10px;
        border: 1.5px solid rgba(255,255,255,0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

        .brand-logo .icon svg {
            width: 22px;
            height: 22px;
            fill: var(--white);
        }

    .brand-logo .text-wrap .name {
        font-size: 16px;
        font-weight: 800;
        color: var(--white);
        letter-spacing: 0.04em;
        text-transform: uppercase;
        line-height: 1.1;
    }

    .brand-logo .text-wrap .sub {
        font-size: 11px;
        color: rgba(255,255,255,0.45);
        font-weight: 400;
        margin-top: 2px;
    }

.brand-hero {
    position: relative;
    z-index: 1;
}

    .brand-hero .eyebrow {
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: rgba(255,255,255,0.4);
        margin-bottom: 14px;
    }

    .brand-hero h1 {
        font-size: 28px;
        font-weight: 800;
        color: var(--white);
        line-height: 1.25;
        margin-bottom: 16px;
    }

        .brand-hero h1 span {
            color: rgba(255,255,255,0.45);
            font-weight: 400;
        }

    .brand-hero p {
        font-size: 13px;
        color: rgba(255,255,255,0.5);
        line-height: 1.6;
    }

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 28px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

    .feature-item .dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--navy-mid);
        border: 1.5px solid rgba(255,255,255,0.3);
        flex-shrink: 0;
    }

.brand-footer {
    font-size: 11px;
    color: rgba(255,255,255,0.25);
    position: relative;
    z-index: 1;
}

/* ── PANEL DERECHO (FORMULARIO) ── */
.side-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.login-box {
    width: 100%;
    max-width: 420px;
}

    .login-box .heading {
        font-size: 22px;
        font-weight: 800;
        color: var(--navy);
        margin-bottom: 4px;
    }

    .login-box .subheading {
        font-size: 13px;
        color: var(--gray-500);
        margin-bottom: 32px;
    }

/* Alerta de error */
.alert-error {
    display: none;
    align-items: flex-start;
    gap: 10px;
    background: var(--red-light);
    border: 1px solid rgba(226,75,74,0.25);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--red);
}

    .alert-error.show {
        display: flex;
    }

    .alert-error svg {
        flex-shrink: 0;
        margin-top: 1px;
    }

/* Form */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

label {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.input-wrap {
    position: relative;
}

    .input-wrap .input-icon {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--gray-500);
        pointer-events: none;
        display: flex;
    }

    .input-wrap input {
        width: 100%;
        padding: 11px 12px 11px 38px;
        border: 1.5px solid var(--gray-300);
        border-radius: var(--radius-sm);
        font-family: var(--font);
        font-size: 13.5px;
        color: var(--gray-900);
        background: var(--white);
        outline: none;
        transition: border 0.15s, box-shadow 0.15s;
    }

        .input-wrap input:focus {
            border-color: var(--navy-mid);
            box-shadow: 0 0 0 3px rgba(0,54,220,0.1);
        }

        .input-wrap input.error {
            border-color: var(--red);
            box-shadow: 0 0 0 3px rgba(226,75,74,0.1);
        }

    .input-wrap .toggle-pw {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        cursor: pointer;
        color: var(--gray-500);
        padding: 2px;
        display: flex;
        transition: color 0.15s;
    }

        .input-wrap .toggle-pw:hover {
            color: var(--gray-700);
        }

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    margin-top: -4px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 500;
    user-select: none;
}

    .remember-me input[type="checkbox"] {
        width: 15px;
        height: 15px;
        accent-color: var(--navy-mid);
        cursor: pointer;
        flex-shrink: 0;
    }

.link-forgot {
    font-size: 12px;
    color: var(--navy-mid);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font);
}

    .link-forgot:hover {
        text-decoration: underline;
    }

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--navy-mid);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: 0.01em;
}

    .btn-login:hover {
        background: var(--navy);
    }

    .btn-login:active {
        transform: scale(0.99);
    }

    .btn-login:disabled {
        opacity: 0.65;
        cursor: not-allowed;
        transform: none;
    }

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

    .divider::before, .divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--gray-200);
    }

.roles-demo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.role-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 12px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: left;
    font-family: var(--font);
}

    .role-btn:hover {
        border-color: var(--navy-mid);
        box-shadow: 0 0 0 3px rgba(0,54,220,0.08);
    }

    .role-btn .role-name {
        font-size: 12px;
        font-weight: 700;
        color: var(--navy);
    }

    .role-btn .role-user {
        font-size: 11px;
        color: var(--gray-500);
    }

.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 11px;
    color: var(--gray-500);
}

@media (max-width: 768px) {
    .side-brand {
        display: none;
    }

    .side-form {
        padding: 32px 20px;
        align-items: flex-start;
        padding-top: 48px;
    }
}

.microsoft-form {
    margin-top: 28px;
}

.btn-ms-login {
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    background: var(--white);
    color: var(--gray-900);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    box-shadow: 0 10px 24px rgba(1, 33, 135, 0.08);
}

    .btn-ms-login:hover {
        border-color: var(--navy-mid);
        box-shadow: 0 0 0 4px rgba(0, 54, 220, 0.08), 0 14px 28px rgba(1, 33, 135, 0.12);
        transform: translateY(-1px);
    }

    .btn-ms-login:active {
        transform: scale(0.99);
    }

    .btn-ms-login:disabled {
        opacity: 0.65;
        cursor: not-allowed;
        transform: none;
    }

.ms-icon {
    width: 20px;
    height: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    flex-shrink: 0;
}

.ms-square {
    width: 9px;
    height: 9px;
    display: block;
}

.ms-red {
    background: #F25022;
}

.ms-green {
    background: #7FBA00;
}

.ms-blue {
    background: #00A4EF;
}

.ms-yellow {
    background: #FFB900;
}


.toast-session {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    min-width: 320px;
    max-width: 420px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff8e1;
    color: #4b3b00;
    border: 1px solid #f3d27a;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
    animation: toastSlideIn 0.35s ease forwards;
}

.toast-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    background: #f5b400;
    color: #ffffff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 14px;
    line-height: 1.35;
}

    .toast-content strong {
        font-size: 14px;
        font-weight: 700;
    }

    .toast-content span {
        font-size: 13px;
    }

.toast-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #4b3b00;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

    .toast-close:hover {
        opacity: 1;
    }

.toast-session.hide {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(24px);
    }
}