/* Shared login / register — modal on blurred dark backdrop */
:root {
    --auth-bg: #0f172a;
    --auth-overlay: rgba(15, 23, 42, 0.55);
    --auth-card: #ffffff;
    --auth-title: #0f172a;
    --auth-muted: #94a3b8;
    --auth-text: #475569;
    --auth-border: #e2e8f0;
    --auth-link: #2563eb;
    --auth-primary: #38bdf8;
    --auth-primary-hover: #0ea5e9;
    --auth-primary-text: #ffffff;
    --auth-wechat-bg: #f8fafc;
    --auth-wechat-border: #e2e8f0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.auth-shell {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--auth-bg);
    color: var(--auth-text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
}

.auth-backdrop {
    position: fixed;
    inset: 0;
    background: var(--auth-overlay);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 0;
}

.auth-modal {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--auth-card);
    border-radius: 16px;
    padding: 28px 28px 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.auth-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.auth-head {
    padding-right: 44px;
    margin-bottom: 22px;
}

.auth-title {
    margin: 0 0 10px;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--auth-title);
    letter-spacing: -0.02em;
}

.auth-sub {
    margin: 0;
    font-size: 0.875rem;
    color: var(--auth-muted);
    line-height: 1.5;
}

.auth-sub a {
    color: var(--auth-link);
    text-decoration: none;
    font-weight: 500;
}

.auth-sub a:hover {
    text-decoration: underline;
}

.auth-sub .arrow {
    display: inline-block;
    margin-left: 2px;
    font-size: 0.9em;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--auth-muted);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.9375rem;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    font-family: inherit;
    color: var(--auth-title);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder {
    color: #cbd5e1;
}

.auth-input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.auth-row-split {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.auth-row-split .auth-input {
    flex: 1;
    min-width: 0;
}

.auth-code-btn {
    flex-shrink: 0;
    padding: 0 14px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-link);
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.15s ease;
}

.auth-code-btn:hover:not(:disabled) {
    background: #f8fafc;
}

.auth-code-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    color: var(--auth-muted);
}

.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.8125rem;
    margin-bottom: 16px;
    line-height: 1.45;
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--auth-primary-text);
    background: linear-gradient(180deg, #7dd3fc 0%, var(--auth-primary) 100%);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
    transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.auth-submit:hover {
    background: linear-gradient(180deg, #bae6fd 0%, var(--auth-primary-hover) 100%);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.auth-submit:active {
    transform: scale(0.99);
}

.auth-terms {
    margin: 16px 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--auth-muted);
    line-height: 1.5;
}

.auth-terms a {
    color: var(--auth-link);
    text-decoration: none;
}

.auth-terms a:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    color: var(--auth-muted);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-oauth {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.auth-oauth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--auth-wechat-border);
    border-radius: 8px;
    background: var(--auth-wechat-bg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-title);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}

.auth-oauth-main:hover {
    background: #f1f5f9;
}

.auth-oauth-main:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.auth-oauth-icon {
    width: 44px;
    flex-shrink: 0;
    border: 1px solid var(--auth-wechat-border);
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-link);
    text-decoration: none;
    font-size: 1.1rem;
}

.auth-oauth-icon:hover {
    background: #f8fafc;
}

.wechat-fake {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #07c160;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
