:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface-bg: #ffffff;
    --input-bg: #ffffff;
    --text: #17202a;
    --text-muted: #52606d;
    --border: #d9e2ec;
    --input-border: #bcccdc;
    --button-bg: #1b4d8c;
    --button-hover: #163f72;
    --button-text: #ffffff;
    --link-color: #1b4d8c;
    --link-hover: #163f72;
    --message-bg: #eef5ff;
    --message-border: #bfd3f2;
    --badge-bg: #d9f2e3;
    --badge-text: #17603a;
}

.light-theme {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface-bg: #ffffff;
    --input-bg: #ffffff;
    --text: #17202a;
    --text-muted: #52606d;
    --border: #d9e2ec;
    --input-border: #bcccdc;
    --button-bg: #1b4d8c;
    --button-hover: #163f72;
    --button-text: #ffffff;
    --link-color: #1b4d8c;
    --link-hover: #163f72;
    --message-bg: #eef5ff;
    --message-border: #bfd3f2;
    --badge-bg: #d9f2e3;
    --badge-text: #17603a;
}

.dark-theme {
    color-scheme: dark;
    --bg: #121212;
    --surface-bg: #2a2a2a;
    --input-bg: #2a2a2a;
    --text: #eaeaea;
    --text-muted: rgba(234, 234, 234, 0.75);
    --border: #444;
    --input-border: #444;
    --button-bg: #1b4d8c;
    --button-hover: #2561ad;
    --button-text: #ffffff;
    --link-color: #4fc3f7;
    --link-hover: #81d4fa;
    --message-bg: #1d2b3a;
    --message-border: #36506b;
    --badge-bg: #244d38;
    --badge-text: #c8f2d8;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    color: var(--text);
    background: var(--bg);
}

header {
    background: var(--surface-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

header h1 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
}

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

a:hover {
    color: var(--link-hover);
}

header a {
    text-decoration: none;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

main {
    max-width: 860px;
    margin: 0 auto;
    padding: 1.5rem;
}

.panel,
.card {
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.field-group {
    margin-bottom: 0.9rem;
}

.field-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.field-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
}

.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.messages li {
    background: var(--message-bg);
    border: 1px solid var(--message-border);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.6rem;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--badge-bg);
    color: var(--badge-text);
    font-size: 0.9rem;
    font-weight: 600;
}

button,
input[type="submit"] {
    background: var(--button-bg);
    color: var(--button-text);
    border: 0;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
    background: var(--button-hover);
}

button + button {
    margin-left: 0.5rem;
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.65rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font: inherit;
    color: var(--text);
    background: var(--input-bg);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

ul {
    padding-left: 1.2rem;
}

@media (max-width: 640px) {
    main {
        padding: 1rem;
    }

    button,
    input[type="submit"] {
        width: 100%;
        margin: 0.35rem 0 0;
    }

    button + button {
        margin-left: 0;
    }
}
