:root {
    --ink: #1c2733;
    --muted: #5b6b7a;
    --accent: #2b6cb0;
    --accent-dark: #1f4e80;
    --bg: #f4f6f8;
    --card: #ffffff;
    --border: #d9e0e6;
    --ok: #2f855a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
}

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

.site-header {
    background: var(--accent-dark);
    color: #fff;
    padding: 0.6rem 1rem;
}

.nav {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-logo { height: 34px; width: auto; display: block; }

.button {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.55rem 1.1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--accent);
}

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

.button-secondary {
    background: transparent;
    color: var(--accent);
}

.button-secondary:hover { background: #e8f0f8; color: var(--accent-dark); }

/* Landing page */
.hero {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 1.5rem 0 2rem;
}

.hero-logo { width: 220px; height: auto; flex-shrink: 0; }

.hero-text { flex: 1; min-width: 280px; }

.hero-text h1 { margin-top: 0; font-size: 1.9rem; line-height: 1.25; }

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

.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.steps {
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.step h3 { margin: 0 0 0.3rem; font-size: 1rem; color: var(--accent-dark); }

.step p { margin: 0; font-size: 0.95rem; color: var(--muted); }

.example {
    margin-top: 1.2rem;
    padding: 0.7rem 1rem;
    background: #e8f0f8;
    border-radius: 6px;
    color: var(--ink);
}

.features { padding-left: 1.2rem; }

.features li { margin-bottom: 0.4rem; }

.name-note {
    margin-top: 1.2rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-style: italic;
    font-size: 0.95rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.nav-links a { color: #dbe7f3; text-decoration: none; }
.nav-links a:hover { color: #fff; }
.user { color: #aac4de; }

.container {
    max-width: 960px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.site-footer {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.page-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

h1 { font-size: 1.5rem; margin: 0.5rem 0; }
h2 { font-size: 1.1rem; margin-top: 0.25rem; }

.meta { color: var(--muted); font-size: 0.9rem; }
.ok { color: var(--ok); }

.badge {
    display: inline-block;
    background: #e3eaf1;
    color: var(--ink);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.badge-registration { background: #fef3c7; }
.badge-running { background: #d3f4e1; }
.badge-voting { background: #dbeafe; }
.badge-closed { background: #e5e7eb; }
.badge-rep { background: #fde68a; }

.debate-list { list-style: none; padding: 0; }
.debate-list h2 { margin: 0; }

.phases, .groups, .members, .thread, .results { padding-left: 1.2rem; }
.thread { list-style: none; padding-left: 0; }
.message { border-top: 1px solid var(--border); padding: 0.5rem 0; }
.message:first-child { border-top: none; }

.synthesis {
    background: #f0f7ff;
    border-left: 4px solid var(--accent);
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
}

.form p { margin: 0.4rem 0; }
.form label { display: block; }
.form input[type="text"], .form input[type="password"],
.form textarea, .form select {
    width: 100%;
    max-width: 640px;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}

fieldset { border: 1px solid var(--border); border-radius: 6px; margin: 0.5rem 0; }
fieldset label { display: inline-block; margin-right: 1rem; font-weight: normal; }

button, .button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 1rem;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

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

.link-button {
    background: none;
    border: none;
    color: #dbe7f3;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.inline-form { display: inline; }

.messages {
    max-width: 960px;
    margin: 0.75rem auto 0;
    padding: 0 1rem;
    list-style: none;
}

.messages li {
    border-radius: 6px;
    padding: 0.5rem 0.9rem;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.messages .success { background: #d3f4e1; }
.messages .error { background: #fde2e2; }
.messages .info, .messages .warning { background: #fef3c7; }

.errorlist { color: #b91c1c; list-style: none; padding: 0; }

.moderator-panel { border-left: 4px solid var(--accent); }

/* Tabs */
.tabs {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin: 1.2rem 0 0.8rem;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 0.45rem 0.9rem;
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    border-radius: 6px 6px 0 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab:hover { color: var(--accent-dark); background: #e8f0f8; }

.tab.active {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
    background: #e8f0f8;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.8rem;
}

.pagination a { text-decoration: none; font-weight: 600; }

.delete-button {
    color: #b00020;
    font-size: 0.8rem;
    float: right;
}
