:root {
    color-scheme: light dark;
    --bg: #f4f5f7;
    --card: #fff;
    --text: #1d2330;
    --muted: #596176;
    --line: #cfd4de;
    --accent: #1f5fbf;
    --accent-text: #fff;
    --danger: #a4262c;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12151c;
        --card: #1b202b;
        --text: #e8ebf2;
        --muted: #a2abbd;
        --line: #343c4d;
        --accent: #6aa0f0;
        --accent-text: #0c1220;
        --danger: #ff8b8f;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, sans-serif;
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    padding: 2rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.auth-card h1 { margin: 0 0 1rem; font-size: 1.4rem; }
.auth-card p { margin: 0 0 1rem; }
.auth-card .muted { color: var(--muted); font-size: .9rem; }

label { display: block; margin-bottom: .25rem; font-weight: 600; }

input[type="text"], input[type="email"], input[type="password"] {
    width: 100%;
    padding: .6rem .7rem;
    margin-bottom: 1rem;
    font: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
}

input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

button, .button {
    display: inline-block;
    width: 100%;
    padding: .65rem 1rem;
    font: inherit;
    font-weight: 600;
    color: var(--accent-text);
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.error { padding: .6rem .8rem; margin-bottom: 1rem; color: var(--danger); border: 1px solid var(--danger); border-radius: 6px; }
.qr { display: grid; place-items: center; margin-bottom: 1rem; padding: .5rem; background: #fff; border-radius: 6px; }
.qr img { width: 14rem; height: 14rem; }
code.key { display: block; margin-bottom: 1rem; padding: .5rem; overflow-wrap: anywhere; background: var(--bg); border-radius: 6px; font-size: .95rem; }
ul.codes { margin: 0 0 1rem; padding: 0; columns: 2; list-style: none; font-family: ui-monospace, monospace; font-size: 1.05rem; }
ul.codes li { padding: .15rem 0; }
.logout { display: block; margin-top: 1rem; text-align: center; color: var(--muted); }
