:root {
    --bg: #f7f7f5;
    --bg-elevated: #ffffff;
    --text: #1c1c1a;
    --text-muted: #6b6b66;
    --border: #ddddd8;
    --accent: #2f6f4f;
    --green: #2f8f4f;
    --red: #b5432b;
    --shadow: 0 1px 2px rgba(0,0,0,0.06);
    --radius: 6px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #17181a;
        --bg-elevated: #212226;
        --text: #eceeec;
        --text-muted: #9a9c9a;
        --border: #34363a;
        --accent: #6fbf8f;
        --green: #6fbf8f;
        --red: #e08872;
        --shadow: 0 1px 2px rgba(0,0,0,0.4);
    }
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}
.auth-card {
    width: 100%;
    max-width: 340px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
    box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 18px; margin: 0 0 4px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.auth-card label { font-size: 13px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.auth-card input {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}
.auth-card button {
    margin-top: 4px;
    padding: 9px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}
.auth-card .error { color: var(--red); font-size: 13px; }
.auth-card .success { color: var(--green); font-size: 13px; }
.auth-card .auth-hint { color: var(--text-muted); font-size: 12px; margin: 0; line-height: 1.5; }
.auth-card .auth-check { flex-direction: row; align-items: center; gap: 8px; }
.auth-card .auth-check input { width: auto; }
.auth-card .auth-qr { align-self: center; background: #fff; padding: 8px; border-radius: 6px; line-height: 0; }
.auth-card .auth-button { display: inline-block; margin-top: 12px; padding: 8px 14px; border-radius: 6px; background: var(--accent); color: #fff; text-decoration: none; font-size: 14px; }
.auth-card code { font-size: 12px; word-break: break-all; }
.recovery-codes {
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: 0.05em;
    background: rgba(127,127,127,.12);
    padding: 12px;
    border-radius: 6px;
    user-select: all;
}
@media (max-width: 720px) {
    .auth-card input[type="text"], .auth-card input[type="password"] { font-size: 16px; min-height: 44px; }
    .auth-card button { min-height: 44px; font-size: 14px; }
    .auth-card label.auth-check { min-height: 44px; }
    .auth-card input[type="checkbox"] { width: 22px; height: 22px; flex-shrink: 0; }
}
