*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.auth-body {
    font-family: "Manrope", sans-serif;
    color: var(--color-text-primary);
    background: #e8f1fc;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 43fr) minmax(0, 57fr);
    background:
        radial-gradient(ellipse 52% 68% at 100% 0%, rgba(76, 120, 177, .70), transparent 66%),
        radial-gradient(ellipse 48% 64% at 0% 100%, rgba(121, 158, 204, .60), transparent 64%),
        linear-gradient(135deg, #e3eef9 0%, #d4e4f4 42%, #b9d0e9 70%, #91b1d7 100%);
}

.auth-shell::before {
    position: absolute;
    z-index: 0;
    top: 7%;
    bottom: 7%;
    left: 43%;
    width: 1px;
    content: "";
    background: rgba(255, 255, 255, .72);
    pointer-events: none;
}

.brand-panel {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    min-width: 0;
    isolation: isolate;
    color: var(--color-text-primary);
    background: transparent;
}

.brand-panel::before {
    position: absolute;
    z-index: 0;
    content: "";
    pointer-events: none;
}

.brand-panel::before {
    inset: 0;
    background:
        radial-gradient(circle 132px at 8% 94%, rgba(184, 208, 236, .46) 0 99%, transparent 100%),
        linear-gradient(145deg, rgba(255, 255, 255, .18), transparent 52%);
}

.brand-panel__masthead {
    position: absolute;
    z-index: 2;
    display: grid;
    justify-items: start;
    gap: 26px;
    width: min(100% - 128px, 340px);
    top: 45%;
    left: clamp(72px, 9vw, 152px);
    margin: 0;
    transform: translateY(-50%);
}

.brand-panel__logo-surface {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.brand-panel__logo {
    display: block;
    width: 100%;
    height: auto;
}

.brand-panel__masthead p {
    position: relative;
    display: grid;
    gap: 6px;
    margin: 0;
    padding-top: 20px;
    color: #426382;
    font-size: .88rem;
    font-weight: 600;
    letter-spacing: .2em;
    line-height: 1.6;
    text-transform: uppercase;
}

.brand-panel__masthead p span {
    display: block;
}

.brand-panel__masthead p::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 3px;
    content: "";
    border-radius: 999px;
    background: var(--azul-600);
}

.brand-panel__orb,
.brand-panel__curve {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.brand-panel__orb {
    border-radius: 50%;
    background: transparent;
}

.brand-panel__orb--top {
    bottom: -210px;
    left: -190px;
    width: 400px;
    height: 400px;
    border: 1px solid rgba(20, 63, 121, .34);
    background: rgba(20, 63, 121, .30);
    box-shadow: none;
}

.brand-panel__orb--bottom {
    bottom: -210px;
    left: -120px;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(11, 45, 99, .30);
    background: rgba(11, 45, 99, .26);
}

.brand-panel__curve {
    opacity: 1;
}

.brand-panel__curve--top {
    top: 0;
    left: 0;
    width: min(31%, 230px);
    height: clamp(168px, 24vh, 230px);
    border: 1px solid rgba(130, 164, 207, .72);
    border-top: 0;
    border-left: 0;
    border-bottom-right-radius: 104px;
}

.brand-panel__curve--bottom {
    bottom: 0;
    left: 0;
    width: min(62%, 444px);
    height: 165px;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .9);
    border-right: 1px solid rgba(75, 117, 167, .58);
    border-top-right-radius: 62px;
}

.auth-panel {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    min-width: 0;
    padding: 40px;
    isolation: isolate;
    overflow: clip;
    background: transparent;
}

.auth-panel::before {
    position: absolute;
    z-index: 0;
    top: -150px;
    right: -108px;
    width: 312px;
    height: 312px;
    content: "";
    border: 1px solid rgba(20, 63, 121, .26);
    border-radius: 50%;
    background: rgba(20, 63, 121, .12);
    box-shadow: inset 0 0 0 1px rgba(115, 152, 199, .30);
    pointer-events: none;
}

.auth-panel::after {
    position: absolute;
    z-index: 0;
    top: -74px;
    right: -16px;
    width: 178px;
    height: 178px;
    content: "";
    border: 1px solid rgba(184, 208, 236, .54);
    border-radius: 50%;
    background: rgba(184, 208, 236, .18);
    pointer-events: none;
}

.auth-mobile-brand {
    display: none;
}

.auth-card-wrapper {
    position: relative;
    z-index: 1;
    width: min(100%, 530px);
    min-width: 0;
}

.auth-card {
    position: relative;
    overflow: hidden;
    min-width: 0;
    background: var(--color-card-background);
    border: 1px solid rgba(196, 210, 227, .8);
    border-radius: 24px;
    box-shadow: 0 22px 58px rgba(36, 66, 105, .14), 0 2px 8px rgba(36, 66, 105, .04);
    padding: 52px 52px 46px;
}

.auth-card > * {
    position: relative;
    z-index: 1;
}

.auth-card__header {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
    margin-bottom: 42px;
}

.auth-card__title {
    margin: 0;
    color: var(--azul-900);
    font-size: 2.45rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.auth-card__title-divider {
    visibility: hidden;
}

.auth-card__subtitle {
    margin: 0;
    color: var(--texto-secundario);
    font-size: .88rem;
    letter-spacing: .025em;
    line-height: 1.6;
}

.message-stack,
.form-alert {
    margin-bottom: 18px;
}

.message-banner,
.form-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
    line-height: 1.55;
}

.message-banner i,
.form-alert i {
    font-size: 1rem;
    margin-top: 2px;
}

.message-banner p,
.form-alert p {
    margin: 0;
}

.message-info {
    color: var(--informacion);
    background: var(--color-info-bg);
    border-color: var(--color-border);
}

.message-success {
    color: var(--exito);
    background: var(--color-success-bg);
    border-color: var(--color-border);
}

.form-alert {
    color: var(--alerta);
    background: var(--color-danger-bg);
    border-color: var(--color-danger-text);
}

.login-form {
    display: grid;
    gap: 20px;
}

.form-field label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--texto-principal);
    line-height: 1.4;
}

