/* ========================================
   VARIABEL & RESET
   ======================================== */
:root {
    --bg-primary: #060a13;
    --bg-secondary: #0d1321;
    --bg-card: rgba(13, 19, 33, 0.85);
    --bg-card-hover: rgba(17, 25, 45, 0.95);
    --text-primary: #e8ecf1;
    --text-secondary: #8892a4;
    --text-muted: #4a5568;
    --accent: #00e5a0;
    --accent-rgb: 0, 229, 160;
    --accent-dark: #00b87d;
    --accent-secondary: #00b4d8;
    --accent-secondary-rgb: 0, 180, 216;
    --danger: #ef4444;
    --danger-rgb: 239, 68, 68;
    --warning: #f59e0b;
    --warning-rgb: 245, 158, 11;
    --border: rgba(0, 229, 160, 0.1);
    --border-hover: rgba(0, 229, 160, 0.3);
    --glass-bg: rgba(13, 19, 33, 0.6);
    --glass-border: rgba(255, 255, 255, 0.06);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-accent: 0 0 40px rgba(var(--accent-rgb), 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    opacity: 0;
    animation: pageEnter 0.6s ease forwards;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.42;
    background-image:
        linear-gradient(rgba(var(--accent-secondary-rgb), 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--accent-secondary-rgb), 0.035) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
    animation: gridDrift 24s linear infinite;
}

@keyframes gridDrift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(72px, 72px, 0); }
}

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

body.page-exit {
    animation: pageExit 0.35s ease forwards;
}

@keyframes pageExit {
    from { opacity: 1; filter: blur(0); }
    to { opacity: 0; filter: blur(6px); }
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-dark); }

img { max-width: 100%; display: block; }

/* ========================================
   TIPOGRAFI
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }

.text-accent { color: var(--accent); }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }

/* ========================================
   UTILITAS
   ======================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none !important; }

/* ========================================
   TOMBOL
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.25) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
}

.btn:active::after { opacity: 1; transition: opacity 0s; }

.btn-primary {
    background: var(--accent);
    color: #060a13;
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.2);
}

.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.35);
    transform: translateY(-2px);
}

.btn-primary:active { transform: translateY(0) scale(0.97); }

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}

.btn-danger {
    background: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
    border: 1px solid rgba(var(--danger-rgb), 0.3);
}

.btn-danger:hover {
    background: rgba(var(--danger-rgb), 0.25);
    border-color: var(--danger);
}

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ========================================
   INPUT
   ======================================== */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all var(--transition);
    outline: none;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.03);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.08), 0 0 20px rgba(var(--accent-rgb), 0.06);
}

.input-group input::placeholder { color: var(--text-muted); }

.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus,
.input-group textarea:-webkit-autofill,
.input-group select:-webkit-autofill {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px #111827 inset;
    box-shadow: 0 0 0 1000px #111827 inset;
    caret-color: var(--text-primary);
    transition: background-color 9999s ease-in-out 0s;
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ========================================
   KARTU
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-accent);
}

.card-glow {
    position: relative;
}

.card-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15), transparent 50%, rgba(var(--accent-secondary-rgb), 0.1));
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition);
}

.card-glow:hover::before { opacity: 1; }

/* ========================================
   BADGE STATUS
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
}

.badge-warning {
    background: rgba(var(--warning-rgb), 0.12);
    color: var(--warning);
}

.badge-danger {
    background: rgba(var(--danger-rgb), 0.12);
    color: var(--danger);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-success .badge-dot { animation: pulse-dot 2s infinite; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ========================================
   TOAST NOTIFIKASI
   ======================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    color: var(--text-primary);
    pointer-events: auto;
    animation: toastIn 0.4s var(--transition-spring) forwards;
    backdrop-filter: blur(16px);
    max-width: 380px;
}

.toast.toast-out { animation: toastOut 0.3s ease forwards; }

.toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.toast-success .toast-icon { background: rgba(var(--accent-rgb), 0.2); color: var(--accent); }
.toast-error .toast-icon { background: rgba(var(--danger-rgb), 0.2); color: var(--danger); }
.toast-info .toast-icon { background: rgba(var(--accent-secondary-rgb), 0.2); color: var(--accent-secondary); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(60px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(60px) scale(0.9); }
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.85) translateY(20px);
    transition: transform 0.4s var(--transition-spring);
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* ========================================
   LOADING SPINNER
   ======================================== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(var(--accent-rgb), 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 19, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.loading-overlay.active { opacity: 1; pointer-events: auto; }

.loading-text {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ========================================
   HALAMAN LOGIN
   ======================================== */
