:root {
    color-scheme: light;
    --background: #f1f5f9;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #cbd5e1;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --success: #15803d;
    --shadow: 0 12px 32px rgba(15, 23, 42, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.page {
    width: min(94%, 1200px);
    margin: 0 auto;
    padding: 28px 0 48px;
}

.login-page {
    width: min(92%, 460px);
    margin: 0 auto;
    padding: 64px 0;
}

.card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card h1,
.card h2 {
    margin-top: 0;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 2px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 17px;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    background: var(--primary);
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

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

.button-secondary {
    color: var(--text);
    background: #e2e8f0;
}

.button-danger {
    background: var(--danger);
}

.message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 10px;
}

.message-error {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.message-success {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.muted {
    color: var(--text-muted);
}

.site-header {
    background: #0f172a;
    color: #ffffff;
}

.site-header-inner {
    width: min(94%, 1200px);
    margin: 0 auto;
    padding: 15px 0;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.site-title {
    font-weight: 800;
}

.navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.navigation a {
    padding: 8px 10px;
    border-radius: 8px;
    color: #e2e8f0;
    text-decoration: none;
}

.navigation a:hover {
    background: #334155;
}

@media (max-width: 640px) {
    .site-header-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .card {
        padding: 18px;
    }

    .login-page {
        padding-top: 32px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --background: #020617;
        --surface: #0f172a;
        --surface-muted: #1e293b;
        --text: #e2e8f0;
        --text-muted: #94a3b8;
        --border: #334155;
        --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    }

    .button-secondary {
        color: #e2e8f0;
        background: #334155;
    }

    .message-error {
        color: #fecaca;
        background: #450a0a;
        border-color: #7f1d1d;
    }

    .message-success {
        color: #bbf7d0;
        background: #052e16;
        border-color: #166534;
    }
}