.field-control {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    min-width: 0;
    padding: 0 16px;
    border: 1px solid #cfdae8;
    border-radius: 12px;
    background: var(--blanco);
    box-shadow: inset 0 1px 0 rgba(24, 52, 88, .02);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.field-control:focus-within {
    border-color: var(--azul-600);
    box-shadow: 0 0 0 3px rgba(81, 126, 181, .16);
}

.field-control--error {
    border-color: var(--color-danger-text);
}

.field-control__icon,
.field-control__toggle {
    color: var(--texto-secundario);
    font-size: 1rem;
}

.field-control__icon {
    flex: 0 0 auto;
}

.field-control__toggle {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    margin-left: auto;
    margin-right: -6px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.field-control__toggle:hover {
    background: rgba(81, 126, 181, .08);
}

.field-control input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--texto-principal);
    font-size: .94rem;
    line-height: 1.5;
}

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

.field-error {
    margin: 8px 0 0;
    color: var(--alerta);
    font-size: 0.92rem;
    line-height: 1.5;
}

.form-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 0;
    font-size: .88rem;
    line-height: 1.4;
}

.checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--texto-secundario);
    cursor: pointer;
}

.checkbox-field input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--azul-700);
}

.text-link {
    color: var(--azul-700);
    font-weight: 700;
    text-decoration: none;
}

.text-link:hover,
.text-link:focus-visible {
    text-decoration: underline;
}

.submit-button {
    position: relative;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 12px 58px 12px 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #143f79, #08285b);
    box-shadow: 0 10px 22px rgba(8, 40, 91, .22);
    color: var(--color-button-primary-text);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow .2s ease, transform .2s ease;
}

.submit-button:hover,
.submit-button:focus-visible {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #1a4f92, #0b2d63);
    box-shadow: 0 14px 26px rgba(8, 40, 91, .3);
}

.submit-button::after {
    position: absolute;
    right: 20px;
    content: "\2192";
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    transition: transform .2s ease;
}

