html,
body {
    min-height: 100%;
    margin: 0;
    background: transparent;
}

body.auth-page {
    --auth-bg: #f5f5f5;
    --auth-surface: rgba(255, 255, 255, 0.96);
    --auth-border: #e4e4e7;
    --auth-text: #18181b;
    --auth-muted: #71717a;
    --auth-soft: #a1a1aa;
    --auth-line: #f0f0f0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 245, 245, 0.98)),
        radial-gradient(circle, rgba(212, 212, 216, 0.42) 1px, transparent 1px);
    background-size: auto, 20px 20px;
    color: var(--auth-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", PingFang SC, Microsoft YaHei, sans-serif;
    overflow-x: hidden;
}

body.auth-page #top,
body.auth-page #Bottom,
body.auth-page .support-fab,
body.auth-page .support-fab-tip {
    display: none !important;
}

body.auth-page .Wrapper,
body.auth-page .Wrapper > .content,
body.auth-page #Main {
    min-height: 100vh;
    width: 100%;
    max-width: none;
}

body.auth-page .Wrapper > .content {
    display: block;
    margin: 0;
    padding: 0;
}

body.auth-page #Main {
    position: relative;
}

body.auth-page .site-messages {
    width: min(388px, calc(100vw - 32px));
    margin: 28px auto 0;
}

.auth-stage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
}

.main-content {
    position: relative;
    --auth-card-radius: 24px;
    width: min(388px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 34px 24px 24px;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
    border-radius: var(--auth-card-radius);
    background: #ffffff;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.14);
}

.main-content,
.main-content * {
    box-sizing: border-box;
}

body.auth-page--login .main-content {
    overflow: hidden;
    padding-bottom: 0;
}

.auth-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-header--centered {
    align-items: center;
    text-align: center;
}

.auth-title {
    margin: 0;
    font-size: 24px;
    font-weight: normal;
    line-height: 1.18;
    letter-spacing: 0;
    color: var(--auth-text);

}

.auth-subtitle {
    display: none;
}

.auth-mode-tabs {
    display: none;
}

.auth-mode-tab {
    position: relative;
    appearance: none;
    padding: 0 0 12px;
    border: none;
    background: transparent;
    color: var(--auth-soft);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: color .18s ease;
}

.auth-mode-tab:hover,
.auth-mode-tab:focus-visible {
    color: #52525b;
}

.auth-mode-tab.is-active {
    color: var(--auth-text);
}

.auth-mode-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--auth-text);
}

.form-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form[hidden] {
    display: none;
}

.form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field-top {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.auth-field-top--between {
    justify-content: space-between;
    gap: 12px;
}

.auth-field-label {
    font-size: 14px;
    font-weight: normal;
    line-height: 1.3;
    color: #a1a1aa;

}

.auth-inline-link,
.auth-footer a,
.auth-note a,
.auth-agreement a,
.auth-agreement-check__text a {
    color: #3b82f6;
    color: color(srgb 0.2342 0.5082 0.9641);
    font-weight: 500;
    text-decoration: unset;
}

.auth-feedback a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.auth-inline-link:hover,
.auth-inline-link:focus-visible,
.auth-footer a:hover,
.auth-footer a:focus-visible,
.auth-note a:hover,
.auth-note a:focus-visible,
.auth-agreement a:hover,
.auth-agreement a:focus-visible,
.auth-agreement-check__text a:hover,
.auth-agreement-check__text a:focus-visible,
.auth-feedback a:hover,
.auth-feedback a:focus-visible {
    text-decoration: unset;
}

.form-control {
    width: 100%;
    /* min-height: 56px; */
    padding: 11px 14px;
    border: 1px solid #d4d4d8;
    border-radius: 10px;
    background: #ffffff;
    color: var(--auth-text);
    font-size: 15px;
    line-height: 1.4;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;

}

.form-control::placeholder {
    color: #d4d4d8;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.form-label {
    display: none;
}

.form-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    /* min-height: 56px; */
    padding: 12px 16px;
    border: 1px solid #18181b;
    border-radius: 10px;
    background: #18181b;
    color: #fafafa;
    cursor: pointer;
    font-size: 16px;
    /* font-weight: 600; */
    line-height: 1.2;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;

}

.form-button:hover,
.form-button:focus-visible {
    background: #27272a;
    border-color: #27272a;
    /* box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16); */

}

.form-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.form-button--secondary {
    width: auto;
    min-width: 122px;
    background: #ffffff;
    color: #3f3f46;
    border-color: var(--auth-border);
    box-shadow: none;
}

.form-button--secondary:hover,
.form-button--secondary:focus-visible {
    background: #fafafa;
    color: var(--auth-text);
    border-color: #d4d4d8;
}

.auth-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.auth-form-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: -6px;
}

.auth-agreement-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-agreement-check {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    color: var(--auth-text);
    font-size: 14px;
    line-height: 1.6;
}

.auth-agreement-check__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-agreement-check__box {
    position: relative;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.auth-agreement-check__input:focus-visible + .auth-agreement-check__box {
    outline: 2px solid rgba(59, 130, 246, 0.28);
    outline-offset: 2px;
}

.auth-agreement-check__input:checked + .auth-agreement-check__box {
    border-color: #3b82f6;
    background: #3b82f6;
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.18);
}

.auth-agreement-check__input:checked + .auth-agreement-check__box::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-agreement-check__text {
    color: var(--auth-text);
}

