/* Rondi — shared stylesheet */

:root {
    --bg: #f7f7f5;
    --card: #ffffff;
    --ink: #1f2328;
    --muted: #656d76;
    --line: #d8dce0;
    --accent: #3b6ea5;
    --accent-dark: #2c5580;
    --ok-bg: #e7f4ea;
    --ok-ink: #1c5a2e;
    --err-bg: #fbe9e9;
    --err-ink: #8a1f1f;
    --warn: #b45309;
    --danger: #b02a2a;
    --danger-dark: #8a1f1f;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 20px 64px;
}

h1 {
    font-size: 1.6rem;
    margin: 0 0 4px;
}

h2 {
    font-size: 1.15rem;
    margin: 32px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
}

p { margin: 10px 0; }

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

code {
    background: #eef0f2;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    word-break: break-all;
}

/* --- Status messages --- */
.ok, .error {
    padding: 10px 14px;
    border-radius: 6px;
    margin: 14px 0;
    border: 1px solid transparent;
}
.ok {
    background: var(--ok-bg);
    color: var(--ok-ink);
    border-color: #b8dcc2;
}
.error {
    background: var(--err-bg);
    color: var(--err-ink);
    border-color: #eec2c2;
}

/* --- Forms --- */
label {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
input:not([type]),
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    color: var(--ink);
    background: var(--card);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 110, 165, 0.15);
}

textarea { resize: vertical; }

button {
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    cursor: pointer;
    margin-top: 6px;
}
button:hover { background: var(--accent-dark); }

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

th {
    background: #eef1f4;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #fafbfc; }

/* Radio cells in the poll voting grid — centered, tappable */
td input[type="radio"] {
    width: auto;
    margin: 0 auto;
    display: block;
    transform: scale(1.15);
}

/* --- Danger zone (admin delete) --- */
h2 + form button[type="submit"],
.danger button {
    background: var(--danger);
}
h2 + form button[type="submit"]:hover,
.danger button:hover {
    background: var(--danger-dark);
}


th, td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
}

/* default alignment applied narrowly, so .vote-grid can override cleanly */
th { text-align: left; }
td { text-align: left; }

.vote-grid th,
.vote-grid td {
    text-align: center !important;
}
.vote-grid th:first-child,
.vote-grid td:first-child {
    text-align: left !important;
}


/* --- Mobile --- */
@media (max-width: 560px) {
    body { padding: 16px 12px 48px; }
    h1 { font-size: 1.35rem; }
    th, td { padding: 7px 8px; }
    table { font-size: 0.9rem; }
}