:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --border: #d8dce3;
    --text: #1c1f24;
    --muted: #6b7280;
    --accent: #2563eb;
    --error-bg: #fdecec;
    --error-text: #a4231e;
    --success-bg: #e9f6ec;
    --success-text: #1c6b33;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 2rem 1rem;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body.centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.card {
    width: 100%;
    max-width: 34rem;
    margin: 0 auto;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

h1 {
    margin: 0 0 1.25rem;
    font-size: 1.375rem;
}

h2 {
    margin: 0 0 .5rem;
    font-size: 1rem;
}

label {
    display: block;
    margin-bottom: .35rem;
    font-weight: 600;
    font-size: .875rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    margin-bottom: 1rem;
    padding: .625rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    color: inherit;
}

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

button {
    padding: .625rem 1.125rem;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: .9375rem;
    font-weight: 600;
    cursor: pointer;
}

button:hover { filter: brightness(1.08); }

button.link {
    padding: 0;
    background: none;
    color: var(--muted);
    font-weight: 400;
    text-decoration: underline;
}

.muted {
    color: var(--muted);
    font-size: .875rem;
}

.alert {
    margin: 0 0 1rem;
    padding: .625rem .875rem;
    border-radius: 8px;
    font-size: .9375rem;
}

.alert.error { background: var(--error-bg); color: var(--error-text); }
.alert.success { background: var(--success-bg); color: var(--success-text); }

.panel {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.panel summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
}

.panel summary + form { margin-top: 1rem; }

code {
    display: inline-block;
    padding: .25rem .5rem;
    background: var(--bg);
    border-radius: 6px;
    font-size: .875rem;
    word-break: break-all;
}

.logout {
    margin-top: 1.5rem;
    text-align: right;
}

a { color: var(--accent); }

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14161a;
        --surface: #1d2026;
        --border: #333944;
        --text: #e7e9ee;
        --muted: #9aa3b2;
        --accent: #5b8cff;
        --error-bg: #3a1f1f;
        --error-text: #ffb4b0;
        --success-bg: #1c3324;
        --success-text: #8fe0a8;
    }

    input[type="text"],
    input[type="password"] { background: #14161a; }
}