.login-page {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: block;
    z-index: 1;
    pointer-events: none;
}

.vote-page #particle-canvas,
.admin-page #particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

.login-bg-gradient {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        repeating-linear-gradient(115deg, transparent 0, transparent 90px, rgba(var(--accent-secondary-rgb), 0.018) 91px, transparent 92px),
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(var(--accent-rgb), 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 80% 20%, rgba(var(--accent-secondary-rgb), 0.05) 0%, transparent 70%),
        linear-gradient(180deg, #060a13 0%, #0a1020 100%);
    background-size: auto, auto, auto, auto;
    animation: loginAtmosphere 18s ease-in-out infinite alternate;
}

@keyframes loginAtmosphere {
    from { background-position: 0 0, 0 0, 0 0, 0 0; }
    to { background-position: 80px -40px, 18px -12px, -22px 16px, 0 0; }
}

.login-bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: 0;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: rgba(var(--accent-rgb), 0.08);
    top: -100px;
    right: -100px;
    animation: floatBlob 20s ease-in-out infinite;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: rgba(var(--accent-secondary-rgb), 0.06);
    bottom: -80px;
    left: -80px;
    animation: floatBlob 25s ease-in-out infinite reverse;
}

@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.1); }
    66% { transform: translate(-20px, 30px) scale(0.95); }
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    margin: 24px;
    background: rgba(13, 19, 33, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    animation: cardEnter 0.7s var(--transition-spring) 0.2s both;
}

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.2);
}

.login-logo-icon svg {
    width: 28px;
    height: 28px;
    fill: #060a13;
}

.login-logo h1 {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Tab Login */
.login-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-xs);
    padding: 4px;
    margin-bottom: 28px;
    position: relative;
}

.login-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 5px;
    transition: all var(--transition);
    position: relative;
    z-index: 1;
}

.login-tab.active { color: #060a13; }

.login-tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--accent);
    border-radius: 5px;
    transition: transform var(--transition);
    z-index: 0;
}

.login-tab-indicator.right { transform: translateX(100%); }

.login-form { display: none; }
.login-form.active { display: block; animation: formFadeIn 0.35s ease; }

@keyframes formFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-error {
    background: rgba(var(--danger-rgb), 0.1);
    border: 1px solid rgba(var(--danger-rgb), 0.2);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: none;
    animation: shakeX 0.4s ease;
}

.login-error.show { display: block; }

@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* ========================================
   HALAMAN VOTE SISWA
   ======================================== */
.vote-page {
    min-height: 100vh;
    position: relative;
}

.vote-page::before,
.admin-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(115deg, transparent 0, transparent 90px, rgba(var(--accent-secondary-rgb), 0.018) 91px, transparent 92px),
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(var(--accent-rgb), 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 80% 20%, rgba(var(--accent-secondary-rgb), 0.05) 0%, transparent 70%),
        linear-gradient(180deg, #060a13 0%, #0a1020 100%);
    animation: loginAtmosphere 18s ease-in-out infinite alternate;
}

.vote-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(var(--accent-rgb), 0.04) 0%, transparent 60%),
        linear-gradient(180deg, #060a13 0%, #0a0f1c 100%);
    pointer-events: none;
}

.vote-header {
    position: relative;
    z-index: 1;
    padding: 20px 0;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(6, 10, 19, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.vote-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vote-user-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.vote-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-secondary-rgb), 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
}

.vote-main {
    position: relative;
    z-index: 1;
    padding: 40px 0 80px;
}

.vote-section-title {
    text-align: center;
    margin-bottom: 40px;
}

.vote-section-title h2 { margin-bottom: 8px; }

/* Grid Kandidat */
.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 12px;
}

.candidate-card {
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    will-change: transform, opacity;
}

.candidate-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.candidate-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: var(--shadow-accent), var(--shadow);
    animation: luxuryFloat 2.8s ease-in-out infinite;
}

.candidate-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.candidate-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 40px rgba(var(--accent-rgb), 0.2);
    transform: translateY(-4px) scale(1.02);
}

.candidate-card.dimmed {
    opacity: 0.4;
    transform: scale(0.97);
    filter: grayscale(0.3);
}

.candidate-photo-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), rgba(var(--accent-secondary-rgb), 0.06));
}

.candidate-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.candidate-card:hover .candidate-photo { transform: scale(1.08); }

.candidate-number {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
    background: rgba(6, 10, 19, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
}

.candidate-select-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-spring);
}

.candidate-card.selected .candidate-select-badge {
    opacity: 1;
    transform: scale(1);
}