.auth-register-panel {
    margin: 10px -24px 0;
    background: #dbeafe;
    overflow: hidden;
    border-radius: 0;
}

.auth-register-panel__body {
    padding: 18px 24px 24px;
    background: #ffffff;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
}

.auth-register-panel .auth-agreement-check {
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    gap: 12px;
}

.auth-register-error {
    display: none;
    margin: 10px 0 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: #b91c1c;
}

body.auth-page--login .auth-register-panel .auth-agreement-check__box {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 0;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: none;
}

body.auth-page--login .auth-register-panel .auth-agreement-check__input:checked + .auth-agreement-check__box {
    border-color: #3b82f6;
    background: #3b82f6;
    box-shadow: none;
}

body.auth-page--login .auth-register-panel .auth-agreement-check__input:checked + .auth-agreement-check__box::after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border-width: 0 2px 2px 0;
}

body.auth-page--login .auth-register-panel .auth-agreement-check__text {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}

.auth-register-panel__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 11px 24px 30px;
    background: transparent;
    color: #3b82f6;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    transition: background-color .18s ease, color .18s ease;

}

.auth-register-panel__cta:hover,
.auth-register-panel__cta:focus-visible {
    background: #d4e7ff;
    color: #2563eb;
}

.auth-register-panel__cta.is-disabled {
    color: #93c5fd;
}

.oauth-divider {
    position: relative;
    text-align: center;
    color: var(--auth-soft);
    font-size: 11px;
    line-height: 1;
}

.oauth-divider::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    border-top: 1px solid var(--auth-line);
}

.oauth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 10px;
    background: var(--auth-surface);
}

.google-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    /* min-height: 56px; */
    padding: 12px 16px;
    border: 1px solid #d4d4d8;
    border-radius: 10px;
    background: #ffffff;
    color: #18181b;
    text-decoration: none;
    font-size: 16px;
    /* font-weight: 600; */
    line-height: 1.2;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06);
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;

}

.google-login-btn:hover,
.google-login-btn:focus-visible {
    background: #fafafa;
    border-color: #d4d4d8;
    color: var(--auth-text);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

.google-login-btn__icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.auth-footer,
.auth-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--auth-muted);
    text-align: center;
}

.auth-note {
    display: none;
}

.auth-switch-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    /* min-height: 56px; */
    padding: 12px 16px;
    border: 1px solid #d4d4d8;
    border-radius: 10px;
    background: #ffffff;
    color: #18181b;
    cursor: pointer;
    font-size: 16px;
    /* font-weight: 600; */
    line-height: 1.2;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06);
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;

}

.auth-switch-button:hover,
.auth-switch-button:focus-visible {
    background: #fafafa;
    border-color: #d4d4d8;
    /* box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10); */

}

.auth-feedback {
    display: none;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.55;
}

.auth-feedback.is-error,
.error-msg {
    color: #b91c1c;
}

.auth-feedback.is-error {
    background: #fef2f2;
    border-color: #fecaca;
}

.auth-feedback.is-success {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

body.auth-page.auth-page--embed {
    background: transparent;
}

html:has(body.auth-page.auth-page--embed) {
    background: transparent;
}

body.auth-page.auth-page--embed .Wrapper,
body.auth-page.auth-page--embed .Wrapper > .content,
body.auth-page.auth-page--embed #Main,
body.auth-page.auth-page--embed .auth-stage {
    min-height: auto;
    background: transparent;

}

body.auth-page.auth-page--embed .site-messages {
    width: 100%;
    margin: 0 0 16px;
}

body.auth-page.auth-page--embed .auth-stage {
    padding: 0;
}

body.auth-page.auth-page--embed .main-content {
    width: 100%;
}

@media (max-width: 767px) {
    body.auth-page {
        /* background: #edf5ff; */
    
    }

    body.auth-page .site-messages {
        width: calc(100vw - 32px);
        margin-top: 16px;
    }

    .auth-stage {
        align-items: flex-start;
        padding: 12px;
    }

    .main-content {
        --auth-card-radius: 32px;
        width: 100%;
        padding: 28px 20px 24px;
        border: 1px solid #e5e7eb;
        border-radius: var(--auth-card-radius);
        background: #ffffff;
        box-shadow: 0 18px 32px rgba(15, 23, 42, 0.10);
    }

    .auth-register-panel {
        margin-left: -20px;
        margin-right: -20px;
        margin-bottom: 0;
    }

    .auth-register-panel__body {
        padding-left: 20px;
        padding-right: 20px;
        border-bottom-left-radius: 28px;
        border-bottom-right-radius: 28px;
    }

    .auth-register-panel__cta {
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 32px;
    
    }

    .oauth-divider span {
        background: #ffffff;
    }
}

@media (max-width: 480px) {
    .auth-title {
        font-size: 28px;
    }

    .auth-inline {
        grid-template-columns: 1fr;
    }

    .form-button--secondary {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .auth-stage {
        padding: 12px;
    }

    .auth-title {
        font-size: 25px;
    }
}

body.auth-page.auth-page--embed .auth-stage {
    min-height: auto;
    padding: 0;
}

body.auth-page.auth-page--embed .main-content {
    --auth-card-radius: 36px;
    width: 100%;
    max-width: 384px;
    margin: 0 auto;
    /* padding: 34px 24px 24px; */
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: none;

}

body.auth-page.auth-page--embed .oauth-divider span {
    background: var(--auth-surface);
}
