/* The desktop authentication layout stays in auth_styles(). */
.auth-mobile-header { display: none; }

@media (max-width: 680px) {
    body {
        background: radial-gradient(ellipse 330px 260px at 95% 0, #dcecff 0%, #edf5ff 46%, transparent 100%), #f7faff;
        color: #172f50;
        -webkit-text-size-adjust: 100%;
    }

    .auth-shell { min-height: 100svh; }
    .auth-main {
        min-height: 100svh;
        padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
        flex-direction: column;
        justify-content: flex-start;
        gap: 15px;
    }

    .auth-mobile-header {
        display: block;
        width: 100%;
        max-width: 440px;
        padding: 0 7px;
    }
    .auth-mobile-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .auth-mobile-brand {
        display: inline-flex;
        min-height: 44px;
        margin: 0;
        gap: 5px;
        color: #183c74;
        font-size: 26px;
        letter-spacing: -1.4px;
    }
    .auth-mobile-brand .auth-mascot { width: 32px; height: 36px; object-fit: contain; }
    .auth-mobile-context { color: #5275a5; font-size: 9px; font-weight: 750; letter-spacing: 1.05px; }
    .auth-mobile-welcome { position: relative; display: flex; align-items: center; min-height: 91px; padding: 7px 108px 0 3px; }
    .auth-mobile-welcome::before {
        content: "";
        position: absolute;
        right: 2px;
        bottom: 2px;
        width: 93px;
        height: 76px;
        border: 1px solid #d1e4fc;
        border-radius: 50%;
        background: #e9f3ff;
        transform: rotate(-18deg);
    }
    .auth-mobile-welcome p { position: relative; margin: 0; font-size: 20px; font-weight: 600; line-height: 1.45; letter-spacing: -.85px; }
    .auth-mobile-welcome strong { color: #1f5bc5; font-weight: 800; }
    .auth-mobile-welcome > img { position: absolute; right: -4px; bottom: -2px; width: 111px; height: 111px; object-fit: contain; }

    .auth-card {
        padding: 24px 22px 20px;
        border: 1px solid #e0e9f5;
        border-radius: 23px;
        background: #fff;
        box-shadow: 0 10px 32px #244e8c09, 0 2px 5px #244e8c03;
    }
    .auth-pill { padding: 5px 8px; border-radius: 6px; background: #edf4ff; color: #3368b9; font-size: 9px; font-weight: 750; letter-spacing: .8px; }
    .auth-card h2, .register-card h2 { margin: 13px 0 8px; font-size: 25px; font-weight: 800; letter-spacing: -.9px; line-height: 1.35; color: #172f50; }
    .auth-description, .register-card .auth-description { margin: 0 0 23px; color: #40516c; font-size: 12px; font-weight: 500; line-height: 1.8; word-break: keep-all; }
    .auth-form, .register-card .auth-form { gap: 17px; }
    .auth-field { min-width: 0; gap: 8px; }
    .auth-field label { color: #334c6c; font-size: 12px; font-weight: 750; }
    .auth-field input {
        min-width: 0;
        min-height: 50px;
        padding: 12px 13px;
        border: 1px solid #dce5f0;
        border-radius: 11px;
        background: #fcfdff;
        color: #183453;
        font-size: 16px;
        line-height: 1.5;
        scroll-margin-block: 90px;
    }
    .auth-field input::placeholder { color: #65788e; font-size: 13px; }
    .auth-field input:focus { border-color: #4f86e6; background: #fff; box-shadow: 0 0 0 3px #eaf2ff; }
    .auth-button {
        min-height: 50px;
        margin-top: 3px;
        border: 1px solid #2166d3;
        border-radius: 11px;
        background: linear-gradient(180deg, #377eeb, #286bd8);
        box-shadow: 0 5px 12px #286bd81f, inset 0 1px 0 #ffffff26;
        font-size: 14px;
        font-weight: 750;
    }
    .auth-button:hover { background: #2465cf; }
    .auth-button:active { background: #1c58bd; }
    .auth-card a:focus-visible, .auth-card button:focus-visible, .auth-mobile-header a:focus-visible { outline: 3px solid #8db7ff; outline-offset: 3px; }
    .auth-help, .register-card .auth-help { margin: 18px 0 0; color: #52647a; font-size: 11px; line-height: 1.85; word-break: keep-all; }
    .auth-help a { display: inline-flex; align-items: center; min-height: 44px; color: #2463c4; font-size: 12px; font-weight: 750; }
    .auth-account-link { padding-top: 16px; border-top: 1px solid #edf1f7; }
    .auth-account-link br { display: none; }
    .auth-account-link a { margin-left: 5px; }
    .auth-local, .register-card .auth-local { margin: 19px 0 0; padding-top: 15px; border-color: #edf1f7; color: #52647a; font-size: 10px; line-height: 1.8; word-break: keep-all; }
    .auth-alert { margin: 18px 0; border-radius: 11px; font-size: 12px; }
    .auth-status { padding: 13px; border-radius: 11px; background: #f7faff; color: #466180; font-size: 12px; }

    .register-card { max-width: 440px; }
    .register-card .auth-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .register-steps { margin: 0 0 24px; padding: 12px 10px; border-color: #e1ebf9; border-radius: 11px; background: #f7faff; color: #617894; gap: 6px; font-size: 10px; }
    .register-steps li { gap: 5px; font-weight: 650; white-space: nowrap; }
    .register-steps span { width: 20px; height: 20px; background: #e8eff9; color: #5277aa; font-size: 10px; font-weight: 750; }
    .register-steps li:first-child { color: #2768cd; }
    .register-steps li:first-child span { background: #2c70df; color: #fff; }
    .register-card .auth-field small { color: #52647a; font-size: 10px; line-height: 1.7; word-break: keep-all; }
}

@media (max-width: 360px) {
    .auth-main { padding-inline: 12px; }
    .auth-card { padding-inline: 19px; }
    .auth-mobile-welcome { padding-right: 95px; }
    .auth-mobile-welcome p { font-size: 18px; }
    .auth-mobile-welcome > img { width: 101px; height: 101px; }
    .auth-mobile-context { font-size: 8px; letter-spacing: .7px; }
    .register-card .auth-row { grid-template-columns: 1fr; }
}
