/* ==========================================================================
   PickYourHero — Theme Design System
   Style: Glassmorphism / Modern SaaS   Font: Plus Jakarta Sans
   ========================================================================== */

:root {
    /* Brand */
    --primary: #0284c7;
    --primary-dark: #075985;
    --primary-light: #38bdf8;
    --secondary: #0ea5e9;
    --secondary-light: #67e8f9;
    --accent: #06b6d4;

    /* Semantic */
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --info: #0284c7;

    /* Surface */
    --bg: #f6f7fb;
    --bg-alt: #eef0fa;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.72);
    --surface-glass-strong: rgba(255, 255, 255, 0.88);
    --border: #e6e8f0;
    --border-strong: #d6d9e6;

    /* Text */
    --text: #1e1b2e;
    --text-muted: #64748b;
    --text-soft: #94a3b8;
    --on-primary: #ffffff;

    /* Legacy aliases kept so older markup using var(--light)/var(--dark) still resolves */
    --light: var(--bg);
    --dark: var(--text);

    /* Elevation */
    --shadow-sm: 0 2px 8px rgba(30, 27, 46, 0.06);
    --shadow-md: 0 10px 25px rgba(30, 27, 46, 0.10);
    --shadow-lg: 0 20px 45px rgba(30, 27, 46, 0.16);
    --shadow-glow: 0 8px 24px rgba(2, 132, 199, 0.28);

    /* Radius scale */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --fast: 150ms;
    --normal: 250ms;

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --gradient-brand-soft: linear-gradient(135deg, rgba(2, 132, 199, 0.12) 0%, rgba(6, 182, 212, 0.12) 100%);
    /* Voter-facing pages only (login + vote): Clash of Champions inspired glow, replaces the old soft-blue hero */
    --gradient-hero: radial-gradient(circle at 12% 8%, rgba(0, 232, 255, 0.4), transparent 45%),
        radial-gradient(circle at 88% 92%, rgba(247, 92, 255, 0.32), transparent 50%),
        radial-gradient(circle at 90% 10%, rgba(255, 215, 0, 0.12), transparent 40%),
        linear-gradient(160deg, #050912 0%, #0a1730 55%, #0d2b42 100%);

    /* Clash of Champions palette — used only by voter-facing selectors (vote/login/kiosk/results), never by admin pages */
    --coc-bg-1: #050912;
    --coc-bg-2: #0a1730;
    --coc-bg-3: #0d2b42;
    --coc-cyan: #00e8ff;
    --coc-magenta: #f75cff;
    --coc-gold: #ffd700;
    --coc-gold-deep: #ffa500;
    --coc-gradient-cta: linear-gradient(135deg, var(--coc-gold) 0%, var(--coc-gold-deep) 100%);
    --coc-gradient-accent: linear-gradient(135deg, var(--coc-cyan) 0%, var(--coc-magenta) 100%);
    --coc-shadow-cyan: 0 8px 28px rgba(0, 232, 255, 0.35);
    --coc-shadow-magenta: 0 8px 28px rgba(247, 92, 255, 0.35);
    --coc-shadow-gold: 0 8px 28px rgba(255, 215, 0, 0.4);
    --coc-font-display: 'Orbitron', 'Plus Jakarta Sans', sans-serif;
    --coc-font-body: 'Rajdhani', 'Plus Jakarta Sans', sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

body {
    font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

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

a:hover {
    color: var(--primary-dark);
}

::selection {
    background: var(--primary);
    color: var(--on-primary);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-soft);
}

/* Accessible focus ring everywhere, without the noisy default outline */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
[tabindex]:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.35) !important;
}

input:focus,
textarea:focus,
select:focus,
button:focus {
    outline: none;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.container,
.container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 576px) {

    .container,
    .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.glass-card {
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   Bootstrap component re-skin (applies sitewide: candidates/categories/voters/admin pages)
   ========================================================================== */

.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--gradient-brand);
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--gradient-brand);
    filter: brightness(1.06);
    box-shadow: var(--shadow-glow);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--normal) var(--ease), transform var(--normal) var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--gradient-brand-soft);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    font-weight: 700;
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    padding: 0.6rem 0.9rem;
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--text);
}

.input-group-text {
    border-radius: var(--radius-sm);
    background: var(--bg-alt);
    border: 1px solid var(--border-strong);
}

