body.voter-page {
    min-height: 100vh;
    margin: 0;
    color: #172b4d;
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(-45deg, #dbeafe, #f0f9ff, #a7bfff, #00d4ff);
    background-size: 400% 400%;
    animation: voter-gradient 15s ease-in-out infinite;
}

.voter-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.voter-shape {
    position: absolute;
    opacity: .16;
    animation: voter-float 18s linear infinite;
}

.voter-shape--circle {
    border-radius: 50%;
    background: #00d4ff;
}

.voter-shape--square {
    background: #0066ff;
}

.voter-shape--triangle {
    width: 0;
    height: 0;
    border-right: 30px solid transparent;
    border-bottom: 52px solid #a7bfff;
    border-left: 30px solid transparent;
}

.voter-shape--top { top: 0; }
.voter-shape--bottom { bottom: 0; }

.voter-shell {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem);
}

.voter-shell--wide {
    align-items: flex-start;
}

.voter-card {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 48px rgba(27, 55, 93, .18), 0 3px 12px rgba(27, 55, 93, .08);
    animation: voter-appear .45s ease-out both;
}

.voter-card--form { max-width: 500px; }
.voter-card--results { max-width: 660px; }
.voter-card--ballot { max-width: 1160px; }

.voter-brand {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e8eef5;
    text-align: center;
}

.voter-logo {
    width: 82px;
    height: 82px;
    margin-bottom: .75rem;
    object-fit: contain;
}

.voter-brand-title {
    margin: 0;
    color: #102a43;
    font-size: 1.3rem;
    font-weight: 750;
}

.voter-brand-subtitle {
    margin: .25rem 0 0;
    color: #718096;
    font-size: .92rem;
}

.voter-eyebrow {
    margin-bottom: .35rem;
    color: #0b6fb3;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.voter-heading {
    color: #142b4a;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    font-weight: 750;
}

.voter-description {
    color: #6b7c93;
    line-height: 1.55;
}

.voter-page .form-label {
    color: #2d405b;
    font-size: .9rem;
    font-weight: 650;
}

.voter-page .form-control,
.voter-page .form-select {
    min-height: 48px;
    border-color: #d9e2ec;
    border-radius: .75rem;
}

.voter-page .form-control:focus,
.voter-page .form-select:focus {
    border-color: #2596d2;
    box-shadow: 0 0 0 .22rem rgba(37, 150, 210, .16);
}

.voter-page .btn {
    min-height: 46px;
    border-radius: .75rem;
    font-weight: 650;
}

.voter-page .btn-primary {
    border-color: #086bb5;
    background: linear-gradient(110deg, #0874c9, #12a9d6);
    box-shadow: 0 7px 16px rgba(8, 116, 201, .2);
}

.voter-page .btn-primary:hover {
    border-color: #075d9c;
    background: linear-gradient(110deg, #075f9f, #098db9);
    transform: translateY(-1px);
}

.voter-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 1.4rem;
    padding-top: 1rem;
    border-top: 1px solid #e8eef5;
}

.voter-footer a {
    color: #0874c9;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
}

.voter-footer a:hover { text-decoration: underline; }

.voter-status {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem;
    border: 1px solid #f5d47a;
    border-radius: .85rem;
    background: #fff8df;
    color: #805c0b;
}

.voter-status-icon {
    flex: 0 0 auto;
    font-size: 1.25rem;
}

.voter-reference {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .65rem .9rem;
    border: 1px solid #d5e9f8;
    border-radius: .7rem;
    background: #f2f9ff;
    color: #145987;
    font-weight: 700;
    letter-spacing: .04em;
}

.result-voter-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    gap: .65rem;
}

.result-voter-details > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .2rem;
    padding: .8rem;
    border: 1px solid #e4ecf4;
    border-radius: .75rem;
    background: #f7faff;
}

