.login-dialog[hidden],
.login-dialog [hidden] { display: none !important; }
body.login-dialog-open { overflow: hidden; }
.login-dialog {
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    align-items: safe center;
    justify-content: center;
    padding: 28px 18px;
    background: #020611b8;
    backdrop-filter: blur(10px);
    color-scheme: light;
    color: #222820;
}
.login-dialog-panel {
    position: relative;
    width: min(460px, 100%);
    flex-shrink: 0;
    margin-block: auto;
    background: #fff;
    border: 1px solid #e3e6ec;
    border-radius: 22px;
    box-shadow: 0 28px 100px #0005;
}
.login-dialog-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #70798b;
    font-size: 26px;
    cursor: pointer;
}
.login-dialog-close:hover { background: #f0f3f8; color: #172239; }
.login-dialog .login-card { padding: 44px 48px 36px; }
.login-dialog h2 { margin: 0; font-size: 24px; line-height: 1.35; letter-spacing: -.7px; font-weight: 650; }
.login-dialog button, .login-dialog input, .login-dialog select { font: inherit; }
.login-dialog button { cursor: pointer; }
.login-dialog button:disabled { cursor: wait; opacity: .6; }
.login-dialog .field { margin-block: 24px; }
.login-dialog label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; }
.login-dialog input, .login-dialog select { width: 100%; min-height: 46px; padding: 12px 13px; border: 1px solid #dfe4ed; border-radius: 10px; background: #fcfdff; color: #222820; font-size: 14px; }
.login-dialog input::placeholder { color: #a0a7b4; }
.login-dialog input:focus, .login-dialog select:focus { outline: 2px solid #5083ee; outline-offset: 1px; }
.login-dialog .code-row { display: flex; gap: 8px; }
.login-dialog .code-row input { min-width: 0; flex: 1; }
.login-dialog .code-row button { font-weight: 500; white-space: nowrap; border: 1px solid #dfe4ed; border-radius: 9px; background: white; color: #32435c; padding-inline: 12px; font-size: 12px; }
.login-dialog .login-submit { width: 100%; min-height: 48px; padding: 13px; border: 0; border-radius: 10px; background: #2563eb; color: white; font-weight: 600; }
.login-dialog .login-submit:hover { background: #1d4ed8; }
.login-dialog .login-note { color: #858e9f; text-align: center; font-size: 11px; margin: 12px 0 0; }
.login-dialog .login-message { color: #b63829; margin-top: 12px; font-size: 12px; line-height: 1.6; }
.login-dialog .login-message:empty { display: none; }
.login-dialog .login-message.success { color: #377442; }
.login-dialog .login-divider { display: flex; align-items: center; gap: 13px; color: #929cad; font-size: 11px; margin: 24px 0 18px; }
.login-dialog .login-divider::before, .login-dialog .login-divider::after { content: ""; flex: 1; border-top: 1px solid #e8edf4; }
.login-dialog #retryLoginState { margin-top: 9px; }
.login-dialog .login-options { display: grid; gap: 12px; }
.login-dialog .feishu-login { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; padding: 11px; border: 1px solid #dce5f3; border-radius: 10px; background: white; color: #32435c; font-size: 14px; font-weight: 500; }
.login-dialog .feishu-login:hover { background: #f5f8ff; border-color: #a8c4f7; }
.login-dialog #loginLoading { color: #68758a; font-size: 14px; padding-block: 16px; }
@media (max-width: 480px) {
    .login-dialog { padding: 16px 12px; }
    .login-dialog .login-card { padding: 42px 28px 28px; }
    .login-dialog h2 { font-size: 22px; }
}

.login-dialog .field-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.login-dialog .field-heading label { margin: 0; }
.login-dialog .mode-switch { border: 0; background: transparent; padding: 4px 0; color: #2563eb; font-size: 12px; }
.login-dialog .mode-switch:hover { color: #1d4ed8; text-decoration: underline; }
/* Reserve the suffix and hint areas so account recognition cannot resize the dialog. */
.login-dialog .account-row { position: relative; }
.login-dialog .account-row input { width: 100%; height: 48px; padding-right: 118px; }
.login-dialog .country-picker {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 104px;
    height: 34px;
    border-radius: 7px;
    background: #f1f4f9;
    color: #46536a;
    transition: background .15s;
}
.login-dialog .country-picker:hover { background: #e7edf7; }
.login-dialog .country-picker:focus-within { outline: 2px solid #5083ee; outline-offset: 2px; }
.login-dialog .country-display { display: flex; align-items: center; justify-content: center; gap: 6px; height: 100%; font-size: 12px; font-weight: 500; }
.login-dialog .country-flag { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 17px; line-height: 1; letter-spacing: -2px; }
.login-dialog .country-display svg { width: 14px; height: 14px; color: #8793a7; }
/* Keep the native picker for keyboard navigation and mobile platform menus. */
.login-dialog .country-picker select { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; opacity: 0; cursor: pointer; }
.login-dialog .country-picker:has(select:disabled) { opacity: .6; }
.login-dialog .account-hint { height: 20px; margin: 7px 0 0; color: #68758a; font-size: 12px; line-height: 20px; }
