﻿
:root {
    --login-navy: #071a35;
    --login-navy-light: #102c50;
    --login-blue: #174d83;
    --login-red: #d92332;
    --login-red-hover: #b91d2a;
    --login-text: #15243a;
    --login-muted: #748198;
    --login-border: #dfe5ed;
    --login-background: #f3f5f9;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--login-background);
}

.login-page,
.login-page * {
    box-sizing: border-box;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--login-text);
    background: radial-gradient( circle at 8% 10%, rgba(23, 77, 131, .08), transparent 32% ), radial-gradient( circle at 92% 90%, rgba(217, 35, 50, .06), transparent 28% ), var(--login-background);
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.03fr) minmax(0, .97fr);
    width: 100%;
    max-width: 1120px;
    min-height: 660px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(20, 38, 64, .06);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(7, 26, 53, .12);
}

/* Panel izquierdo */

.login-showcase {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: 42px;
    overflow: hidden;
    color: #fff;
    background: radial-gradient( ellipse at 100% 0%, rgba(48, 104, 165, .42), transparent 43% ), linear-gradient( 145deg, #0d2c50 0%, var(--login-navy) 62%, #061226 100% );
}

    .login-showcase::before {
        position: absolute;
        top: 215px;
        right: -165px;
        width: 390px;
        height: 390px;
        content: "";
        border: 1px solid rgba(255, 255, 255, .07);
        border-radius: 50%;
        pointer-events: none;
    }

    .login-showcase::after {
        position: absolute;
        top: 255px;
        right: -125px;
        width: 310px;
        height: 310px;
        content: "";
        border: 1px solid rgba(255, 255, 255, .06);
        border-radius: 50%;
        pointer-events: none;
    }

.showcase-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.showcase-logo {
    display: block;
    width: 66px;
    height: 66px;
    flex-shrink: 0;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 5px 22px rgba(0, 0, 0, .16);
}

.showcase-brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.showcase-brand-name {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2.8px;
}

.showcase-brand-subtitle {
    color: #c1d0e3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.4px;
}

.showcase-content {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: 50px 0;
}

.showcase-label {
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    color: #e6edf7;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 7px;
}

.showcase-content h1 {
    margin: 27px 0 18px;
    color: #fff;
    font-size: clamp(30px, 3.1vw, 43px);
    font-weight: 750;
    line-height: 1.18;
    letter-spacing: -1.4px;
}

    .showcase-content h1 span {
        display: block;
        color: #8eb9ed;
    }

.showcase-content > p {
    max-width: 380px;
    margin: 0;
    color: #bdcadd;
    font-size: 14px;
    line-height: 1.9;
}

.showcase-features {
    display: grid;
    gap: 20px;
    margin-top: 37px;
}

.showcase-feature {
    display: flex;
    align-items: center;
    gap: 14px;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    color: #fff;
    font-size: 19px;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 12px;
}

.showcase-feature div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.showcase-feature strong {
    color: #f7f9fc;
    font-size: 13px;
    font-weight: 650;
}

.showcase-feature small {
    color: #aabbd0;
    font-size: 12px;
}

.showcase-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    color: #9aacc3;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 1.1px;
}

.footer-dot {
    width: 7px;
    height: 7px;
    background: #42c78a;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(66, 199, 138, .12);
}

.footer-separator {
    color: var(--login-red);
}

/* Panel del formulario */

.login-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 50px clamp(28px, 5vw, 68px) 25px;
    background: #fff;
}

.login-form-container {
    width: 100%;
    max-width: 390px;
    margin: auto;
}

.mobile-brand {
    display: none;
}

.login-heading {
    margin-bottom: 32px;
}

.login-eyebrow {
    display: inline-block;
    margin-bottom: 13px;
    color: var(--login-red);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
}

.login-heading h2 {
    margin: 0;
    color: var(--login-navy);
    font-size: 34px;
    font-weight: 750;
    letter-spacing: -1.2px;
    line-height: 1.25;
}

.login-heading p {
    margin: 12px 0 0;
    color: var(--login-muted);
    font-size: 13px;
    line-height: 1.7;
}

/* Campos */

.form-field {
    margin-bottom: 23px;
}

    .form-field label {
        display: block;
        margin-bottom: 10px;
        color: #27364c;
        font-size: 12px;
        font-weight: 700;
    }

.input-wrapper {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 54px;
    padding: 0 15px;
    gap: 12px;
    background: #fbfcfe;
    border: 1px solid var(--login-border);
    border-radius: 11px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

    .input-wrapper > i {
        flex-shrink: 0;
        color: #8794a8;
        font-size: 17px;
    }

    .input-wrapper:focus-within {
        background: #fff;
        border-color: var(--login-blue);
        box-shadow: 0 0 0 4px rgba(23, 77, 131, .09);
    }

.login-input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    color: var(--login-text);
    font-family: inherit;
    font-size: 13px;
    background: transparent;
    border: 0;
    outline: none;
}

    .login-input::placeholder {
        color: #a3adbb;
    }

