:root {
    color-scheme: light;
    --bg-main: #f0f2f5;
    --card: #ffffff;
    --text: #111111;
    --border: #d5d9df;
    --accent: #1877f2;
    --accent-dark: #0f4aa3;
    --auth-link: #174ea6;
    --auth-link-hover: #103b80;
    --auth-focus: #174ea6;
    --auth-hover: #e9edf3;
    --auth-error: #b42318;
}
html[data-auth-theme="purple"] {
    --bg-main: #100b17;
    --card: #181818;
    --text: #ffffff;
    --border: #55505c;
    --accent: #8c46dc;
    --accent-dark: #5a23a0;
    --auth-link: #d8b4fe;
    --auth-link-hover: #ecd9ff;
    --auth-focus: #d8b4fe;
    --auth-hover: #30243d;
    --auth-error: #ffb4ab;
}
html[data-auth-theme="blue"] {
    --bg-main: #0b101c;
    --card: #181818;
    --text: #ffffff;
    --border: #485366;
    --accent: #336be0;
    --accent-dark: #14284a;
    --auth-link: #a8c7fa;
    --auth-link-hover: #d3e3fd;
    --auth-focus: #a8c7fa;
    --auth-hover: #202e46;
    --auth-error: #ffb4ab;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100dvh;
    padding: 120px 20px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text);
}
.auth-card {
    width: 470px;
    max-width: 100%;
    padding: 45px;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: var(--card);
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.register-box { width: 380px; }
.auth-card h2 { margin: 0 0 25px; font-size: 28px; }
.register-box h2 { text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #b8bec7;
    border-radius: 10px;
    background: #f5f6f7;
    color: #111111;
    font: inherit;
    font-size: 16px;
}
.auth-form input::placeholder { color: #59616d; opacity: 1; }
.auth-form input:focus { outline: 2px solid #365bad; outline-offset: -3px; }
.auth-submit {
    width: 100%;
    margin-top: 10px;
    padding: 16px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.auth-submit:hover { background: var(--accent-dark); }
.auth-link { display: block; width: fit-content; margin: 18px auto 0; color: var(--auth-link); text-align: center; text-underline-offset: 3px; }
.auth-link:hover { color: var(--auth-link-hover); text-decoration-thickness: 2px; }
.auth-submit:focus-visible, .auth-link:focus-visible, .auth-theme-option:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 4px; }
.error { color: var(--auth-error); background: color-mix(in srgb, var(--auth-error) 8%, var(--card)); padding: 12px; border-radius: 12px; text-align: center; font-weight: 600; }
.auth-themes { position: absolute; top: 16px; left: 16px; display: flex; gap: 8px; }
.auth-theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 80px;
    padding: 10px 8px;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.auth-theme-option:hover { background: var(--auth-hover); }
.auth-theme-option[aria-pressed="true"] { border-color: var(--auth-focus); }
.auth-swatch { width: 30px; height: 30px; border: 1px solid #77808f; border-radius: 50%; }
.auth-swatch-light { background: #f0f2f5; }
.auth-swatch-purple { background: #8c46dc; }
.auth-swatch-blue { background: #336be0; }
@media(max-width: 768px) {
    body { padding: 125px 20px 32px; }
    .auth-card { width: 380px; padding: 36px 28px; border-radius: 26px; }
}
