/* Class rep vote. Phone first; light and dark follow the device. No outside fonts or files. */
:root {
    --bg: #f4f7f5;
    --surface: #ffffff;
    --text: #13231b;
    --muted: #5b6b63;
    --line: #dde6e0;
    --brand: #0f7a4d;
    --brand-strong: #0a5c3a;
    --brand-soft: #e3f3ea;
    --gold: #f2b01e;
    --danger: #c2372e;
    --warn-bg: #fff4d6;
    --warn-text: #6b4e00;
    --ok-bg: #e3f3ea;
    --error-bg: #fde8e6;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 20px rgba(0, 0, 0, .06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1512;
        --surface: #15211c;
        --text: #e7efe9;
        --muted: #9db0a5;
        --line: #263a31;
        --brand: #2fb67a;
        --brand-strong: #49c98e;
        --brand-soft: #173a2a;
        --warn-bg: #3a2f0f;
        --warn-text: #f4d98a;
        --ok-bg: #173a2a;
        --error-bg: #3d1a17;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .3);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand); }
h1, h2 { line-height: 1.2; margin: 0 0 .5rem; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 440px; }
.center { text-align: center; padding-top: 4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* hero */
.hero {
    background: linear-gradient(135deg, #0a5c3a 0%, #0f7a4d 55%, #138a58 100%);
    color: #fff;
    padding: 3rem 0 2.5rem;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(242, 176, 30, .35), transparent 70%);
}
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; letter-spacing: -.02em; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--gold); margin: 0 0 .5rem; }
.lead { max-width: 560px; font-size: 1.1rem; opacity: .95; margin: 0 0 1.25rem; }
.lead strong { color: var(--gold); }
.pill { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .85rem; border-radius: 999px; font-weight: 600; font-size: .9rem; margin: 0; }
.pill-open { background: rgba(255, 255, 255, .15); }
.pill-closed { background: rgba(0, 0, 0, .25); }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: #8df0bd; }
.pill-closed .dot { background: #f2a3a3; }

/* how it works */
.steps { list-style: none; padding: 0; margin: -1.25rem 0 2rem; display: grid; gap: .75rem; grid-template-columns: 1fr; position: relative; }
.steps li { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .85rem 1rem; display: flex; align-items: center; gap: .75rem; font-weight: 500; }
.steps span { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* class reps */
.grid { list-style: none; padding: 0; margin: 0 0 3rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 720px) { .grid { gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease; }
.card:hover { transform: translateY(-2px); }
.avatar { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block; background: var(--brand-soft); }
.avatar-initials { display: grid; place-items: center; font-size: clamp(2.2rem, 9vw, 3.5rem); font-weight: 800; color: var(--brand); }
.card-body { padding: 1rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.card-body { padding: .85rem; }
.card-body h2 { font-size: 1.05rem; margin: 0; overflow-wrap: anywhere; }
.card-body p { margin: 0 0 .75rem; }
.card-body .btn { margin-top: auto; }
.empty { text-align: center; color: var(--muted); padding: 3rem 0; }

/* buttons and fields */
.btn {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: .75rem 1.1rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}
.btn:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid currentColor; }
.btn-block { width: 100%; }
.btn-small { padding: .35rem .7rem; font-size: .85rem; }
label { display: block; font-weight: 600; margin: 1rem 0 .35rem; }
input[type=text], input[type=tel], input[type=number], input[type=password], input[type=file] {
    width: 100%;
    padding: .75rem .85rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}
.hint { color: var(--muted); font-size: .85rem; margin: .35rem 0 0; }

/* vote dialog */
.dialog { border: 0; border-radius: 18px; padding: 0; width: min(100% - 32px, 420px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.dialog::backdrop { background: rgba(6, 20, 13, .6); }
.dialog-body { padding: 1.5rem; position: relative; }
.dialog-body h2 { font-size: 1.25rem; padding-right: 2rem; }
.close { position: absolute; top: .75rem; right: .75rem; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 0; background: var(--bg); color: var(--text); font-size: 1.4rem; cursor: pointer; }
.stepper { display: grid; grid-template-columns: 3rem 1fr 3rem; gap: .5rem; }
.stepper input { text-align: center; font-size: 1.2rem; font-weight: 700; }
.stepper .btn { font-size: 1.4rem; padding: 0; }
.total { margin: .75rem 0 0; font-size: 1.05rem; }
.message { min-height: 1.5rem; margin: 1rem 0 .5rem; font-weight: 600; }
.message.is-error { color: var(--danger); }
.message.is-ok { color: var(--brand); }
.message.is-wait::before { content: ""; display: inline-block; width: .9rem; height: .9rem; margin-right: .5rem; vertical-align: -2px; border: 2px solid var(--brand); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .message.is-wait::before { animation: none; } .card { transition: none; } }
.fine { color: var(--muted); font-size: .8rem; margin: .75rem 0 0; }

.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 16px; }
.error-code { font-size: 4rem; color: var(--brand); margin: 0; }

/* admin */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .75rem; padding-bottom: .75rem; flex-wrap: wrap; }
.topbar-nav { display: flex; align-items: center; gap: 1rem; }
.topbar-nav form { margin: 0; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.panel h2 { font-size: 1.15rem; }
.panel form .btn-primary { margin-top: 1.25rem; }
.login { margin-top: 4rem; }
.login h1 { font-size: 1.5rem; }
.two-cols { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.two-cols .panel { margin-bottom: 0; }
.two-cols { margin-bottom: 1.25rem; }
@media (min-width: 860px) { .two-cols { grid-template-columns: 1fr 1fr; } }
.stats { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1.25rem; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.stat span { display: block; color: var(--muted); font-size: .85rem; }
.stat strong { font-size: 1.4rem; }
.stat .ok { color: var(--brand); }
.stat .off { color: var(--danger); }
.alert { padding: .75rem 1rem; border-radius: 10px; margin: 0 0 1rem; font-weight: 500; }
.alert-ok { background: var(--ok-bg); }
.alert-error { background: var(--error-bg); color: var(--danger); }
.alert-warn { background: var(--warn-bg); color: var(--warn-text); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.num { text-align: right; white-space: nowrap; }
.share { min-width: 140px; }
progress { width: 100px; height: .6rem; vertical-align: middle; accent-color: var(--brand); }
.actions { white-space: nowrap; text-align: right; }
.actions form { display: inline; margin: 0; }
.is-hidden td { opacity: .6; }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--bg); color: var(--muted); }
.tag-paid { background: var(--ok-bg); color: var(--brand); }
.tag-failed { background: var(--error-bg); color: var(--danger); }
.tag-pending { background: var(--warn-bg); color: var(--warn-text); }
.switch { display: flex; align-items: center; gap: .6rem; margin-top: 1.25rem; cursor: pointer; }
.switch input { width: 1.2rem; height: 1.2rem; accent-color: var(--brand); }
.log { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.log li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