.password-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .password-label-row label {
        margin-bottom: 10px;
    }

.password-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    color: #8190a5;
    font-size: 17px;
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}

    .password-toggle:hover {
        color: var(--login-navy);
        background: #edf1f6;
    }

.field-validation,
.validation-summary {
    display: block;
    margin-top: 7px;
    color: #c62835;
    font-size: 12px;
}

    .validation-summary:empty {
        display: none;
    }

/* Botón de acceso */

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    margin-top: 8px;
    padding: 14px 20px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    background: var(--login-red);
    border: 1px solid var(--login-red);
    border-radius: 11px;
    box-shadow: 0 8px 18px rgba(217, 35, 50, .17);
    cursor: pointer;
    transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

    .login-submit:hover:not(:disabled) {
        background: var(--login-red-hover);
        box-shadow: 0 10px 22px rgba(217, 35, 50, .24);
        transform: translateY(-1px);
    }

    .login-submit:focus-visible {
        outline: 3px solid rgba(217, 35, 50, .3);
        outline-offset: 3px;
    }

    .login-submit:disabled {
        opacity: .8;
        cursor: wait;
        transform: none;
    }

.button-content,
.button-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

    .button-content[hidden],
    .button-loading[hidden],
    .login-status[hidden] {
        display: none !important;
    }

    .button-content i {
        font-size: 16px;
        transition: transform .2s ease;
    }

.login-submit:hover .button-content i {
    transform: translateX(3px);
}

.login-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin .7s linear infinite;
}

@keyframes login-spin {
    to {
        transform: rotate(360deg);
    }
}

.login-status {
    margin-top: 15px;
    color: var(--login-muted);
    font-size: 12px;
    text-align: center;
}

.login-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 23px;
    padding: 13px 14px;
    color: #a91f2b;
    font-size: 12px;
    line-height: 1.6;
    background: #fff2f3;
    border: 1px solid #f7d4d8;
    border-radius: 10px;
}

    .login-error i {
        margin-top: 1px;
        font-size: 16px;
    }

.login-security {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 29px;
    padding-top: 22px;
    color: #8390a3;
    font-size: 11px;
    line-height: 1.7;
    border-top: 1px solid #edf0f4;
}

    .login-security i {
        flex-shrink: 0;
        color: #3d9671;
        font-size: 16px;
    }

.login-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 15px;
    margin-top: 38px;
    color: #9aa4b3;
    font-size: 10px;
}

/* Adaptación a tabletas */

@media (max-width: 900px) {
    .login-page {
        padding: 22px;
    }

    .login-shell {
        grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
        min-height: 610px;
    }

    .login-showcase {
        padding: 30px;
    }

    .showcase-logo {
        width: 55px;
        height: 55px;
    }

    .showcase-brand-name {
        font-size: 21px;
    }

    .showcase-content h1 {
        font-size: 32px;
    }

    .login-main {
        padding: 35px 28px 22px;
    }

    .login-heading h2 {
        font-size: 30px;
    }
}

/* Adaptación a móviles */

@media (max-width: 640px) {
    .login-page {
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0;
        background: #fff;
    }

    .login-shell {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .login-showcase {
        display: none;
    }

    .login-main {
        flex: 1;
        justify-content: flex-start;
        padding: 30px 24px 20px;
    }

    .login-form-container {
        max-width: 420px;
        margin: 0 auto;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 43px;
        color: var(--login-navy);
        font-size: 19px;
        font-weight: 800;
        letter-spacing: 2px;
    }

    .mobile-logo {
        width: 53px;
        height: 53px;
        object-fit: contain;
        background: #fff;
        border: 1px solid #edf0f4;
        border-radius: 50%;
    }

    .login-heading {
        margin-bottom: 29px;
    }

        .login-heading h2 {
            font-size: 31px;
        }

        .login-heading p {
            font-size: 13px;
        }

    .form-field {
        margin-bottom: 21px;
    }

    .input-wrapper {
        height: 53px;
    }

    .login-submit {
        min-height: 54px;
    }

    .login-security {
        margin-top: 26px;
    }

    .login-footer {
        justify-content: center;
        margin-top: auto;
        padding-top: 35px;
        text-align: center;
    }
}

/* Móviles pequeños */

@media (max-width: 360px) {
    .login-main {
        padding-right: 18px;
        padding-left: 18px;
    }

    .mobile-brand {
        margin-bottom: 32px;
    }

    .login-heading h2 {
        font-size: 28px;
    }
}

/* Accesibilidad: reducir animaciones */

@media (prefers-reduced-motion: reduce) {
    .login-page *,
    .login-page *::before,
    .login-page *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