.candidate-select-badge svg {
    width: 18px;
    height: 18px;
    stroke: #060a13;
    stroke-width: 3;
    fill: none;
}

.candidate-info {
    padding: 20px;
}

.candidate-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.candidate-class {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.candidate-vision {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vote-action-bar {
    text-align: center;
    margin-top: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.vote-action-bar.visible {
    opacity: 1;
    transform: translateY(0);
    animation: actionBarGlow 2.4s ease-in-out infinite;
}

@keyframes luxuryFloat {
    0%, 100% { box-shadow: var(--shadow-accent), var(--shadow); }
    50% { box-shadow: 0 0 52px rgba(var(--accent-rgb), 0.22), var(--shadow); }
}

@keyframes actionBarGlow {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(var(--accent-rgb), 0)); }
    50% { filter: drop-shadow(0 0 14px rgba(var(--accent-rgb), 0.18)); }
}

/* Status Sudah Memilih */
.voted-status {
    text-align: center;
    padding: 80px 24px;
    animation: scaleIn 0.6s var(--transition-spring);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.voted-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: rgba(var(--accent-rgb), 0.1);
    border: 2px solid rgba(var(--accent-rgb), 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.2); }
    50% { box-shadow: 0 0 0 20px rgba(var(--accent-rgb), 0); }
}

.voted-icon svg {
    width: 48px;
    height: 48px;
    stroke: var(--accent);
    stroke-width: 2.5;
    fill: none;
}

.voted-title {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.voted-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Konfirmasi Modal */
.confirm-candidate {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.confirm-candidate-photo {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(var(--accent-rgb), 0.3);
}

.confirm-candidate-info h4 { font-size: 1.05rem; margin-bottom: 2px; }
.confirm-candidate-info p { color: var(--text-secondary); font-size: 0.85rem; }

/* ========================================
   SUKSES ANIMASI (CONFETTI CANVAS)
   ======================================== */
#confetti-canvas {
    position: fixed;
    inset: 0;
    z-index: 9500;
    pointer-events: none;
}

.success-overlay {
    position: fixed;
    inset: 0;
    z-index: 9400;
    background: rgba(6, 10, 19, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

.success-overlay.active { opacity: 1; pointer-events: auto; }

.success-checkmark {
    width: 120px;
    height: 120px;
    position: relative;
}

.success-checkmark-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    animation: checkCircle 0.6s ease forwards;
    opacity: 0;
}

@keyframes checkCircle {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.success-checkmark-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.success-checkmark-check svg {
    width: 56px;
    height: 56px;
    stroke: var(--accent);
    stroke-width: 3;
    fill: none;
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: drawCheck 0.5s ease 0.4s forwards;
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.success-text {
    margin-top: 24px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0;
    animation: fadeUp 0.5s ease 0.7s forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   HALAMAN ADMIN
   ======================================== */
.admin-page {
    min-height: 100vh;
    position: relative;
}

.admin-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6, 10, 19, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 24px;
}

.admin-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

.admin-nav-brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-nav-brand-icon svg { width: 16px; height: 16px; fill: #060a13; }

.admin-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.admin-nav-link {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
    font-family: var(--font-display);
}

.admin-nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.admin-nav-link.active { color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }

.admin-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    position: relative;
    z-index: 1;
}

.admin-section { display: none; }
.admin-section.active { display: block; animation: sectionIn 0.4s ease; }

@keyframes sectionIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    overflow: hidden;
}

.stat-card.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cardReveal 0.7s both;
}

.stat-card.revealed:nth-child(2) { animation-delay: 80ms; }
.stat-card.revealed:nth-child(3) { animation-delay: 160ms; }
.stat-card.revealed:nth-child(4) { animation-delay: 240ms; }

@keyframes cardReveal {
    0% { opacity: 0; transform: translateY(22px) scale(0.96); }
    70% { opacity: 1; transform: translateY(-4px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-accent), var(--shadow);
    transition: all var(--transition);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 0 0 0 80px;
    opacity: 0.06;
}

.stat-card-accent::after { background: var(--accent); }
.stat-card-blue::after { background: var(--accent-secondary); }
.stat-card-warning::after { background: var(--warning); }
.stat-card-danger::after { background: var(--danger); }

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-value-accent { color: var(--accent); }
.stat-value-blue { color: var(--accent-secondary); }
.stat-value-warning { color: var(--warning); }
.stat-value-danger { color: var(--danger); }

/* Bar Chart Hasil */
.chart-section {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 36px;
}

.chart-section h3 { margin-bottom: 24px; }

.chart-section {
    animation: sectionLift 0.8s 0.25s both;
}

@keyframes sectionLift {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.chart-bar-group { margin-bottom: 20px; }
.chart-bar-group:last-child { margin-bottom: 0; }

.chart-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chart-bar-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
}

.chart-bar-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.chart-bar-votes { color: var(--text-secondary); }
.chart-bar-pct { color: var(--accent); font-weight: 700; font-family: var(--font-display); }

.chart-bar-track {
    width: 100%;
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    border-radius: 8px;
    width: 0;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.chart-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
    animation: barShimmer 2s infinite;
}

@keyframes barShimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* Tabel Siswa */
.table-section {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 36px;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.table-search {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    width: 260px;
    transition: all var(--transition);
}

.table-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.08);
}

.table-search::placeholder { color: var(--text-muted); }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}

.data-table tbody tr {
    transition: background var(--transition);
    opacity: 0;
    transform: translateX(-10px);
}

.data-table tbody tr.revealed {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.4s ease;
}

.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.data-table tbody td {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-table .token-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    color: var(--accent-secondary);
    background: rgba(var(--accent-secondary-rgb), 0.06);
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
}

/* Form Tambah Kandidat */
.form-section {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 36px;
}

.form-section h3 { margin-bottom: 24px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0 20px;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

/* Halaman Generate Tokens */
.generate-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    position: relative;
    z-index: 2;
}

.generate-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 32px;
}

