/* ===== Tema E-Voting SMAN 1 Air Saleh ===== */
:root {
    --ev-primary: #123c7c;
    --ev-primary-dark: #0b2752;
    --ev-accent: #f2b705;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.bg-ev {
    background: linear-gradient(135deg, var(--ev-primary-dark) 0%, var(--ev-primary) 60%, #1d5bb8 100%);
}

.btn-ev {
    --bs-btn-bg: var(--ev-primary);
    --bs-btn-border-color: var(--ev-primary);
    --bs-btn-hover-bg: var(--ev-primary-dark);
    --bs-btn-hover-border-color: var(--ev-primary-dark);
    --bs-btn-active-bg: var(--ev-primary-dark);
    --bs-btn-disabled-bg: #6c7a92;
    --bs-btn-disabled-border-color: #6c7a92;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
}

.text-ev { color: var(--ev-primary); }
.bg-ev-subtle { background: #e7edf7; }

/* ===== Dashboard panitia (admin.php) ===== */

/* Badge "sedang berlangsung" dengan titik berdenyut */
.badge-live {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #e7f6ec;
    color: #0f7a3d;
    font-weight: 600;
    font-size: .8rem;
    padding: .3rem .7rem;
    border-radius: 999px;
}

.dot-live {
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 rgba(22, 163, 74, .6);
    animation: denyut-live 1.8s infinite;
}

@keyframes denyut-live {
    0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, .55); }
    70%  { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* Kartu statistik dengan ikon bulat */
.stat-card .stat-ikon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Donut partisipasi dengan angka di tengah */
.donut-wrap {
    position: relative;
    width: 220px;
    height: 220px;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 62%;
    text-align: center;
    pointer-events: none;
    line-height: 1.2;
}

.donut-center .text-muted { font-size: .72rem; }

/* Daftar partisipasi per kelas */
.baris-kelas {
    border-bottom: 1px solid #eef1f5;
    transition: background-color .15s ease;
}

.baris-kelas:last-child { border-bottom: 0; }
.baris-kelas:hover { background: #f8f9fc; }

.bar-baik   { background-color: #198754; }
.bar-sedang { background-color: #f2b705; }
.bar-rendah { background-color: #dc3545; }
.bar-netral { background-color: #adb5bd; }

/* Papan hasil pemilihan (leaderboard) */
.leaderboard-foto {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
}

.leaderboard-foto .kandidat-foto,
.leaderboard-foto .kandidat-avatar {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    font-size: .95rem;
}

.leaderboard-crown {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--ev-accent);
    color: #5a4400;
    font-size: .6rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.bar-unggul { background-color: var(--ev-accent); }
.bar-biasa  { background-color: var(--ev-primary); }

/* ===== Menu panitia (admin_nav.php) ===== */
.navbar-admin .nav-link {
    border-radius: .5rem;
    padding-left: .85rem !important;
    padding-right: .85rem !important;
}

.navbar-admin .nav-link.active {
    background: rgba(255, 255, 255, .16);
    font-weight: 600;
}

/* Foto kecil di tabel admin */
.foto-mini {
    width: 54px;
    flex-shrink: 0;
}

.foto-mini .kandidat-foto,
.foto-mini .kandidat-avatar {
    border-radius: .4rem;
}

.foto-mini .kandidat-avatar {
    font-size: 1.1rem;
}

.foto-preview {
    width: 150px;
}

.foto-preview .kandidat-avatar {
    font-size: 2.5rem;
}

/* Potong teks panjang menjadi 2 baris */
.teks-ringkas {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 420px;
}

[id] { scroll-margin-top: 1rem; }

/* ===== Login Kiosk (index.php) ===== */
.kiosk-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.kiosk-card {
    width: 100%;
    max-width: 440px;
    border: 0;
    border-radius: 1.25rem;
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .3);
}

.kiosk-logo {
    width: 110px;
    height: auto;
}

.input-token {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: .6em;
    text-align: center;
    padding-left: 1.2em; /* imbangi letter-spacing agar angka tetap di tengah */
    font-family: "Consolas", "Courier New", monospace;
}

.input-token::placeholder {
    letter-spacing: .6em;
    color: #c5ccd8;
}

/* ===== Halaman Pemilihan (pemilihan.php) ===== */
.kandidat-card {
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 1rem;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
    height: 100%;
}

.kandidat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 .75rem 1.5rem rgba(18, 60, 124, .18) !important;
}

.btn-check:checked + .kandidat-card {
    border-color: var(--ev-accent);
    box-shadow: 0 0 0 .3rem rgba(242, 183, 5, .35) !important;
}

.btn-check:focus-visible + .kandidat-card {
    outline: 3px solid var(--ev-primary);
    outline-offset: 3px;
}

.kandidat-foto {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: .75rem;
    background: #e9eef6;
}

.kandidat-avatar {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: .75rem;
    background: linear-gradient(160deg, #dfe7f3, #b9c9e2);
    color: var(--ev-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
}

.no-urut {
    position: absolute;
    top: .75rem;
    left: .75rem;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: var(--ev-primary);
    color: #fff;
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.tanda-pilih {
    display: none;
    position: absolute;
    top: .75rem;
    right: .75rem;
    font-size: 2.25rem;
    color: var(--ev-accent);
    background: #fff;
    border-radius: 50%;
    line-height: 1;
}

.btn-check:checked + .kandidat-card .tanda-pilih {
    display: block;
}

.bar-kirim {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid #dee2e6;
    backdrop-filter: blur(4px);
}

.layar-sukses {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 1rem;
}

.layar-sukses .bi-check-circle-fill {
    font-size: 7rem;
    color: var(--ev-accent);
}
