.login-layout {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(420px, 1.08fr) minmax(500px, .92fr);
    background: var(--surface);
}

/* Presentación de marca */
.brand-panel {
    position: relative;
    isolation: isolate;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: clamp(48px, 7vw, 110px);
    background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(255,244,235,.94));
    border-right: 1px solid rgba(255, 115, 0, .12);
}

.brand-panel::before {
    content: '';
    position: absolute;
    z-index: -2;
    inset: 0 auto 0 0;
    width: 13px;
    background: var(--brand-primary);
}

.brand-panel__content {
    position: relative;
    z-index: 2;
    width: min(100%, 620px);
}

.brand-panel__logo-link {
    display: inline-block;
    width: min(92%, 560px);
}

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

.brand-panel__message {
    display: grid;
    grid-template-columns: 48px 1fr;
    column-gap: 18px;
    margin-top: clamp(42px, 7vh, 72px);
}

.brand-panel__rule {
    width: 48px;
    height: 4px;
    margin-top: 14px;
    background: var(--brand-primary);
    border-radius: 999px;
}

.brand-panel__tagline {
    margin: 0;
    font-size: clamp(25px, 2.7vw, 40px);
    font-weight: 760;
    line-height: 1.12;
    letter-spacing: -.035em;
}

.brand-panel__description {
    grid-column: 2;
    max-width: 430px;
    margin: 16px 0 0;
    color: var(--text-muted);
    font-size: clamp(14px, 1.25vw, 17px);
    line-height: 1.6;
}


.brand-panel__shape {
    position: absolute;
    z-index: -1;
    display: block;
    border-radius: 50%;
    pointer-events: none;
}

.brand-panel__shape--one {
    width: min(36vw, 560px);
    height: min(36vw, 560px);
    top: -24%;
    right: -22%;
    background: var(--brand-primary);
    opacity: .065;
}

.brand-panel__shape--two {
    width: 260px;
    height: 260px;
    right: 8%;
    bottom: -18%;
    border: 48px solid var(--brand-primary);
    opacity: .06;
}

/* Formulario */
.access-panel {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: max(42px, env(safe-area-inset-top)) clamp(30px, 6vw, 90px) max(30px, env(safe-area-inset-bottom));
    background: var(--surface);
}

.access-panel__inner { width: min(100%, 440px); }
.login-card { width: 100%; }
.login-heading { margin-bottom: 36px; }

.login-heading .eyebrow {
    margin: 0 0 10px;
    color: var(--brand-primary);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.login-heading h1 {
    margin: 0;
    font-size: clamp(34px, 4vw, 45px);
    line-height: 1.05;
    letter-spacing: -.045em;
}

.login-heading > p:last-child {
    margin: 13px 0 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.55;
}

.login-form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { color: #303641; font-size: 13px; font-weight: 750; }

.field__control {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 15px;
    background: #fbfbfc;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field__control:hover { border-color: #cbd0d8; }
.field__control:focus-within {
    background: var(--surface);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px var(--brand-primary-soft);
}

.field__control > svg,
.password-toggle svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field__control > svg { flex: 0 0 auto; color: #8a92a0; }

.field input {
    min-width: 0;
    flex: 1;
    padding: 15px 0;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: 0;
}

.field input::placeholder { color: #9aa1ad; }
.field input:disabled { color: var(--text-muted); }
.field__error { min-height: 15px; margin: 0; color: var(--danger); font-size: 12px; }
.field.is-invalid .field__control { border-color: var(--danger); background: var(--danger-soft); }

.password-toggle {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.password-toggle:hover { color: var(--text); background: var(--background); }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid color-mix(in srgb, var(--danger) 18%, transparent);
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.45;
}

.alert svg {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.primary-button {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    color: white;
    background: var(--brand-primary);
    border: 0;
    border-radius: 12px;
    box-shadow: 0 12px 26px color-mix(in srgb, var(--brand-primary) 27%, transparent);
    font-weight: 800;
    cursor: pointer;
    transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover {
    background: var(--brand-primary-hover);
    box-shadow: 0 15px 30px color-mix(in srgb, var(--brand-primary) 34%, transparent);
}

.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: .78; }
.primary-button .spinner { display: none; border-color: rgba(255,255,255,.35); border-top-color: white; }
.primary-button.is-loading .spinner { display: inline-block; }
.primary-button.is-loading .primary-button__label { opacity: .82; }
.recovery-link { justify-self: center; margin-top: 16px; padding: 4px; color: var(--brand-primary); background: transparent; border: 0; font-size: 12px; font-weight: 750; cursor: pointer; }
.recovery-link:hover { text-decoration: underline; }
.recovery-form[hidden],
.login-form[hidden],
.recovery-link[hidden] { display: none; }
.login-heading--recovery { margin-bottom: 4px; }
.login-heading--recovery h2 { margin: 0; font-size: 25px; }
.login-heading--recovery p:last-child { margin: 8px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.recovery-message.is-success { color: #17643a; background: #ecf9f1; border-color: #bce8cd; }

/* Información legal */
.login-footer {
    display: grid;
    justify-items: center;
    gap: 7px;
    margin-top: clamp(42px, 7vh, 70px);
    color: #6f7785;
    text-align: center;
    font-size: 12px;
}

.login-footer p { margin: 0; }
.login-footer__company { font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.login-footer__credits { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.login-footer__credits a { color: #243852; font-weight: 800; text-decoration: none; }
.login-footer__credits a:hover { text-decoration: underline; }
.login-footer__credits > span[aria-hidden] { color: var(--brand-primary); }
.login-footer__privacy {
    margin-top: 3px;
    color: var(--brand-primary);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}
.login-footer__privacy:hover { text-decoration: underline; }

/* Adaptación tablet y móvil */
@media (max-width: 980px) {
    .login-layout { grid-template-columns: minmax(320px, .8fr) minmax(440px, 1.2fr); }
    .brand-panel { padding: 50px; }
    .brand-panel__message { grid-template-columns: 32px 1fr; column-gap: 13px; }
    .brand-panel__rule { width: 32px; }
}

@media (max-width: 760px) {
    .login-layout { display: block; background: var(--surface); }
    .brand-panel {
        min-height: 0;
        height: 190px;
        align-items: flex-start;
        padding: 38px 32px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 115, 0, .12);
    }
    .brand-panel::before { inset: 0 0 auto; width: 100%; height: 7px; }
    .brand-panel__logo-link { width: 210px; }
    .brand-panel__message { display: none; }
    .brand-panel__shape--one { width: 280px; height: 280px; top: -140px; right: -90px; }
    .brand-panel__shape--two { display: none; }
    .access-panel {
        min-height: calc(100dvh - 190px);
        place-items: start center;
        padding: 42px 24px max(30px, env(safe-area-inset-bottom));
    }
    .login-heading { margin-bottom: 30px; }
    .login-footer { margin-top: 46px; }
}

@media (max-width: 380px) {
    .brand-panel { height: 165px; padding: 32px 24px; }
    .brand-panel__logo-link { width: 175px; }
    .access-panel { min-height: calc(100dvh - 165px); padding-inline: 18px; }
}