.table {
    --bs-table-bg: transparent;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table thead th {
    background: var(--bg-alt);
    color: var(--text);
    font-weight: 700;
    border-bottom: 2px solid var(--border-strong);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.table-hover tbody tr:hover {
    background: var(--gradient-brand-soft);
}

.alert {
    border: none;
    border-radius: var(--radius-md);
    border-left: 4px solid transparent;
}

.alert-success {
    border-left-color: var(--success);
}

.alert-danger {
    border-left-color: var(--danger);
}

.alert-warning {
    border-left-color: var(--warning);
}

.badge {
    border-radius: var(--radius-pill);
    font-weight: 600;
    padding: 0.4em 0.8em;
}

.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    background: transparent;
}

/* ==========================================================================
   Vote / landing page
   ========================================================================== */

.vote-page-body {
    background: var(--coc-bg-1);
    color: #fff;
    font-family: var(--coc-font-body);
}

.voter-name-badge-wrap {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 2;
}

.voter-name-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(0, 232, 255, 0.4);
    color: #fff;
    font-family: var(--coc-font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    box-shadow: var(--coc-shadow-cyan);
    white-space: nowrap;
}

@media (max-width: 576px) {
    .voter-name-badge-wrap {
        position: static;
        display: flex;
        justify-content: center;
        margin-top: 0.75rem;
    }
}

.vote-hero-section {
    background: var(--gradient-hero);
    color: white;
    padding: 2.5rem 0;
    position: relative;
    overflow: hidden;
}

.vote-hero-section h1,
.vote-hero-section h2,
.vote-hero-section h3,
.vote-hero-section h4,
.vote-hero-section p,
.vote-hero-section i {
    color: #fff;
}

.vote-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTIwMCA4MDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxwYXRoIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4xKSIgZD0iTTAgNjI1TDEyMjUgODAwTDEyMDAgMEwwIDYyNVoiPjwvcGF0aD48L3N2Zz4=');
    opacity: 0.15;
}

.vote-hero-section>* {
    position: relative;
    z-index: 1;
}

.vote-candidate-card {
    transition: transform var(--normal) var(--ease), box-shadow var(--normal) var(--ease);
    border: 1px solid rgba(0, 232, 255, 0.18);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.5);
    margin-bottom: 2rem;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.vote-candidate-card .card-title {
    color: #fff;
    font-family: var(--coc-font-display);
    letter-spacing: 0.01em;
}

.vote-candidate-card .card-text {
    color: rgba(255, 255, 255, 0.72) !important;
}

.vote-candidate-card .card-footer {
    background: rgba(255, 255, 255, 0.04) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.vote-candidate-card .card-footer a {
    color: var(--coc-cyan) !important;
}

.vote-candidate-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--coc-shadow-cyan);
}

.vote-candidate-card.selected {
    outline: 3px solid var(--coc-cyan);
    outline-offset: -3px;
}

.vote-candidate-image {
    height: 250px;
    object-fit: cover;
    object-position: top;
    transition: transform var(--normal) var(--ease);
}

.vote-candidate-card:hover .vote-candidate-image {
    transform: scale(1.03);
}

.vote-btn {
    background: var(--coc-gradient-cta);
    color: #3d2900;
    border: none;
    border-radius: var(--radius-pill);
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--coc-font-display);
    letter-spacing: 0.02em;
    transition: all var(--normal) var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-align: center;
    line-height: 1;
    box-shadow: var(--coc-shadow-gold);
}

.vote-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(255, 215, 0, 0.55);
    color: #3d2900;
}

.vote-btn:disabled {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.5);
    transform: none;
    box-shadow: none;
}

.vote-selection-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(0, 232, 255, 0.25);
    border: 1px solid var(--coc-cyan);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all var(--normal) var(--ease);
    box-shadow: 0 4px 14px rgba(0, 232, 255, 0.3);
}

.vote-candidate-card.selected .vote-selection-indicator {
    opacity: 1;
    transform: scale(1);
}

.vote-candidate-number {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--coc-gradient-cta);
    color: #3d2900;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    font-family: var(--coc-font-display);
    box-shadow: var(--coc-shadow-gold);
}

.vote-modal-content {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 232, 255, 0.2);
    background: linear-gradient(165deg, var(--coc-bg-3) 0%, var(--coc-bg-2) 100%);
    color: #fff;
    box-shadow: var(--shadow-lg), var(--coc-shadow-cyan);
}

.vote-modal-content .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vote-modal-content .modal-title,
.vote-modal-content h5 {
    color: #fff;
    font-family: var(--coc-font-display);
}

.vote-modal-content .modal-body p {
    color: rgba(255, 255, 255, 0.82);
}

.vote-modal-content .modal-body strong {
    color: var(--coc-cyan);
}

.vote-modal-content .btn-close {
    filter: invert(1) brightness(1.5);
}

/* Thank You Animation */
.vote-thank-you-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 16, 32, 0.96);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
}

.vote-thank-you-content {
    text-align: center;
    color: white;
    transform: scale(0.8);
    opacity: 0;
    animation: voteThankYouAnim 0.6s var(--ease) forwards;
}

