/* ==========================================================
   E-Voting — gaya tunggal untuk installer, admin, dan bilik suara.
   Tidak memakai CDN apa pun supaya tetap jalan tanpa internet.

   Catatan perawatan:
   --primary diisi dari menu Pengaturan (lihat partials), jadi warna
   aksen mengikuti pilihan panitia. Turunannya (-gelap/-lembut)
   dihitung dari --primary, bukan ditulis tetap, supaya ikut berubah
   ketika warnanya diganti.
   ========================================================== */

:root {
    --primary: #16a34a;
    --primary-gelap: color-mix(in srgb, var(--primary) 80%, #000);
    --primary-lembut: color-mix(in srgb, var(--primary) 11%, #fff);
    --primary-garis: color-mix(in srgb, var(--primary) 28%, #fff);

    /* Abu-abu diberi sedikit rona hijau agar menyatu dengan aksen. */
    --teks: #0f1f16;
    --teks-redup: #5c7268;
    --garis: #dde7e1;
    --latar: #eef4f0;
    --putih: #ffffff;

    --sukses: #15803d;
    --sukses-lembut: #dcfce7;
    --bahaya: #b91c1c;
    --bahaya-lembut: #fee2e2;
    --peringatan: #92400e;
    --peringatan-lembut: #fef3c7;
    --info: #155e75;
    --info-lembut: #cffafe;

    --radius: 16px;
    --radius-kecil: 11px;
    --bayang: 0 1px 2px rgba(6, 40, 22, .05), 0 10px 30px rgba(6, 40, 22, .07);
    --bayang-kecil: 0 1px 2px rgba(6, 40, 22, .07);
    --bayang-naik: 0 10px 28px rgba(6, 40, 22, .12);
    --font: "Segoe UI", Inter, Roboto, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

    /* Dipakai halaman masuk & bilik suara sebagai latar bergambar. */
    --gedung: url("../img/gedung-latar.jpg");
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--teks);
    background: var(--latar);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-gelap); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.18rem; }
h3 { font-size: 1.02rem; }
p  { margin: 0 0 .75rem; }

code {
    background: #e7efe9;
    color: #14532d;
    padding: .1em .4em;
    border-radius: 6px;
    font-size: .88em;
    font-family: Consolas, "Courier New", monospace;
}

.teks-redup   { color: var(--teks-redup); font-weight: 400; }
.teks-kecil   { font-size: .84rem; }
.teks-tengah  { text-align: center; }
.teks-kanan   { text-align: right; }
.teks-tebal   { font-weight: 650; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .75rem; }
.mt-2 { margin-top: 1.25rem; }
.mb-2 { margin-bottom: 1.25rem; }
.lebar-penuh { width: 100%; }

/* ---------------- Tombol ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .58rem 1.05rem;
    border: 1px solid transparent;
    border-radius: var(--radius-kecil);
    font: inherit;
    font-weight: 650;
    font-size: .92rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .08s, box-shadow .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; }

.btn-primary {
    background: linear-gradient(140deg, var(--primary), var(--primary-gelap));
    color: #fff;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 30%, transparent);
}
.btn-primary:hover {
    background: var(--primary-gelap);
    color: #fff;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 38%, transparent);
}
.btn-ghost { background: var(--putih); color: var(--teks); border-color: var(--garis); }
.btn-ghost:hover { background: #f4f9f6; border-color: var(--primary-garis); }
.btn-bahaya { background: var(--bahaya); color: #fff; }
.btn-bahaya:hover { background: #991b1b; color: #fff; }
.btn-sukses { background: var(--sukses); color: #fff; }
.btn-sukses:hover { background: #166534; color: #fff; }
.btn-kecil { padding: .35rem .65rem; font-size: .82rem; }
.btn-blok { width: 100%; }
.btn-besar { padding: .82rem 1.6rem; font-size: 1.02rem; }

.baris-tombol { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------------- Formulir ---------------- */

label { display: block; font-weight: 650; font-size: .88rem; margin-bottom: .85rem; }

input[type=text], input[type=password], input[type=number], input[type=email],
input[type=datetime-local], input[type=date], input[type=color], input[type=file],
select, textarea {
    display: block;
    width: 100%;
    margin-top: .3rem;
    padding: .58rem .7rem;
    border: 1px solid var(--garis);
    border-radius: var(--radius-kecil);
    background: var(--putih);
    font: inherit;
    font-size: .93rem;
    font-weight: 400;
    color: var(--teks);
    transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
input[type=color] { height: 42px; padding: .2rem; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; accent-color: var(--primary); }

.cek {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-weight: 500;
    margin-bottom: .85rem;
}
.cek input { margin-top: .25rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
@media (max-width: 720px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.judul-bagian {
    margin: 1.4rem 0 .9rem;
    padding-bottom: .45rem;
    border-bottom: 1px solid var(--garis);
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--teks-redup);
}
.judul-bagian:first-of-type { margin-top: .4rem; }

/* ---------------- Notifikasi ---------------- */

.alert {
    padding: .72rem .95rem;
    border-radius: var(--radius-kecil);
    margin-bottom: 1rem;
    font-size: .9rem;
    border: 1px solid transparent;
}
.alert-success { background: var(--sukses-lembut);     color: var(--sukses);     border-color: #bbf7d0; }
.alert-danger  { background: var(--bahaya-lembut);     color: var(--bahaya);     border-color: #fecaca; }
.alert-warning { background: var(--peringatan-lembut); color: var(--peringatan); border-color: #fde68a; }
.alert-info    { background: var(--info-lembut);       color: var(--info);       border-color: #a5f3fc; }

.badge {
    display: inline-block;
    padding: .18rem .58rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.badge-aktif   { background: var(--sukses-lembut);     color: var(--sukses); }
.badge-draft   { background: #e3eae6;                  color: #4b5b52; }
.badge-selesai { background: var(--info-lembut);       color: var(--info); }
.badge-bahaya  { background: var(--bahaya-lembut);     color: var(--bahaya); }
.badge-tunggu  { background: var(--peringatan-lembut); color: var(--peringatan); }

/* ---------------- Halaman masuk / installer ---------------- */

/* Foto gedung dengan selubung hijau; kartunya tetap terang supaya
   semua kolom isian mudah dibaca. */
.halaman-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background-color: #04240f;
    background-image:
        linear-gradient(0deg, rgba(6, 58, 30, .34), rgba(6, 58, 30, .34)),
        linear-gradient(158deg,
            rgba(4, 36, 15, .88) 0%,
            rgba(5, 46, 22, .66) 32%,
            rgba(6, 68, 40, .7) 62%,
            rgba(4, 36, 15, .94) 100%),
        radial-gradient(130% 78% at 50% 0%,
            color-mix(in srgb, var(--primary) 34%, transparent), transparent 64%),
        var(--gedung);
    background-repeat: no-repeat;
    background-position: center, center, center top, center 45%;
    background-size: cover, cover, cover, cover;
    background-attachment: fixed;
}

.kotak-auth {
    position: relative;
    width: 100%;
    max-width: 430px;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: clamp(20px, 2.4vw, 26px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .4), 0 0 0 1px rgba(6, 40, 22, .05);
    padding: 2.4rem 2.1rem 2rem;
    overflow: hidden;
}
/* Pita aksen tipis di bibir atas kartu. */
.kotak-auth::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-gelap), var(--primary), #4ade80);
}
.kotak-auth-lebar { max-width: 660px; }

/* Kolom isian di halaman masuk dibuat sedikit lebih lega: yang diketik
   di sini cuma dua-tiga baris, jadi boleh lebih besar dan mudah dibidik. */
.kotak-auth label { font-size: .85rem; margin-bottom: 1rem; }
.kotak-auth input[type=text],
.kotak-auth input[type=password] {
    padding: .72rem .85rem;
    font-size: 1rem;
    background: #fbfdfc;
}
.kotak-auth input[type=text]:focus,
.kotak-auth input[type=password]:focus { background: #fff; }
.kotak-auth .btn-blok { margin-top: .25rem; }

.auth-brand { text-align: center; margin-bottom: 1.6rem; }
.auth-brand h1 { font-size: 1.38rem; margin-bottom: .3rem; letter-spacing: -.015em; }
.auth-brand p { margin: 0; font-size: .88rem; }

.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto .95rem;
    border-radius: 19px;
    background: linear-gradient(140deg, var(--primary), var(--primary-gelap));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: .02em;
    overflow: hidden;
    box-shadow:
        0 12px 28px color-mix(in srgb, var(--primary) 34%, transparent),
        0 0 0 7px color-mix(in srgb, var(--primary) 9%, transparent);
}
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }

.auth-kaki {
    margin-top: 1.4rem;
    padding-top: 1.05rem;
    border-top: 1px solid var(--garis);
    text-align: center;
    font-size: .84rem;
    color: var(--teks-redup);
}
.auth-kaki a { font-weight: 650; }

/* ---------------- Rangka admin ---------------- */

.layar-admin { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    flex: 0 0 250px;
    background: linear-gradient(185deg, #0b2e1c 0%, #072114 55%, #04180e 100%);
    color: #cfe3d6;
    padding: 1.2rem 0;
    display: flex;
    flex-direction: column;
}
.sidebar-merek {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 0 1.2rem 1.1rem;
    margin-bottom: .6rem;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.sidebar-merek .lambang {
    width: 40px; height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    background: linear-gradient(140deg, var(--primary), var(--primary-gelap));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .9rem;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}
.sidebar-merek .lambang img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-merek strong { color: #fff; font-size: .95rem; display: block; line-height: 1.25; }
.sidebar-merek span { font-size: .74rem; color: #8fae9c; }

.sidebar nav { flex: 1; padding: 0 .7rem; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .75rem;
    margin-bottom: .18rem;
    border-radius: var(--radius-kecil);
    color: #cfe3d6;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar nav a.aktif {
    background: linear-gradient(135deg, var(--primary), var(--primary-gelap));
    color: #fff;
    font-weight: 650;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent);
}
.sidebar nav .label-grup {
    padding: .9rem .75rem .35rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #7f9b8b;
}
.sidebar .ikon { width: 18px; text-align: center; font-size: 1rem; line-height: 1; }

.sidebar-kaki {
    padding: .9rem 1.2rem 0;
    margin-top: .6rem;
    border-top: 1px solid rgba(255, 255, 255, .09);
    font-size: .78rem;
    color: #8fae9c;
}

.konten { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.6rem;
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--garis);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar h1 { font-size: 1.15rem; margin: 0; }
.topbar .sub { font-size: .82rem; color: var(--teks-redup); }
.topbar-kanan { display: flex; align-items: center; gap: .7rem; }
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary-lembut);
    color: var(--primary-gelap);
    border: 1px solid var(--primary-garis);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .8rem;
}

.isi { padding: 1.6rem; flex: 1; }

.tombol-menu {
    display: none;
    background: none;
    border: 1px solid var(--garis);
    border-radius: 9px;
    padding: .35rem .6rem;
    font-size: 1.1rem;
    cursor: pointer;
}

@media (max-width: 960px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.terbuka { transform: translateX(0); }
    .tombol-menu { display: block; }
    .isi { padding: 1rem; }
    .topbar { padding: .8rem 1rem; }
    .tirai { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50; }
}

/* ---------------- Kartu & tabel ---------------- */

.kartu {
    background: var(--putih);
    border: 1px solid var(--garis);
    border-radius: var(--radius);
    box-shadow: var(--bayang-kecil);
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.kartu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .95rem 1.15rem;
    border-bottom: 1px solid var(--garis);
    background: linear-gradient(180deg, #fbfdfc, var(--putih));
}
.kartu-header h2 { margin: 0; font-size: 1rem; }
.kartu-header .sub { font-size: .82rem; color: var(--teks-redup); }
.kartu-isi { padding: 1.15rem; }
.kartu-isi > :last-child { margin-bottom: 0; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.stat {
    position: relative;
    background: var(--putih);
    border: 1px solid var(--garis);
    border-radius: var(--radius);
    padding: 1.05rem 1.15rem;
    box-shadow: var(--bayang-kecil);
    overflow: hidden;
}
/* Garis aksen tipis di tepi kiri tiap kartu angka. */
.stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--primary-gelap));
}
.stat .judul {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--teks-redup);
    font-weight: 700;
}
.stat .angka { font-size: 1.9rem; font-weight: 800; line-height: 1.15; margin-top: .25rem; letter-spacing: -.02em; }
.stat .ket { font-size: .8rem; color: var(--teks-redup); }

.bungkus-tabel { overflow-x: auto; }

table.tabel {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
table.tabel th, table.tabel td {
    padding: .68rem .85rem;
    text-align: left;
    border-bottom: 1px solid var(--garis);
    vertical-align: middle;
}
table.tabel th {
    background: #f4f9f6;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--teks-redup);
    font-weight: 700;
    white-space: nowrap;
}
table.tabel tbody tr:hover { background: #f7fbf9; }
table.tabel tbody tr:last-child td { border-bottom: none; }
table.tabel td.aksi { white-space: nowrap; text-align: right; }
.mono { font-family: Consolas, "Courier New", monospace; letter-spacing: .08em; font-weight: 700; }

.kosong {
    padding: 2.4rem 1rem;
    text-align: center;
    color: var(--teks-redup);
}
.kosong .ikon-besar { font-size: 2.2rem; display: block; margin-bottom: .4rem; }

.bar-alat {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}
.bar-alat label { margin-bottom: 0; }
.bar-alat .tumbuh { flex: 1; min-width: 180px; }

/* ---------------- Diagram batang hasil ---------------- */

.baris-hasil { margin-bottom: 1.15rem; }
.baris-hasil:last-child { margin-bottom: 0; }
.baris-hasil .keterangan {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: .9rem;
    margin-bottom: .35rem;
}
.baris-hasil .nilai { font-weight: 700; white-space: nowrap; }
.batang {
    height: 13px;
    border-radius: 999px;
    background: #e3ece7;
    overflow: hidden;
}
.batang > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #fff));
    transition: width .5s ease;
    min-width: 2px;
}
.batang.juara > span {
    background: linear-gradient(90deg, var(--primary-gelap), var(--primary), #4ade80);
}

.nomor-bulat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 27px; height: 27px;
    border-radius: 50%;
    background: var(--primary-lembut);
    color: var(--primary-gelap);
    border: 1px solid var(--primary-garis);
    font-weight: 700;
    font-size: .8rem;
}

.foto-mini {
    width: 42px; height: 42px;
    border-radius: 11px;
    object-fit: cover;
    background: var(--primary-lembut);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary-gelap); font-weight: 700; font-size: .82rem;
}

/* ---------------- Bilik suara ---------------- */

/* Latar terang dengan rona hijau; fotonya hanya terasa samar supaya
   kartu kandidat tetap menjadi hal paling jelas di layar. */
.halaman-vote {
    min-height: 100vh;
    background-color: var(--latar);
    background-image:
        linear-gradient(180deg,
            rgba(236, 245, 239, .955) 0%,
            rgba(238, 246, 241, .925) 45%,
            rgba(236, 245, 239, .975) 100%),
        radial-gradient(95% 60% at 50% 0%,
            color-mix(in srgb, var(--primary) 20%, transparent), transparent 68%),
        var(--gedung);
    background-repeat: no-repeat;
    background-position: center, center top, center 30%;
    background-size: cover, cover, cover;
    background-attachment: fixed;
}

.vote-topbar {
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--garis);
    padding: .85rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    position: sticky; top: 0; z-index: 20;
}
.vote-merek { display: flex; align-items: center; gap: .7rem; }
.vote-merek .lambang {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: linear-gradient(140deg, var(--primary), var(--primary-gelap));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; overflow: hidden;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 30%, transparent);
}
.vote-merek .lambang img { width: 100%; height: 100%; object-fit: cover; }
.vote-merek strong { display: block; line-height: 1.25; }
.vote-merek span { font-size: .78rem; color: var(--teks-redup); }

.wadah { max-width: 1040px; margin: 0 auto; padding: 1.6rem 1.2rem 3rem; }
.wadah-sempit { max-width: 680px; }

.grid-kandidat {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.1rem;
}

.kartu-kandidat {
    position: relative;
    background: linear-gradient(180deg, #fff, #fbfdfc);
    border: 2px solid var(--garis);
    border-radius: var(--radius);
    padding: 1.25rem 1.1rem 1.1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
    display: flex;
    flex-direction: column;
    box-shadow: var(--bayang-kecil);
}
.kartu-kandidat:hover {
    border-color: var(--primary-garis);
    transform: translateY(-3px);
    box-shadow: var(--bayang-naik);
}
.kartu-kandidat input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
/* Kartu terpilih diberi tiga penanda sekaligus — bingkai, rona latar, dan
   tanda centang — supaya jelas bagi pemilih yang buru-buru maupun yang
   sulit membedakan warna. */
.kartu-kandidat.terpilih {
    border-color: var(--primary);
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--primary) 7%, #fff),
        color-mix(in srgb, var(--primary) 3%, #fff));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent), var(--bayang-naik);
}
.kartu-kandidat .nomor {
    position: absolute;
    top: .8rem; left: .8rem;
    width: 33px; height: 33px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--primary), var(--primary-gelap));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .88rem;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 32%, transparent);
}
.kartu-kandidat .centang {
    position: absolute;
    top: .8rem; right: .8rem;
    width: 29px; height: 29px;
    border-radius: 50%;
    background: var(--primary); color: #fff;
    display: none; align-items: center; justify-content: center;
    font-size: .85rem; font-weight: 800;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 40%, transparent);
}
.kartu-kandidat.terpilih .centang { display: flex; }
.kartu-kandidat .potret {
    width: 124px; height: 124px;
    margin: .55rem auto .85rem;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-lembut);
    color: var(--primary-gelap);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.1rem; font-weight: 800;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px var(--primary-lembut), 0 8px 20px rgba(6, 40, 22, .1);
    transition: box-shadow .15s;
}
.kartu-kandidat.terpilih .potret {
    box-shadow: 0 0 0 3px var(--primary), 0 10px 24px color-mix(in srgb, var(--primary) 25%, transparent);
}
.kartu-kandidat .nama { font-weight: 750; font-size: 1.05rem; line-height: 1.25; }
.kartu-kandidat .pendamping { font-size: .86rem; color: var(--teks-redup); margin-top: .1rem; }
.kartu-kandidat .kelas {
    font-size: .74rem;
    color: var(--primary-gelap);
    background: var(--primary-lembut);
    border-radius: 999px;
    padding: .1rem .6rem;
    margin: .45rem auto 0;
    display: inline-block;
    font-weight: 650;
}
.kartu-kandidat .tautan-visi {
    margin-top: .8rem;
    font-size: .82rem;
    font-weight: 650;
    background: none;
    border: none;
    color: var(--primary-gelap);
    cursor: pointer;
    padding: .25rem;
    border-radius: 8px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.kartu-kandidat .tautan-visi:hover { background: var(--primary-lembut); }

.bagian-pemilihan {
    position: relative;
    background: rgba(255, 255, 255, .97);
    border: 1px solid var(--garis);
    border-radius: var(--radius);
    padding: 1.4rem 1.35rem;
    margin-bottom: 1.4rem;
    box-shadow: var(--bayang);
    overflow: hidden;
}
.bagian-pemilihan > header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.15rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid var(--garis);
}
.bagian-pemilihan > header h2 { margin: 0; font-size: 1.25rem; }

