.web-auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    overflow-x: hidden;
}

.web-auth-shell {
    display: grid;
    min-height: calc(100vh - 40px);
    min-height: calc(100dvh - 40px);
    place-items: center;
}

.web-auth-card {
    box-sizing: border-box;
    width: min(100%, 430px);
    padding: clamp(24px, 5vw, 38px);
    border: 1px solid var(--px-border, #1b3a50);
    border-radius: 22px;
    color: var(--px-text-soft, #b5d2e3);
    background: var(--px-panel, #0b1d2b);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.web-auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.web-auth-brand img {
    width: 52px;
    height: 52px;
}

.web-auth-brand h1 {
    margin: 2px 0 0;
    padding: 0;
    border: 0;
    font-size: clamp(2rem, 8vw, 2.55rem);
    line-height: 1;
}

.web-auth-eyebrow {
    margin: 0;
    color: var(--px-accent, #7ddcff);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.web-auth-intro,
.web-auth-footnote {
    line-height: 1.6;
}

.web-auth-intro {
    margin: 0 0 22px;
}

.web-auth-access {
    padding: 20px;
    border: 1px solid var(--px-border-subtle, #153045);
    border-radius: 16px;
    background: color-mix(in srgb, var(--px-control, #0c2232) 58%, transparent);
}

.web-auth-page .web-auth-form {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.web-auth-page .web-auth-form label {
    margin-top: 4px;
    margin-bottom: 0;
    color: var(--px-text, #eaf7ff);
    font-size: 0.88rem;
    font-weight: 700;
}

html[data-suite-theme] .web-auth-page .web-auth-form input {
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--px-border-strong, #25475d);
    border-radius: 9px;
    color: var(--px-text, #eaf7ff);
    background: var(--px-control, #0c2232);
    font: inherit;
    font-size: 0.95rem;
}

/* En el iPhone, Safari hace zoom al enfocar un campo con letra de menos de
   16 px. Solo en pantallas táctiles: en escritorio sigue a 0.95rem. */
@media (pointer: coarse) {
    html[data-suite-theme] .web-auth-page .web-auth-form input {
        font-size: 16px;
    }
}

html[data-suite-theme] .web-auth-page .web-auth-form input:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--px-accent, #7ddcff) 45%, transparent);
    outline-offset: 2px;
}

.web-auth-page .web-auth-form .web-auth-remember {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    line-height: 1.35;
}

html[data-suite-theme] .web-auth-page .web-auth-form .web-auth-remember input {
    flex: 0 0 auto;
    width: 17px;
    min-height: 17px;
    height: 17px;
    margin: 1px 0 0;
    padding: 0;
    accent-color: var(--px-accent, #7ddcff);
}

html[data-suite-theme] .web-auth-page .web-auth-form button {
    width: 100%;
    min-height: 46px;
    padding: 11px 16px;
    margin-top: 10px;
    border-radius: 9px;
    font-size: 0.95rem;
}

.web-auth-alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border: 1px solid color-mix(in srgb, var(--px-danger, #ff9f9f) 55%, transparent);
    border-radius: 12px;
    color: var(--px-danger, #ffb4b4);
    background: var(--px-danger-soft, #3d161b);
    line-height: 1.45;
}

.web-auth-alert span {
    display: block;
    margin-top: 5px;
}

.web-auth-alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.web-auth-footnote {
    margin: 22px 0 0;
    color: var(--px-muted, #91aabb);
    font-size: 0.76rem;
}

.web-auth-session-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
    color: var(--px-muted, #91aabb);
    font-size: 0.78rem;
}

html[data-suite-theme] .web-auth-session-bar form {
    display: inline-flex;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

html[data-suite-theme] .web-auth-session-bar button {
    width: auto;
    min-height: 30px;
    margin: 0;
    padding: 5px 10px;
    border: 1px solid var(--px-border-strong, #25475d);
    border-radius: 999px;
    color: var(--px-text-soft, #b5d2e3);
    background: transparent;
    box-shadow: none;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0;
}

html[data-suite-theme] .web-auth-session-bar button:hover {
    border-color: var(--px-accent, #7ddcff);
    color: var(--px-text, #eaf7ff);
    background: var(--px-accent-soft, #092f41);
    box-shadow: none;
    transform: none;
}

@media (min-width: 760px) {
    .web-auth-page {
        padding: max(32px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-right))
            max(32px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left));
    }

    .web-auth-shell {
        min-height: calc(100vh - 64px);
        min-height: calc(100dvh - 64px);
    }

    .web-auth-card {
        display: grid;
        grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
        grid-template-areas:
            "brand access"
            "intro access"
            "footnote access";
        column-gap: clamp(38px, 5vw, 58px);
        row-gap: 18px;
        width: min(100%, 860px);
        padding: clamp(32px, 4vw, 44px);
        border-radius: 20px;
    }

    .web-auth-brand {
        grid-area: brand;
        margin: 0;
    }

    .web-auth-brand img {
        width: 48px;
        height: 48px;
    }

    .web-auth-brand h1 {
        font-size: 2.35rem;
    }

    .web-auth-intro {
        grid-area: intro;
        align-self: start;
        margin: 0;
        font-size: 0.98rem;
        line-height: 1.65;
    }

    .web-auth-access {
        grid-area: access;
        align-self: center;
        padding: 24px;
    }

    .web-auth-footnote {
        grid-area: footnote;
        align-self: end;
        margin: 0;
        line-height: 1.55;
    }
}

@media (max-width: 520px) {
    .web-auth-page {
        padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
            max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    }

    .web-auth-shell {
        min-height: calc(100vh - 20px);
        min-height: calc(100dvh - 20px);
        align-items: center;
    }

    .web-auth-card {
        padding: 22px 18px;
        border-radius: 17px;
    }

    .web-auth-access {
        padding: 16px;
        border-radius: 14px;
    }

    .web-auth-session-bar {
        align-items: center;
        flex-direction: row;
    }

    html[data-suite-theme] .web-auth-session-bar button {
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .web-auth-page *,
    .web-auth-page *::before,
    .web-auth-page *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
