:root {
    color-scheme: dark;
    --bg: #1a1d21;
    --card-bg: #22262b;
    --border: #33383f;
    --text: #e6e8eb;
    --text-muted: #9aa1a9;
    --accent: #3498db;
    --accent-hover: #2f85c1;
    --success: #57f287;
    --error: #ed4245;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    padding: 24px;
}

header {
    max-width: 900px;
    margin: 0 auto 24px;
}

header h1 {
    margin: 0 0 4px;
    font-size: 1.5rem;
}

.subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

main {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.card h2 {
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.field-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.field-row label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"] {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.95rem;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: 2px solid var(--accent);
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
}

button:hover:not(:disabled) {
    background: var(--accent-hover);
}

button:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.status {
    font-size: 0.85rem;
}

.status.success {
    color: var(--success);
}

.status.error {
    color: var(--error);
}

.hint {
    margin: 12px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hint code {
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 4px;
}

#config-editor {
    width: 100%;
    min-height: 420px;
    margin-top: 16px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
}

@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
        --bg: #f5f6f7;
        --card-bg: #ffffff;
        --border: #dcdfe3;
        --text: #1a1d21;
        --text-muted: #5c636b;
    }
}
