/* Vote form injected at the bottom of every survey page by vote_form.html.
   Shared tokens (--primary-color, --accent-color, --border-color) come from style.css. */

.vote {
    margin-top: 30px;
    padding: 25px 30px 30px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 8px;
}

.vote-title {
    margin: 0 0 20px;
    font-size: 20px;
    color: var(--primary-color);
}

.vote-form fieldset {
    margin: 0 0 25px;
    padding: 0;
    border: none;
}

.vote-form legend {
    padding: 0;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #667;
}

/* --- BALLOT OPTIONS --- */

.vote-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.vote-option:hover {
    border-color: var(--accent-color);
    background-color: #f4fbf7;
}

.vote-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent-color);
    flex: none;
}

/* :has keeps the selected row highlighted without any JS bookkeeping. */
.vote-option:has(input:checked) {
    border-color: var(--accent-color);
    background-color: #e8f8f5;
    font-weight: 600;
}

.vote-option:has(input:focus-visible) {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* --- HOUSE / APARTMENT --- */

.vote-selects {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.vote-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.vote-field span {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.vote-field select {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-color);
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.vote-field select:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 1px;
}

/* --- SUBMIT --- */

.vote-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 28px;
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    background-color: var(--accent-color);
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.vote-submit:hover,
.vote-submit:focus-visible {
    background-color: #219150;
    border-color: #219150;
    color: #fff;
}

/* --- READ-ONLY BALLOT --- */

.vote-options-preview {
    opacity: 0.75;
}

.vote-options-preview .vote-option {
    cursor: default;
}

.vote-sign-in {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-top: 18px;
}

.vote-sign-in .vote-note {
    margin: 0;
}

.vote-note {
    margin: 12px 0 0;
    font-size: 13px;
    color: #666;
}

.vote-closed {
    margin: 0;
    padding: 14px 16px;
    background-color: #eef0f2;
    border-left: 5px solid #98a6b3;
    border-radius: 0 4px 4px 0;
    color: #5b6b7a;
}

@media (max-width: 768px) {
    .vote {
        padding: 20px;
    }

    .vote-selects {
        flex-direction: column;
        gap: 15px;
    }

    .vote-field {
        min-width: 0;
    }

    .vote-submit {
        width: 100%;
    }

    .vote-sign-in {
        align-items: stretch;
    }
}
