:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --border: #2d3a4f;
    --text: #e8edf4;
    --muted: #8b9cb3;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --error: #ef4444;
    --warn: #f59e0b;
    --radius: 12px;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background: linear-gradient(160deg, #0f1419 0%, #1a1f35 50%, #0f1419 100%);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.container-wide {
    max-width: 900px;
}

.header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.subtitle {
    margin: 0 0 1.5rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.subtitle a {
    color: var(--primary);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.auth-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-weight: 600;
}

.badge-ok {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-warn {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warn);
}

.form label {
    display: block;
    margin: 1rem 0 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
}

.form label:first-of-type {
    margin-top: 0;
}

input[type="text"],
input[type="url"],
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0f1419;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0.75rem 0 0;
}

.hint.warn {
    color: var(--warn);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #3d4f6a;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--muted);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.85rem;
    font-size: 1rem;
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.preview-pane {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.preview-pane h2 {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-preview {
    background: #0f1419;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    max-height: 420px;
    overflow-y: auto;
}

.article-preview h2,
.article-preview h3 {
    margin-top: 1.25rem;
}

.article-preview a {
    color: var(--primary);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.hidden {
    display: none;
}