.vote-thank-you-content h1,
.vote-thank-you-content h2,
.vote-thank-you-content h3,
.vote-thank-you-content p {
    color: #fff;
}

.thank-you-icon {
    font-size: clamp(110px, 18vw, 180px);
    color: var(--coc-gold);
    margin-bottom: 28px;
    filter: drop-shadow(0 0 32px rgba(255, 215, 0, 0.65));
}

.thank-you-title {
    font-family: var(--coc-font-display);
    letter-spacing: 0.03em;
    font-size: clamp(2rem, 6vw, 3.25rem);
}

.thank-you-text {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
}

@keyframes voteThankYouAnim {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   Login / envelope screen (index.php)
   ========================================================================== */

body:has(#envelope-animation) {
    background: var(--gradient-hero);
    background-attachment: fixed;
    font-family: var(--coc-font-body);
}

#envelope-animation {
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 1.5rem;
}

.envelope-container {
    text-align: center;
    color: white;
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 232, 255, 0.35);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--coc-shadow-cyan), 0 0 80px rgba(247, 92, 255, 0.12);
    animation: floatIn 0.6s var(--ease) both;
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.envelope {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 232, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto 10px;
    animation: pulseGlow 2.6s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 232, 255, 0.35);
    }

    50% {
        box-shadow: 0 0 0 14px rgba(247, 92, 255, 0);
    }
}

.ballot-icon {
    font-size: 46px;
    color: white;
}

.envelope-container h1,
.envelope-container h2,
.envelope-container h3,
.envelope-container h4,
.envelope-container h5 {
    color: #fff;
}

#envelope-title {
    font-size: 1.7rem;
    letter-spacing: 0.02em;
    font-family: var(--coc-font-display);
    text-shadow: 0 0 20px rgba(0, 232, 255, 0.5);
}

#envelope-form .input-group-text {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(0, 232, 255, 0.3);
    border-right: none;
    color: var(--coc-cyan);
    font-size: 1.1rem;
}

#envelope-form .form-control {
    border: 1px solid rgba(0, 232, 255, 0.3);
    border-left: none;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-family: var(--coc-font-body);
    font-weight: 600;
    letter-spacing: 0.08em;
}

#envelope-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: normal;
    font-weight: 400;
}

#envelope-form .form-control:focus {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    box-shadow: none;
}

#kode-unik-submit {
    background: var(--coc-gradient-cta) !important;
    color: #3d2900 !important;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-family: var(--coc-font-display);
    letter-spacing: 0.02em;
    box-shadow: var(--coc-shadow-gold);
}

#kode-unik-submit:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
}

/* Voter Code Styling */
.voter-code {
    font-family: "Courier New", Courier, "Lucida Console", Monaco, monospace !important;
    font-weight: bold;
    font-size: 14px;
    background-color: #f0f0f1;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    color: var(--accent);
    letter-spacing: 1px;
    border: 1px solid var(--border-strong);
    display: inline-block;
}

/* Admin context styling */
.wp-admin .voter-code {
    background-color: #f0f0f1;
    color: var(--accent);
}

/* Front-end context styling */
body:not(.wp-admin) .voter-code {
    background-color: #e8f4fd;
    color: var(--accent);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767.98px) {
    h1 {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .vote-hero-section {
        padding: 1.75rem 0;
    }

    .vote-candidate-image {
        height: 200px;
    }

    .envelope-container {
        padding: 1.75rem !important;
    }
}

@media (max-width: 400px) {
    .envelope {
        width: 84px;
        height: 84px;
    }

    .ballot-icon {
        font-size: 36px;
    }
}

/* ==========================================================================
   Modern interactive layer — animated blobs, stagger-in, glow, ripple
   ========================================================================== */

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(4%, -6%) scale(1.08); }
    66% { transform: translate(-3%, 4%) scale(0.95); }
}

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

@keyframes shimmerSweep {
    0% { transform: translateX(-120%) skewX(-15deg); }
    100% { transform: translateX(220%) skewX(-15deg); }
}

@keyframes ringPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 232, 255, 0.5); }
    70% { box-shadow: 0 0 0 12px rgba(0, 232, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 232, 255, 0); }
}

@keyframes fillLine {
    from { width: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .bg-orb { animation: none !important; }
    .vote-candidate-card { animation: none !important; }
}

/* Decorative floating orbs, shared by hero + login screens */
.vote-hero-section,
#envelope-animation {
    isolation: isolate;
}