.token-result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.token-result-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}

.token-result-table td {
    padding: 10px 14px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.token-result-table .token-cell {
    font-family: 'Courier New', monospace;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.06);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-secondary);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.5;
}

.empty-state h3 {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.empty-state p { font-size: 0.9rem; color: var(--text-muted); }

/* ========================================
   SCROLL REVEAL
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .login-card { padding: 28px 22px; margin: 16px; }

    .candidates-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .admin-nav-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 10px; }
    .admin-nav-links { order: 3; width: 100%; overflow-x: auto; padding-bottom: 4px; }
    .admin-nav-link { font-size: 0.8rem; padding: 6px 12px; white-space: nowrap; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 18px; }
    .stat-value { font-size: 1.6rem; }

    .data-table { font-size: 0.82rem; }
    .data-table thead th, .data-table tbody td { padding: 10px 10px; }

    .table-search { width: 100%; }

    .form-grid { grid-template-columns: 1fr; }

    .table-header { flex-direction: column; align-items: flex-start; }

    .modal-box { padding: 24px; }

    .admin-nav-right .btn span { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .candidate-photo-wrapper { height: 180px; }
}

/* ========================================
   PRINT STYLES (untuk cetak token)
   ======================================== */
@media print {
    body { background: white; color: black; opacity: 1; }
    .admin-nav, .no-print { display: none !important; }
    .generate-card { border: 1px solid #ddd; background: white; }
    .token-result-table .token-cell { color: #333; background: #f0f0f0; }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

 /* ========================================
   FIX STRETCH & BACKGROUND VOTE PAGE
   ======================================== */
.vote-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.vote-main {
    flex: 1;
}

/* Pastiin background layer tetep fixed & cover */
.vote-bg,
.vote-page::before {
    position: fixed !important;
    inset: 0 !important;
    height: 100vh !important;
    width: 100vw !important;
}

/* ========================================
   FILTER KELAS & JURUSAN ADMIN
   ======================================== */
.class-filter-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-top: 18px;
    margin-bottom: 20px;
}

.class-filter-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.class-filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.class-filter-label svg {
    width: 16px;
    height: 16px;
    stroke: var(--accent);
}

.class-filter-select {
    padding: 8px 14px;
    background: #0d1321;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: all var(--transition);
}

.class-filter-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.class-filter-select option {
    background: #0d1321;
    color: #e8ecf1;
}

.class-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.class-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.class-pill:hover {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--text-primary);
    border-color: rgba(var(--accent-rgb), 0.3);
}

.class-pill.active {
    background: var(--accent);
    color: #060a13;
    border-color: var(--accent);
    font-weight: 700;
    box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.3);
}

.class-stats-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-xs);
    margin-top: 14px;
}

.class-stats-bar .badge-count {
    font-weight: 700;
    color: var(--accent);
}

/* Bulk Mode Tabs in generate_tokens.php */
.bulk-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
}

.bulk-mode-tab {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.bulk-mode-tab:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.bulk-mode-tab.active {
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
    border-color: var(--accent);
}

.names-counter {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.names-counter span {
    color: var(--accent);
    font-weight: 700;
}