.result-voter-details span {
    color: #74869a;
    font-size: .75rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.result-voter-details strong {
    overflow-wrap: anywhere;
    color: #2d405b;
}

.result-list {
    display: grid;
    gap: .65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.result-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: .85rem 1rem;
    border: 1px solid #e2eaf3;
    border-radius: .75rem;
    background: #fff;
}

.result-position {
    color: #0874c9;
    font-weight: 700;
}

.result-item strong {
    color: #2d405b;
    text-align: right;
}

.voter-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin-top: 1rem;
}

.voter-summary span {
    padding: .4rem .7rem;
    border: 1px solid #e0eaf4;
    border-radius: 999px;
    background: #f6faff;
    color: #486581;
    font-size: .84rem;
}

.position-panel {
    margin-bottom: 1.25rem;
    padding: clamp(1rem, 2.5vw, 1.4rem);
    border: 1px solid #e2eaf3;
    border-radius: 1rem;
    background: rgba(248, 251, 255, .8);
}

.position-heading {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}

.position-number {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: .65rem;
    background: #e4f4ff;
    color: #0874c9;
    font-weight: 750;
}

.position-title {
    margin: 0;
    color: #173b61;
    font-size: 1.1rem;
    font-weight: 750;
}

.position-hint {
    margin: .15rem 0 0;
    color: #738399;
    font-size: .82rem;
}

.candidate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: .75rem;
}

.candidate-box {
    display: flex;
    min-height: 92px;
    align-items: center;
    gap: .85rem;
    margin: 0;
    padding: .8rem .9rem;
    border: 1px solid #e1e8f0;
    border-radius: .9rem;
    background: #fff;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .18s ease;
}

.candidate-box:hover {
    border-color: #95c9eb;
    box-shadow: 0 6px 16px rgba(36, 90, 130, .08);
    transform: translateY(-1px);
}

.candidate-box.selected {
    border-color: #1687ca;
    background: #f0f9ff;
    box-shadow: 0 0 0 2px rgba(22, 135, 202, .12);
}

.candidate-avatar {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    overflow: hidden;
    border: 1px solid #d5e4ef;
    border-radius: 50%;
    background: linear-gradient(145deg, #e6f4ff, #d9f3f5);
    color: #17688c;
    font-size: 1.1rem;
    font-weight: 750;
}

.candidate-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.candidate-info {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
}

.candidate-text { min-width: 0; }
.candidate-name { color: #233b53; font-weight: 700; }
.candidate-meta { color: #76869a; font-size: .82rem; }

.candidate-box .form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    flex: 0 0 auto;
    margin: 0 0 0 .25rem;
    cursor: pointer;
}

.candidate-box .form-check-input:checked {
    border-color: #0874c9;
    background-color: #0874c9;
}

.candidate-box:focus-within {
    outline: 3px solid rgba(22, 135, 202, .2);
    outline-offset: 2px;
}

.voter-submit-bar {
    position: sticky;
    z-index: 2;
    bottom: .75rem;
    margin-top: 1.25rem;
    padding: .8rem;
    border: 1px solid rgba(218, 230, 241, .9);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 24px rgba(27, 55, 93, .12);
    backdrop-filter: blur(10px);
}

@keyframes voter-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes voter-float {
    0% { transform: translateY(0) scale(1) rotate(0deg); }
    40% { transform: translateY(35vh) scale(1.1) rotate(120deg); }
    60% { transform: translateY(65vh) scale(1.1) rotate(240deg); }
    100% { transform: translateY(100vh) scale(1.2) rotate(360deg); }
}

@keyframes voter-appear {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 576px) {
    .voter-shell { padding: .8rem; }
    .voter-card { border-radius: 1rem; }
    .candidate-box { min-height: 82px; padding: .7rem; }
    .candidate-avatar { width: 50px; height: 50px; flex-basis: 50px; }
}

@media (prefers-reduced-motion: reduce) {
    body.voter-page,
    .voter-shape,
    .voter-card {
        animation: none;
    }

    .candidate-box,
    .voter-page .btn-primary {
        transition: none;
    }
}
