/*
 * Storefront account access
 * Editorial split layout with brand-aware colors.
 */

body {
    background:
        radial-gradient(
            circle at 12% 8%,
            color-mix(in srgb, var(--web-primary, #0054a6) 8%, transparent),
            transparent 30rem
        ),
        var(--web-background-alt, #f6f7f9);
}

/* La cuenta ya ofrece ayuda y contacto en el pie; evita cubrir sus CTA. */
.web-page--login .web-help {
    display: none;
}

.login-container {
    --auth-line: color-mix(in srgb, var(--web-text, #111827) 10%, transparent);
    --auth-soft: color-mix(in srgb, var(--web-primary, #0054a6) 6%, #fff);
    --auth-muted: color-mix(in srgb, var(--web-text, #111827) 58%, #fff);
    --auth-weight-emphasis: 600;
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: auto;
    display: block;
    padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 4vw, 2.5rem);
}

.login-container::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: .42;
    pointer-events: none;
    background-image:
        linear-gradient(var(--auth-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--auth-line) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

.login-card {
    width: min(100%, 1080px);
    max-width: 1080px;
    margin: 0 auto;
    overflow: hidden;
    display: block;
    border: 1px solid color-mix(in srgb, var(--web-primary, #0054a6) 16%, #d9dee6);
    border-radius: 28px;
    background: #fff;
    box-shadow:
        0 2px 3px rgba(15, 23, 42, .03),
        0 28px 70px rgba(15, 23, 42, .12);
}

.login-content-wrapper {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(320px, .82fr) minmax(0, 1.28fr);
}

.login-header {
    position: relative;
    isolation: isolate;
    width: auto;
    min-width: 0;
    min-height: 660px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    padding: 2rem;
    border-radius: 0;
    color: var(--web-on-primary, #fff);
    text-align: left;
    background:
        linear-gradient(
            155deg,
            color-mix(in srgb, var(--web-primary-dark, #003d7a) 88%, #14202f) 0%,
            var(--web-primary, #0054a6) 58%,
            color-mix(in srgb, var(--web-primary, #0054a6) 76%, #fff) 130%
        );
}

.login-header::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: .17;
    background-image:
        linear-gradient(rgba(255, 255, 255, .28) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .28) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(145deg, #000 20%, transparent 78%);
}

.auth-orbit {
    position: absolute;
    z-index: -1;
    display: block;
    border: 1px solid color-mix(in srgb, var(--web-on-primary, #fff) 26%, transparent);
    border-radius: 50%;
    pointer-events: none;
}

.auth-orbit--one {
    width: 290px;
    height: 290px;
    right: -160px;
    top: 44px;
}

.auth-orbit--two {
    width: 190px;
    height: 190px;
    right: -86px;
    top: 94px;
}

.auth-back-link,
.auth-mobile-back {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: inherit;
    text-decoration: none;
}

.auth-back-link {
    align-self: flex-start;
    padding: .48rem .72rem;
    border: 1px solid color-mix(in srgb, var(--web-on-primary, #fff) 28%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--web-on-primary, #fff) 8%, transparent);
    font-size: .78rem;
    font-weight: var(--auth-weight-emphasis);
    transition: background-color .18s ease, transform .18s ease;
}

.auth-back-link:hover {
    color: inherit;
    background: color-mix(in srgb, var(--web-on-primary, #fff) 15%, transparent);
    transform: translateX(-2px);
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    margin-block: 2rem;
}

.auth-brand-lockup {
    display: flex;
    align-items: center;
    gap: .78rem;
    margin-bottom: clamp(2.25rem, 5vw, 4rem);
}

.auth-brand-logo-frame,
.auth-brand-monogram {
    flex: 0 0 auto;
    width: 82px;
    height: 54px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: .42rem;
    border: 1px solid color-mix(in srgb, var(--web-on-primary, #fff) 34%, transparent);
    border-radius: 14px;
    color: var(--web-primary, #0054a6);
    background: color-mix(in srgb, #fff 94%, transparent);
    box-shadow: 0 12px 28px rgba(9, 17, 30, .13);
}

.auth-brand-lockup.has-logo .auth-brand-logo-frame {
    width: 142px;
    height: 64px;
    padding: .5rem .65rem;
}

.auth-brand-monogram {
    width: 54px;
    font-size: 1.2rem;
}

.login-brand-logo {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
    object-fit: contain;
}

.auth-brand-lockup > span:last-child {
    min-width: 0;
}

.auth-brand-lockup small,
.auth-brand-lockup strong {
    display: block;
}

.auth-brand-lockup small {
    margin-bottom: .12rem;
    color: color-mix(in srgb, var(--web-on-primary, #fff) 72%, transparent);
    font-size: .65rem;
    font-weight: var(--auth-weight-emphasis);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.auth-brand-lockup strong {
    max-width: 185px;
    overflow: hidden;
    color: inherit;
    font-size: .88rem;
    font-weight: var(--auth-weight-emphasis);
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-header .auth-eyebrow {
    margin: 0 0 .7rem;
    color: color-mix(in srgb, var(--web-on-primary, #fff) 76%, transparent);
    font-size: .66rem;
    font-weight: var(--auth-weight-emphasis);
    letter-spacing: .13em;
    text-transform: uppercase;
}

.login-header h1 {
    max-width: 370px;
    margin: 0;
    color: inherit;
    font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
    font-size: clamp(2.15rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: -.045em;
    line-height: .98;
    text-wrap: balance;
}

.login-header h1 em {
    color: color-mix(in srgb, var(--web-on-primary, #fff) 74%, transparent);
    font-weight: 400;
}

.login-header .auth-brand-copy {
    max-width: 340px;
    margin: 1.1rem 0 0;
    color: color-mix(in srgb, var(--web-on-primary, #fff) 76%, transparent);
    font-size: .88rem;
    line-height: 1.6;
}

.auth-benefits {
    display: grid;
    gap: .72rem;
    margin: 1.8rem 0 0;
    padding: 0;
    list-style: none;
}

.auth-benefits li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: .72rem;
}

.auth-benefits li > i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--web-on-primary, #fff) 22%, transparent);
    border-radius: 10px;
    color: inherit;
    background: color-mix(in srgb, var(--web-on-primary, #fff) 8%, transparent);
    font-size: .78rem;
}

.auth-benefits strong,
.auth-benefits small {
    display: block;
}

.auth-benefits strong {
    color: inherit;
    font-size: .78rem;
    font-weight: var(--auth-weight-emphasis);
}

.auth-benefits small {
    margin-top: .08rem;
    color: color-mix(in srgb, var(--web-on-primary, #fff) 65%, transparent);
    font-size: .68rem;
    line-height: 1.35;
}

.login-header .auth-brand-security {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    color: color-mix(in srgb, var(--web-on-primary, #fff) 67%, transparent);
    font-size: .68rem;
}

.login-body {
    min-width: 0;
    flex: none;
    display: block;
    padding: clamp(2rem, 4.5vw, 3.5rem);
    background:
        radial-gradient(
            circle at 100% 0,
            color-mix(in srgb, var(--web-primary, #0054a6) 5%, transparent),
            transparent 18rem
        ),
        #fff;
}

.auth-workspace-header {
    display: none;
}

.login-tabs-header {
    width: min(100%, 430px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .35rem;
    margin: 0 0 clamp(1.65rem, 4vw, 2.5rem);
    padding: .32rem;
    border: 1px solid var(--auth-line);
    border-radius: 14px;
    background: #f3f5f7;
}

.login-tabs-header button {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .62rem .7rem;
    border: 0;
    border-radius: 10px;
    color: var(--auth-muted);
    background: transparent;
    font-size: .76rem;
    font-weight: var(--auth-weight-emphasis);
    cursor: pointer;
    touch-action: manipulation;
    transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.login-tabs-header button::after {
    display: none;
}

.login-tabs-header button.active {
    color: var(--web-primary-text, var(--web-primary, #0054a6));
    background: #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .08);
    font-size: .76rem;
    font-weight: var(--auth-weight-emphasis);
}

.login-tabs-header button:hover:not(.active) {
    color: var(--web-text, #111827);
    background: color-mix(in srgb, #fff 68%, transparent);
}

.login-tabs-header button:focus-visible {
    outline-color: var(--web-primary, #0054a6);
    outline-offset: 2px;
}

.auth-panel-intro {
    margin-bottom: 1.45rem;
}

.auth-panel-kicker {
    display: block;
    margin-bottom: .38rem;
    color: var(--web-primary-text, var(--web-primary, #0054a6));
    font-size: .66rem;
    font-weight: var(--auth-weight-emphasis);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.auth-panel-intro h2 {
    margin: 0;
    color: var(--web-text, #111827);
    font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
    font-size: clamp(1.75rem, 3.5vw, 2.35rem);
    font-weight: 600;
    letter-spacing: -.035em;
    line-height: 1.05;
}

.auth-panel-intro p {
    margin: .55rem 0 0;
    color: var(--auth-muted);
    font-size: .8rem;
    line-height: 1.5;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
    animation: auth-panel-in .26s ease both;
}

@keyframes auth-panel-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.social-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
    margin: 0 0 .72rem;
}

.btn-social {
    min-width: 0;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .68rem .9rem;
    border: 1px solid #dfe3e8;
    border-radius: 12px;
    color: var(--web-text, #111827);
    background: #fff;
    font-size: .76rem;
    font-weight: var(--auth-weight-emphasis);
    text-decoration: none;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.btn-google,
.btn-facebook {
    color: var(--web-text, #111827);
    background: #fff;
    border-color: #dfe3e8;
}

.btn-social:hover:not(:disabled),
.btn-google:hover:not(:disabled),
.btn-facebook:hover:not(:disabled) {
    color: var(--web-text, #111827);
    background: #f8fafb;
    border-color: color-mix(in srgb, var(--web-primary, #0054a6) 35%, #dfe3e8);
    transform: translateY(-1px);
}

.btn-facebook i {
    color: #1877f2;
}

.btn-social:disabled {
    opacity: .58;
    filter: grayscale(.2);
}

.social-login-notice {
    justify-content: flex-start;
    margin: 0 0 .7rem;
    color: var(--auth-muted);
    font-size: .67rem;
}

.divider {
    gap: .8rem;
    margin: .9rem 0 1.15rem;
    color: var(--auth-muted);
    font-size: .66rem;
}

.divider::before,
.divider::after {
    background: var(--auth-line);
}

.login-form,
#formLogin {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    grid-template-columns: none;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.form-group {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .38rem;
}

.form-group label {
    color: color-mix(in srgb, var(--web-text, #111827) 88%, #fff);
    font-size: .7rem;
    font-weight: var(--auth-weight-emphasis);
}

.form-group label .required {
    color: var(--web-danger, #f04438);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    z-index: 1;
    left: .9rem;
    width: 18px;
    display: grid;
    place-items: center;
    color: color-mix(in srgb, var(--web-text, #111827) 38%, #fff);
    font-size: .72rem;
    pointer-events: none;
    transition: color .18s ease;
}

.input-wrapper input {
    width: 100%;
    min-height: 48px;
    padding: .7rem 2.8rem .7rem 2.65rem;
    border: 1px solid #dfe3e8;
    border-radius: 12px;
    color: var(--web-text, #111827);
    background: #fbfcfd;
    font-size: .78rem;
    line-height: 1.25;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, .02);
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.input-wrapper input::placeholder {
    color: color-mix(in srgb, var(--web-text, #111827) 38%, #fff);
}

.input-wrapper:focus-within .input-icon {
    color: var(--web-primary-text, var(--web-primary, #0054a6));
}

.input-wrapper input:focus,
.input-wrapper input:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, var(--web-primary, #0054a6) 72%, #dfe3e8);
    background: #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--web-primary, #0054a6) 10%, transparent);
}

.input-wrapper input.error {
    border-color: var(--web-danger, #f04438);
}

.input-wrapper .toggle-password {
    right: .28rem;
    width: 40px;
    min-height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    color: color-mix(in srgb, var(--web-text, #111827) 43%, #fff);
    background: transparent;
}

.input-wrapper .toggle-password:hover {
    color: var(--web-primary-text, var(--web-primary, #0054a6));
    background: var(--auth-soft);
}

.form-error {
    color: var(--web-danger, #f04438);
    font-size: .65rem;
}

.password-strength {
    gap: .25rem;
    margin-top: .12rem;
}

.strength-bar {
    height: 3px;
}

.strength-text {
    margin-top: 0;
    font-size: .62rem;
}

.terms-group {
    min-height: 0;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: .55rem;
    padding: .75rem;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    background: #fafbfc;
}

.terms-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: .05rem 0 0;
    accent-color: var(--web-primary, #0054a6);
}

.terms-group label {
    color: var(--auth-muted);
    font-size: .68rem;
    line-height: 1.48;
}

.terms-group label a {
    color: var(--web-primary-text, var(--web-primary, #0054a6));
    font-weight: var(--auth-weight-emphasis);
}

.btn-submit {
    position: relative;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    margin: .18rem 0 0;
    padding: .75rem 3rem;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    color: var(--web-on-primary, #fff);
    background: var(--web-primary, #0054a6);
    font-size: .78rem;
    font-weight: var(--auth-weight-emphasis);
    letter-spacing: .01em;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--web-primary, #0054a6) 22%, transparent);
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.btn-submit:hover:not(:disabled) {
    color: var(--web-on-primary-dark, var(--web-on-primary, #fff));
    background: var(--web-primary-dark, #003d7a);
    box-shadow: 0 13px 26px color-mix(in srgb, var(--web-primary, #0054a6) 28%, transparent);
    transform: translateY(-1px);
}

.btn-submit__arrow {
    position: absolute;
    right: 1rem;
    transition: transform .18s ease;
}

.btn-submit:hover .btn-submit__arrow {
    transform: translateX(3px);
}

.btn-submit.loading .btn-submit__arrow {
    display: none;
}

.btn-submit .spinner {
    width: 18px;
    height: 18px;
    margin-right: 0;
}

.login-alert {
    margin: 0 0 1rem;
    padding: .75rem .9rem;
    border-radius: 12px;
    font-size: .72rem;
}

.login-alert.show {
    align-items: flex-start;
}

.login-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--auth-line);
}

.login-footer p {
    color: var(--auth-muted);
    font-size: .7rem;
}

.inline-tab-link {
    color: var(--web-primary-text, var(--web-primary, #0054a6));
    font-weight: var(--auth-weight-emphasis);
}

.auth-form-tools {
    display: flex;
    justify-content: flex-end;
    margin-top: -.35rem;
}

.auth-form-tools .inline-tab-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: .35rem 0;
    font-size: .7rem;
}

.auth-message-panel {
    text-align: center;
}

.auth-message-panel .auth-panel-intro p {
    max-width: 390px;
    margin-inline: auto;
}

.auth-message-panel__icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin: 0 auto 1.15rem;
    border: 1px solid color-mix(in srgb, var(--web-primary, #0054a6) 16%, transparent);
    border-radius: 20px;
    color: var(--web-primary-text, var(--web-primary, #0054a6));
    background: var(--auth-soft);
    font-size: 1.35rem;
}

.auth-message-panel__hint {
    margin: -.25rem 0 1.15rem;
    color: var(--auth-muted);
    font-size: .7rem;
    line-height: 1.55;
}

.auth-secondary-action {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: 100%;
    margin-top: .65rem;
    padding: .55rem 1rem;
    border: 0;
    border-radius: 10px;
    color: var(--web-primary-text, var(--web-primary, #0054a6));
    background: transparent;
    font-size: .72rem;
    font-weight: var(--auth-weight-emphasis);
    cursor: pointer;
}

.auth-secondary-action:hover {
    background: var(--auth-soft);
}

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

.login-container :is(button, a, input):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--web-primary, #0054a6) 28%, transparent);
    outline-offset: 2px;
}

@media (max-width: 920px) {
    .login-content-wrapper {
        grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr);
    }

    .login-header {
        min-height: 620px;
        padding: 1.5rem;
    }

    .auth-brand-lockup {
        margin-bottom: 2.25rem;
    }

    .auth-benefits small {
        display: none;
    }

    .login-body {
        padding: 2rem;
    }
}

@media (max-width: 720px) {
    .login-container {
        padding: 1rem .75rem 1.75rem;
    }

    .login-card {
        border-radius: 20px;
    }

    .login-content-wrapper {
        display: block;
    }

    .login-header {
        display: none;
    }

    .login-body {
        padding: 1.15rem;
    }

    .auth-workspace-header {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: .85rem;
    }

    .auth-mobile-brand {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: .55rem;
        color: var(--web-text, #111827);
        font-size: .7rem;
        font-weight: var(--auth-weight-emphasis);
    }

    .auth-mobile-brand img {
        width: 96px;
        height: 38px;
        object-fit: contain;
    }

    .auth-mobile-brand i {
        width: 34px;
        height: 34px;
        display: grid;
        place-items: center;
        border-radius: 10px;
        color: var(--web-primary-text, var(--web-primary, #0054a6));
        background: var(--auth-soft);
    }

    .auth-mobile-brand span {
        max-width: 165px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .auth-mobile-back {
        display: inline-flex;
        color: var(--auth-muted);
        font-size: .68rem;
        font-weight: var(--auth-weight-emphasis);
    }

    .login-tabs-header {
        width: 100%;
        margin-bottom: 1.4rem;
    }

    .auth-panel-intro {
        margin-bottom: 1.15rem;
    }

    .auth-panel-intro h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 560px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: .9rem;
    }

    .social-buttons {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .panel.active {
        animation: none;
    }
}