.vote-hero-section::after,
#envelope-animation::after {
    content: '';
    position: absolute;
    inset: -20%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 25%, rgba(0, 232, 255, 0.35), transparent 40%),
        radial-gradient(circle at 80% 75%, rgba(247, 92, 255, 0.28), transparent 42%),
        radial-gradient(circle at 50% 100%, rgba(255, 215, 0, 0.15), transparent 45%);
    animation: blobFloat 14s ease-in-out infinite;
    filter: blur(4px);
}

#envelope-animation {
    position: relative;
    overflow: hidden;
}

/* Hero title gets a Clash of Champions style neon shimmer treatment */
.vote-hero-section h1 {
    font-family: var(--coc-font-display);
    background: linear-gradient(100deg, #ffffff 20%, var(--coc-cyan) 40%, var(--coc-magenta) 55%, #ffffff 75%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerText 4s linear infinite;
    letter-spacing: 0.02em;
}

@keyframes shimmerText {
    to { background-position: -200% center; }
}

/* Candidate cards: staggered entrance + refined hover */
.vote-candidate-card {
    opacity: 0;
    animation: fadeInUp 0.55s var(--ease) forwards;
    position: relative;
    will-change: transform;
}

#candidates-container>div:nth-child(1) .vote-candidate-card { animation-delay: 0.05s; }
#candidates-container>div:nth-child(2) .vote-candidate-card { animation-delay: 0.15s; }
#candidates-container>div:nth-child(3) .vote-candidate-card { animation-delay: 0.25s; }
#candidates-container>div:nth-child(4) .vote-candidate-card { animation-delay: 0.35s; }
#candidates-container>div:nth-child(5) .vote-candidate-card { animation-delay: 0.45s; }
#candidates-container>div:nth-child(6) .vote-candidate-card { animation-delay: 0.55s; }

.vote-candidate-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: var(--coc-gradient-accent);
    opacity: 0;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    transition: opacity var(--normal) var(--ease);
    pointer-events: none;
    z-index: 2;
}

.vote-candidate-card:hover::before {
    opacity: 1;
}

.vote-candidate-card.selected {
    outline: none;
    box-shadow: var(--shadow-lg), 0 0 0 3px var(--coc-cyan), var(--coc-shadow-cyan);
    transform: translateY(-4px);
}

.vote-candidate-card.selected .vote-selection-indicator {
    animation: ringPulse 1.6s ease-out infinite;
}

.vote-candidate-number {
    transition: transform var(--normal) var(--ease);
}

.vote-candidate-card:hover .vote-candidate-number {
    transform: scale(1.1) rotate(-4deg);
}

/* Progress steps: animated fill + bolder active state */
.step-connector.completed {
    background: var(--coc-gold);
    animation: fillLine 0.6s var(--ease) both;
}

.progress-step.active .step-circle {
    box-shadow: 0 4px 20px rgba(0, 232, 255, 0.5), 0 0 0 4px rgba(0, 232, 255, 0.15);
}

/* Vote CTA: glow pulse when ready + shimmer sweep */
.vote-btn {
    position: relative;
    overflow: hidden;
}

.vote-btn:not(:disabled) {
    animation: ctaGlow 2.4s ease-in-out infinite;
}

@keyframes ctaGlow {
    0%, 100% { box-shadow: var(--coc-shadow-gold); }
    50% { box-shadow: 0 8px 40px rgba(255, 215, 0, 0.7); }
}

.vote-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: translateX(-120%) skewX(-15deg);
}

.vote-btn:not(:disabled):hover::after {
    animation: shimmerSweep 0.9s ease;
}

/* Login form: focus glow + button shimmer */
#envelope-form .input-group {
    transition: transform var(--fast) var(--ease);
}

#envelope-form .input-group:focus-within {
    transform: translateY(-2px);
}

#envelope-form .input-group:focus-within .input-group-text {
    background: rgba(255, 255, 255, 0.09) !important;
    border-color: var(--coc-cyan);
    box-shadow: 0 0 0 3px rgba(0, 232, 255, 0.25);
}

#envelope-form .input-group:focus-within .form-control {
    border-color: var(--coc-cyan);
}

#kode-unik-submit {
    position: relative;
    overflow: hidden;
}

#kode-unik-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: translateX(-120%) skewX(-15deg);
}

#kode-unik-submit:hover::after {
    animation: shimmerSweep 0.9s ease;
}

.envelope {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25);
}

/* Ripple feedback for clickable candidate cards */
@keyframes shakeInput {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-7px); }
    40%, 60% { transform: translateX(7px); }
}

.input-shake {
    animation: shakeInput 0.5s var(--ease);
}

.vote-candidate-card .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(2, 132, 199, 0.35);
    transform: scale(0);
    animation: rippleAnim 0.6s var(--ease);
    pointer-events: none;
    z-index: 3;
}

@keyframes rippleAnim {
    to {
        transform: scale(3);
        opacity: 0;
    }
}
