/* Front-end styling for the voting form */
:root {
    --stv-bg: linear-gradient(120deg, #0a1f3c, #182d45);
    --stv-panel: #0f1b2f;
    --stv-border: #1f2f45;
    --stv-accent: #5de4c7;
    --stv-accent-strong: #3cc9ae;
    --stv-text: #eef2f7;
    --stv-muted: #9fb0c6;
    --stv-card: rgba(255, 255, 255, 0.04);
    --stv-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
    --stv-radius: 14px;
    --stv-font: "Work Sans", "Segoe UI", "Helvetica Neue", sans-serif;
}

.stv-vote-form {
    background: var(--stv-bg);
    padding: 2.5rem 1.5rem;
    display: flex;
    justify-content: center;
    color: var(--stv-text);
    font-family: var(--stv-font);
}

.stv-vote-form__shell {
    width: min(960px, 100%);
    background: var(--stv-card);
    border: 1px solid var(--stv-border);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: var(--stv-shadow);
    backdrop-filter: blur(6px);
}

.stv-vote-form__header {
    margin-bottom: 1.5rem;
    text-align: left;
}

.stv-vote-form__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--stv-accent);
    font-size: 0.75rem;
    margin: 0 0 0.35rem;
    font-weight: 700;
}

.stv-vote-form__title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.stv-vote-form__lede {
    margin: 0.35rem 0 0;
    color: var(--stv-muted);
    line-height: 1.6;
}

.stv-vote-form__form {
    display: grid;
    gap: 1.5rem;
}

.stv-vote-form__panel {
    background: var(--stv-panel);
    border: 1px solid var(--stv-border);
    border-radius: var(--stv-radius);
    padding: 1.25rem;
}

.stv-vote-form__panel-head h3 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    color: #fff;
}

.stv-vote-form__panel-head p {
    margin: 0;
    color: var(--stv-muted);
    line-height: 1.55;
}

.stv-vote-form__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stv-vote-form__actions {
    margin-top: 0.5rem;
}

.stv-vote-form__actions .button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--stv-border);
    color: #fff;
    border-radius: 10px;
    padding: 0.55rem 0.95rem;
    cursor: pointer;
}

.stv-vote-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: #fff;
}

.stv-vote-form__field input {
    background: #0b1728;
    border: 1px solid var(--stv-border);
    color: #fff;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    font-size: 1rem;
    transition: border 0.2s ease, transform 0.1s ease;
}

.stv-vote-form__field input:focus {
    outline: none;
    border-color: var(--stv-accent);
    box-shadow: 0 0 0 3px rgba(93, 228, 199, 0.18);
    transform: translateY(-1px);
}

.stv-vote-form__candidates {
    min-height: 7rem;
    padding: 0.5rem;
    list-style: none;
    margin: 1rem 0 0;
    display: grid;
    gap: 0.75rem;
}

.stv-vote-form__candidates li {
    background: linear-gradient(135deg, rgba(93, 228, 199, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--stv-border);
    border-radius: 14px;
    padding: 0.85rem 0.95rem;
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.15s ease, border 0.2s ease, background 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.stv-vote-form__candidates li:hover {
    border-color: var(--stv-accent);
    transform: translateY(-1px);
}

.stv-vote-form__candidates li:last-child {
    margin-bottom: 0;
}

.stv-vote-form__candidates li.is-unranked {
    opacity: 0.55;
    text-decoration: none;
    border-style: dashed;
    background: rgba(255, 255, 255, 0.03);
}

.stv-vote-form__candidates li.is-dragging {
    opacity: 0.5;
    transform: translateY(-2px);
}

.stv-vote-form__candidate-main {
    display: grid;
    grid-template-columns: auto auto auto 1fr;
    gap: 0.65rem;
    align-items: center;
}

.stv-vote-form__candidate-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(93, 228, 199, 0.4), rgba(255, 255, 255, 0.05));
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.stv-vote-form__candidate-handle {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    color: var(--stv-muted);
    position: relative;
}

.stv-vote-form__candidate-handle::before,
.stv-vote-form__candidate-handle::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 2px;
    background: var(--stv-muted);
    border-radius: 2px;
    left: 5px;
}

.stv-vote-form__candidate-handle::before {
    top: 6px;
}

.stv-vote-form__candidate-handle::after {
    bottom: 6px;
}

.stv-vote-form__candidate-rank {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(93, 228, 199, 0.14);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    border: 1px solid rgba(93, 228, 199, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.stv-vote-form__candidate-name {
    font-weight: 600;
    color: #fff;
}

.stv-vote-form__candidate-toggle {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    border-radius: 999px;
    border: 1px solid var(--stv-border);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transition: all 0.15s ease;
}

.stv-vote-form__candidate-toggle:hover {
    border-color: var(--stv-accent);
    background: rgba(93, 228, 199, 0.08);
}

.stv-vote-form__empty {
    color: var(--stv-muted);
    text-align: center;
    padding: 1rem;
    border: 1px dashed var(--stv-border);
    border-radius: 10px;
}

.stv-vote-form__footer {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.stv-vote-form__notice {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--stv-border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    max-width: 520px;
}

.stv-vote-form__notice p {
    margin: 0.2rem 0 0;
    color: var(--stv-muted);
}

.stv-vote-form__submit {
    background: linear-gradient(120deg, var(--stv-accent), var(--stv-accent-strong));
    border: none;
    color: #0a1f3c;
    font-weight: 700;
    padding: 0.95rem 1.4rem;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 14px 25px rgba(93, 228, 199, 0.25);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.stv-vote-form__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(93, 228, 199, 0.33);
}

.stv-vote-form__submit:active {
    transform: translateY(0);
}

.stv-vote-form__feedback {
    margin-top: 0.75rem;
    font-weight: 700;
    color: var(--stv-accent);
}

.stv-vote-form__feedback[data-status-type="error"] {
    color: #ff9b9b;
}

.stv-vote-form__feedback[data-status-type="info"] {
    color: var(--stv-muted);
}

@media (max-width: 640px) {
    .stv-vote-form {
        padding: 1rem;
    }

    .stv-vote-form__shell {
        padding: 1.25rem;
    }

    .stv-vote-form__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .stv-vote-form__submit {
        width: 100%;
        text-align: center;
    }
}