.submit-button:hover::after,
.submit-button:focus-visible::after {
    transform: translateX(3px);
}

.submit-button:disabled {
    box-shadow: none;
    cursor: not-allowed;
    opacity: .62;
    transform: none;
}

.submit-button--secondary {
    margin-top: 12px;
    background: var(--color-button-secondary-bg);
    color: var(--color-button-secondary-text);
    box-shadow: none;
}

.auth-card__footer {
    display: grid;
    grid-template-columns: minmax(24px, 1fr) auto minmax(24px, 1fr);
    align-items: center;
    gap: 14px;
    margin-top: 30px;
    padding-top: 0;
    border: 0;
    text-align: center;
    color: #7a8ba4;
    font-size: .8rem;
    line-height: 1.5;
}

.auth-card__footer::before,
.auth-card__footer::after {
    width: 100%;
    height: 1px;
    content: "";
    background: #dfe7f0;
}

.auth-card__footer p {
    margin: 0;
    white-space: nowrap;
}

/* Keep the complete desktop login within shorter laptop viewports. */
@media (min-width: 921px) and (max-height: 820px) {
    .auth-panel {
        padding-block: 20px;
    }

    .auth-card {
        padding-block: 30px;
    }

    .auth-card__header {
        gap: 9px;
        margin-bottom: 24px;
    }

    .auth-card__title {
        font-size: 2.05rem;
    }

    .login-form {
        gap: 16px;
    }

    .field-control {
        min-height: 48px;
    }

    .submit-button {
        min-height: 50px;
    }

    .auth-card__footer {
        margin-top: 20px;
    }
}

.support-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, var(--color-surface-muted), transparent 24%),
        linear-gradient(135deg, var(--azul-50) 0%, var(--blanco-azulado) 100%);
}

.support-card {
    width: min(100%, 560px);
    background: var(--color-card-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radio-grande);
    box-shadow: var(--sombra-profunda);
    padding: 42px;
    text-align: center;
}

.support-card__eyebrow {
    margin: 0 0 10px;
    color: var(--azul-600);
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.support-card h1 {
    margin: 0 0 14px;
    font-size: clamp(1.9rem, 4vw, 2.4rem);
}

.support-card p {
    margin: 0;
    color: var(--texto-secundario);
    line-height: 1.75;
}

:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

@media (max-width: 1120px) and (min-width: 921px) {
    .brand-panel__masthead {
        width: min(100% - 68px, 320px);
        left: 34px;
        margin: 0;
    }
}

@media (max-width: 920px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-shell::before {
        display: none;
    }

    .brand-panel {
        min-height: 320px;
    }

    .brand-panel__masthead {
        gap: 16px;
        width: min(100% - 56px, 300px);
        top: 50%;
        left: 28px;
        margin: 0;
        transform: translateY(-50%);
    }

    .brand-panel__logo {
        width: 100%;
    }

    .brand-panel__masthead p {
        font-size: .82rem;
    }

    .brand-panel__orb--top {
        top: auto;
        bottom: 22px;
        left: -56px;
        width: 152px;
        height: 152px;
    }

    .brand-panel__orb--bottom {
        right: auto;
        bottom: -86px;
        left: 50px;
        width: 212px;
        height: 212px;
    }

    .auth-panel,
    .auth-card,
    .support-card {
        padding: 28px;
    }

    .auth-panel {
        min-height: 0;
    }
}

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

    .auth-panel {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        min-height: 100dvh;
        padding: 20px;
    }

    .auth-mobile-brand {
        display: block;
        flex: 0 0 auto;
        width: clamp(180px, 50vw, 210px);
    }

    .auth-mobile-brand img {
        display: block;
        width: 100%;
        height: auto;
    }

    .auth-card,
    .support-card {
        padding: 34px 22px 26px;
        border-radius: 18px;
    }

    .auth-card__title {
        font-size: 1.8rem;
    }

    .form-actions-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .field-control__toggle {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        margin-right: -12px;
    }

    .checkbox-field {
        min-height: 44px;
    }
}
