* {
    box-sizing: border-box;
}

:root {
    --auth-bg: #f6f7fb;
    --auth-panel: #ffffff;
    --auth-text: #172033;
    --auth-muted: #667085;
    --auth-accent: #2f6fed;
    --auth-accent-dark: #2458bd;
    --auth-border: #d9e0ec;
    --auth-danger-bg: #fff1f2;
    --auth-danger: #b42318;
    --auth-success-bg: #ecfdf3;
    --auth-success: #067647;
    --auth-shadow: 0 16px 42px rgba(23, 32, 51, 0.12);
}

[data-theme="dark"] {
    --auth-bg: #10151f;
    --auth-panel: #171f2d;
    --auth-text: #eef3fb;
    --auth-muted: #a8b3c4;
    --auth-accent: #7aa2ff;
    --auth-accent-dark: #5f85df;
    --auth-border: #2c384c;
    --auth-danger-bg: #3a1720;
    --auth-danger: #ffb4b4;
    --auth-success-bg: #0f2f22;
    --auth-success: #8be0b2;
    --auth-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(47, 111, 237, 0.08), transparent 34%),
        linear-gradient(315deg, rgba(6, 118, 71, 0.08), transparent 30%),
        var(--auth-bg);
    color: var(--auth-text);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.auth-shell {
    width: min(100%, 440px);
}

.auth-card {
    width: 100%;
    padding: 36px 32px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: var(--auth-panel);
    box-shadow: var(--auth-shadow);
}

.auth-title {
    margin: 0 0 8px;
    color: var(--auth-text);
    font-size: 1.8rem;
    line-height: 1.2;
    text-align: center;
}

.auth-subtitle {
    margin: 0 0 28px;
    color: var(--auth-muted);
    font-size: 0.95rem;
    text-align: center;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field label {
    color: var(--auth-text);
    font-size: 0.94rem;
    font-weight: 650;
}

.auth-field input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    outline: none;
    background: var(--auth-panel);
    color: var(--auth-text);
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-field input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.12);
}

.auth-button {
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    background: var(--auth-accent);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.auth-button:hover {
    background: var(--auth-accent-dark);
}

.auth-button:active {
    transform: translateY(1px);
}

.auth-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.auth-message {
    display: none;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.auth-message.is-visible {
    display: block;
}

.auth-message.is-error {
    background: var(--auth-danger-bg);
    color: var(--auth-danger);
}

.auth-message.is-success {
    background: var(--auth-success-bg);
    color: var(--auth-success);
}

.auth-link-row {
    margin-top: 22px;
    color: var(--auth-muted);
    font-size: 0.92rem;
    text-align: center;
}

.auth-link-row a {
    color: var(--auth-accent);
    font-weight: 650;
    text-decoration: none;
}

.auth-link-row a:hover {
    text-decoration: underline;
}

@media (max-width: 520px) {
    body {
        padding: 16px;
    }

    .auth-card {
        padding: 28px 22px;
    }
}
