.auth-page {
    --auth-ink: #15324d;
    --auth-muted: #62798e;
    --auth-paper: #ffffff;
    --auth-line: #d2e4f2;
    --auth-blue: #0878c9;
    --auth-blue-light: #b9e5ff;
    min-height: calc(100vh - 64px);
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 3rem);
    color: var(--auth-ink);
    background-color: #eaf6ff;
    background-image: radial-gradient(ellipse at 12% 10%, rgba(71, 166, 231, .14), transparent 42%), linear-gradient(180deg, #f7fbff 0%, #eaf6ff 52%, #dceeff 100%);
}

html.dark .auth-page {
    --auth-ink: #e8f3ff;
    --auth-muted: #9eb5c9;
    --auth-paper: #0d2135;
    --auth-line: #29445c;
    background-color: #071525;
    background-image: radial-gradient(ellipse at 10% 8%, rgba(14, 165, 233, .2), transparent 38%), radial-gradient(ellipse at 94% 85%, rgba(37, 99, 235, .16), transparent 42%), linear-gradient(145deg, #071525 0%, #0b1d31 56%, #071321 100%);
}

.auth-frame {
    width: min(100%, 1080px);
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    overflow: hidden;
    background: var(--auth-paper);
    border: 1px solid rgba(72, 147, 199, .2);
    border-radius: 14px;
    box-shadow: 0 28px 80px rgba(20, 70, 112, .16);
    animation: auth-enter .55s cubic-bezier(.2, .75, .25, 1) both;
}

@keyframes auth-enter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-story {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: clamp(2rem, 5vw, 3.5rem);
    overflow: hidden;
    color: #f4f9ff;
    background-color: #0d4b7b;
    background-image: radial-gradient(ellipse at 8% 0%, rgba(77, 190, 255, .35), transparent 48%), linear-gradient(145deg, rgba(7, 39, 68, .18), rgba(5, 29, 53, .76)), repeating-linear-gradient(135deg, transparent 0 24px, rgba(180, 224, 255, .07) 24px 25px);
}

.auth-story::after {
    position: absolute;
    right: -68px;
    bottom: 95px;
    width: 235px;
    height: 235px;
    border: 1px solid rgba(150, 214, 255, .34);
    border-radius: 50%;
    box-shadow: 0 0 0 22px rgba(125, 202, 255, .055), 0 0 0 48px rgba(125, 202, 255, .035);
    content: '';
    pointer-events: none;
}

.auth-brand,
.auth-mobile-brand {
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.auth-brand img { display: block; width: 185px; max-width: 100%; height: auto; }
.auth-mobile-brand { display: none; }

.auth-story-copy { position: relative; z-index: 1; max-width: 390px; margin: 3.5rem 0; }
.auth-eyebrow { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.15rem; color: var(--auth-blue-light); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.auth-eyebrow::before { width: 25px; height: 2px; background: #38bdf8; content: ''; }
.auth-story-title { max-width: 380px; margin: 0; color: #f4f9ff; font-size: clamp(2.1rem, 4vw, 3.35rem); font-weight: 800; line-height: 1.04; }
.auth-story-description { max-width: 340px; margin: 1.2rem 0 0; color: rgba(236, 247, 255, .78); font-size: .94rem; line-height: 1.75; }

.auth-steps { display: grid; gap: .85rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.auth-steps li { display: grid; grid-template-columns: 2rem 1fr; align-items: center; gap: .8rem; color: rgba(236, 247, 255, .88); font-size: .82rem; }
.auth-steps span { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid rgba(150, 214, 255, .4); border-radius: 50%; color: var(--auth-blue-light); font-size: .68rem; font-weight: 800; }
.auth-story-foot { position: relative; z-index: 1; margin: 0; color: rgba(236, 247, 255, .58); font-size: .68rem; }

.auth-form-side { display: grid; align-items: center; min-width: 0; padding: clamp(2rem, 6vw, 4.75rem); }
.auth-form-wrap { width: min(100%, 410px); margin: 0 auto; }
.auth-form-heading { margin-bottom: 2rem; }
.auth-form-heading .auth-eyebrow { margin-bottom: .75rem; color: var(--auth-blue); }
html.dark .auth-form-heading .auth-eyebrow { color: #7dd3fc; }
.auth-form-title { margin: 0; color: var(--auth-ink); font-size: clamp(1.8rem, 3vw, 2.25rem); font-weight: 800; line-height: 1.12; }
.auth-form-description { margin: .7rem 0 0; color: var(--auth-muted); font-size: .88rem; line-height: 1.65; }
.auth-fields-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.auth-optional { color: var(--auth-muted); font-weight: 500; }

.auth-alert { display: flex; align-items: flex-start; gap: .65rem; margin: 0 0 1.25rem; padding: .8rem .9rem; border: 1px solid #f0c4b8; border-radius: 8px; background: #fff4ef; color: #9b3b25; font-size: .8rem; line-height: 1.5; }
.auth-status { margin: 0 0 1.25rem; padding: .8rem .9rem; border: 1px solid #b9ddf2; border-radius: 8px; background: #eff8ff; color: #15577e; font-size: .82rem; line-height: 1.5; }
.auth-alert ul { display: grid; gap: .2rem; margin: 0; padding-left: 1rem; }
.auth-alert > svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: .05rem; }
html.dark .auth-alert { border-color: #704538; background: #33231e; color: #ffc2ae; }
html.dark .auth-status { border-color: #275875; background: #102f47; color: #b9e5ff; }

.auth-field { margin-bottom: 1.15rem; }
.auth-label { display: block; margin-bottom: .45rem; color: var(--auth-ink); font-size: .75rem; font-weight: 700; }
.auth-input-wrap { position: relative; }
.auth-input { width: 100%; min-height: 49px; padding: .75rem .85rem; border: 1px solid var(--auth-line); border-radius: 7px; outline: none; background: transparent; color: var(--auth-ink); font: inherit; font-size: .88rem; transition: border-color .16s, box-shadow .16s, background-color .16s; }
.auth-input::placeholder { color: #96a39b; }
.auth-input:focus { border-color: var(--auth-blue); box-shadow: 0 0 0 3px rgba(8, 120, 201, .12); }
html.dark .auth-input:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, .13); }
.auth-input.has-icon { padding-left: 2.75rem !important; }
.auth-input-icon { position: absolute; top: 50%; left: .9rem; width: 17px; height: 17px; transform: translateY(-50%); color: var(--auth-muted); pointer-events: none; }
.auth-password-toggle { position: absolute; top: 50%; right: .65rem; display: grid; place-items: center; width: 2rem; height: 2rem; transform: translateY(-50%); border: 0; border-radius: 5px; background: transparent; color: var(--auth-muted); cursor: pointer; }
.auth-password-toggle:hover { background: rgba(8, 120, 201, .08); color: var(--auth-blue); }
.auth-password-toggle svg { width: 17px; height: 17px; }

.auth-options { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .1rem 0 1.4rem; }
.auth-remember-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .1rem 0 1.4rem; }
.auth-forgot-link { color: var(--auth-blue); font-size: .77rem; font-weight: 700; text-decoration: none; }
.auth-forgot-link:hover { text-decoration: underline; text-underline-offset: 3px; }
html.dark .auth-forgot-link { color: #7dd3fc; }
.auth-check { display: inline-flex; align-items: center; gap: .55rem; color: var(--auth-muted); font-size: .77rem; cursor: pointer; }
.auth-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--auth-blue); }
.auth-terms { align-items: flex-start; margin: 1rem 0; line-height: 1.6; }
.auth-terms input { margin-top: .16rem; }
.auth-terms a { color: var(--auth-blue); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
html.dark .auth-terms a { color: #7dd3fc; }

.auth-submit { display: flex; align-items: center; justify-content: center; gap: .65rem; width: 100%; min-height: 51px; padding: .8rem 1rem; border: 0; border-radius: 7px; background: var(--auth-blue); color: white; font: inherit; font-size: .85rem; font-weight: 800; cursor: pointer; transition: background-color .18s, transform .18s; }
.auth-submit:hover { transform: translateY(-1px); background: #0563a8; }
.auth-submit:disabled { opacity: .65; cursor: wait; transform: none; }
.auth-submit svg { width: 17px; height: 17px; }
html.dark .auth-submit { background: #38bdf8; color: #06223a; }
html.dark .auth-submit:hover { background: #7dd3fc; }

.auth-switch { margin: 1.6rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--auth-line); color: var(--auth-muted); text-align: center; font-size: .8rem; }
.auth-switch a { margin-left: .25rem; color: var(--auth-blue); font-weight: 800; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; text-underline-offset: 3px; }
html.dark .auth-switch a { color: #7dd3fc; }

@media (max-width: 760px) {
    .auth-page { min-height: calc(100vh - 56px); padding: .75rem .75rem calc(5.5rem + env(safe-area-inset-bottom)); }
    .auth-frame { width: min(100%, 540px); min-height: 0; grid-template-columns: 1fr; border-radius: 10px; }
    .auth-story { display: none; }
    .auth-form-side { padding: clamp(1.4rem, 6vw, 2.5rem); }
    .auth-mobile-brand { display: inline-flex; margin-bottom: 2.2rem; }
    .auth-mobile-brand img { display: block; width: 155px; height: auto; }
    html.dark .auth-mobile-brand img { filter: brightness(0) invert(1); }
}

@media (max-width: 460px) {
    .auth-fields-row { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-frame { animation: none; }
    .auth-submit, .auth-input { transition: none; }
}

/* Account Mode Switcher (Light & Dark) */
.auth-account-tabs {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    gap: 4px;
}
html.dark .auth-account-tabs {
    background: #0f1d2d;
    border-color: #1e3a54;
}

.auth-account-tab-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    background: transparent;
    color: #64748b;
}
html.dark .auth-account-tab-btn {
    color: #94a3b8;
}
.auth-account-tab-btn:hover {
    color: #0f172a;
}
html.dark .auth-account-tab-btn:hover {
    color: #ffffff;
}

.auth-account-tab-btn.is-active {
    background: #0284c7 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

.auth-account-tab-btn .tab-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 999px;
    transition: all 0.2s;
}
.auth-account-tab-btn.is-active .tab-badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}
.auth-account-tab-btn:not(.is-active) .tab-badge {
    background: #e2e8f0 !important;
    color: #475569 !important;
}
html.dark .auth-account-tab-btn:not(.is-active) .tab-badge {
    background: #1e3a54 !important;
    color: #93c5fd !important;
}

.auth-action-banner {
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.25s;
}
html.dark .auth-action-banner {
    background: rgba(14, 165, 233, 0.1);
    border-color: #1a4971;
}

.auth-action-banner-text {
    font-size: 11px;
    font-weight: 600;
    color: #0369a1;
    line-height: 1.3;
}
html.dark .auth-action-banner-text {
    color: #7dd3fc;
}

.auth-switch-btn {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
    color: #ffffff !important;
}
.auth-switch-btn.to-biz {
    background: #0284c7 !important;
}
.auth-switch-btn.to-biz:hover {
    background: #0369a1 !important;
}
.auth-switch-btn.to-normal {
    background: #059669 !important;
}
.auth-switch-btn.to-normal:hover {
    background: #047857 !important;
}

@media (max-width: 460px) {
    .auth-account-tabs {
        align-items: stretch;
        flex-direction: column;
    }

    .auth-account-tab-btn {
        justify-content: flex-start;
        flex-wrap: wrap;
        width: 100%;
        min-width: 0;
    }

    .auth-account-tab-btn .tab-badge {
        margin-left: auto;
    }
}