.bar-kirim {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--primary-garis);
    border-radius: var(--radius);
    padding: 1.05rem 1.3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 -8px 30px rgba(6, 40, 22, .14);
}

.lingkaran-sukses {
    width: 88px; height: 88px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--sukses-lembut);
    color: var(--sukses);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem;
    box-shadow: 0 0 0 8px rgba(34, 197, 94, .12);
}

/* ---------------- Modal ---------------- */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 24, 14, .6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    z-index: 100;
}
.modal.tampil { display: flex; }
.modal-kotak {
    background: var(--putih);
    border-radius: var(--radius);
    max-width: 560px;
    width: 100%;
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
}
.modal-kepala {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--garis);
}
.modal-kepala h3 { margin: 0; }
.modal-isi { padding: 1.2rem; }
.modal-isi h4 { margin-top: 1rem; }
.modal-isi h4:first-child { margin-top: 0; }
.modal-tutup {
    background: none; border: none;
    font-size: 1.5rem; line-height: 1;
    cursor: pointer; color: var(--teks-redup);
    padding: 0 .25rem;
}
.pra-teks { white-space: pre-wrap; margin: 0; font-family: inherit; font-size: .92rem; }

/* ---------------- Cetak ---------------- */

.lembar-cetak {
    max-width: 800px;
    margin: 1.5rem auto;
    background: #fff;
    padding: 2.6rem;
    box-shadow: var(--bayang);
}
.kop {
    text-align: center;
    border-bottom: 3px double #111;
    padding-bottom: .9rem;
    margin-bottom: 1.6rem;
}
.kop h1 { font-size: 1.25rem; margin-bottom: .15rem; }
.kop p { margin: 0; font-size: .9rem; }
.ttd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
    text-align: center;
}
.ttd-grid .ruang { height: 74px; }

.kartu-token {
    border: 1px dashed #9aa1b4;
    border-radius: 10px;
    padding: .7rem .85rem;
    font-size: .82rem;
    page-break-inside: avoid;
    break-inside: avoid;
}
.kartu-token .tok {
    font-family: Consolas, "Courier New", monospace;
    font-size: 1.22rem;
    font-weight: 700;
    letter-spacing: .16em;
}
.grid-token {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .7rem;
}

@media print {
    /* Latar bergambar dibuang: memboroskan tinta dan menyulitkan dibaca. */
    body, .halaman-auth, .halaman-vote { background: #fff !important; }
    .tanpa-cetak, .sidebar, .topbar, .vote-topbar { display: none !important; }
    .lembar-cetak { box-shadow: none; margin: 0; padding: 0; max-width: none; }
    .isi { padding: 0; }
    .kartu { border: none; box-shadow: none; }
    table.tabel th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .grid-token { grid-template-columns: repeat(3, 1fr); }
    a[href]:after { content: ""; }
}

/* ---------------- Gerak dikurangi ---------------- */

@media (prefers-reduced-motion: reduce) {
    .btn, .kartu-kandidat, .batang > span { transition: none; }
    .kartu-kandidat:hover { transform: none; }
}
