/* Halsan Vote — Frontend Styles */

.halsan-vote-wrap {
    max-width: 640px;
    margin: 2em auto;
    font-family: inherit;
}

.halsan-title {
    font-size: 1.6em;
    margin-bottom: 0.4em;
    color: #1a1a2e;
}

.halsan-desc {
    color: #555;
    margin-bottom: 1.2em;
}

/* Messages */
.halsan-msg {
    padding: 0.85em 1.2em;
    border-radius: 6px;
    margin-bottom: 1.2em;
    font-weight: 500;
    line-height: 1.5;
}
.halsan-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.halsan-error-msg {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Form */
.halsan-form fieldset {
    border: 1px solid #dde0e7;
    border-radius: 8px;
    padding: 1em 1.4em;
    margin-bottom: 1.2em;
}

.halsan-legend {
    font-weight: 600;
    font-size: 1em;
    padding: 0 0.5em;
    color: #333;
}

/* Candidate list */
.halsan-candidates {
    list-style: none;
    margin: 0.5em 0 0;
    padding: 0;
}

.halsan-candidate {
    margin: 0.5em 0;
}

.halsan-candidate-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75em;
    cursor: pointer;
    padding: 0.75em 1em;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.halsan-candidate-label:hover {
    background: #f0f4ff;
    border-color: #c5d3ff;
}

.halsan-candidate-label input[type="radio"] {
    margin-top: 0.2em;
    width: 18px;
    height: 18px;
    accent-color: #3b5bdb;
    flex-shrink: 0;
}

.halsan-candidate-label input[type="radio"]:checked ~ .halsan-candidate-name {
    color: #3b5bdb;
    font-weight: 600;
}

.halsan-candidate-label:has(input:checked) {
    background: #eef2ff;
    border-color: #7aa3ff;
}

.halsan-candidate-name {
    font-size: 1em;
    font-weight: 500;
    color: #222;
    line-height: 1.4;
}

.halsan-candidate-desc {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-top: 0.15em;
    line-height: 1.4;
}

/* Email field */
.halsan-email-wrap {
    margin-bottom: 1.2em;
}

.halsan-email-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4em;
    color: #333;
}

.halsan-email-input {
    width: 100%;
    padding: 0.65em 0.9em;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.halsan-email-input:focus {
    outline: none;
    border-color: #3b5bdb;
    box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.15);
}

.halsan-email-hint {
    font-size: 0.83em;
    color: #777;
    margin-top: 0.4em;
}

/* AJAX msg */
.halsan-ajax-msg {
    margin-bottom: 0.8em;
    padding: 0.7em 1em;
    border-radius: 6px;
    font-weight: 500;
}

/* Submit button */
.halsan-submit {
    background: #3b5bdb;
    color: #fff;
    border: none;
    padding: 0.75em 2em;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.halsan-submit:hover {
    background: #2d47b8;
}

.halsan-submit:disabled {
    background: #aaa;
    cursor: not-allowed;
}

/* Deadline */
.halsan-deadline {
    font-size: 0.85em;
    color: #888;
    margin-top: 1em;
}

/* Status badge */
.halsan-status {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 0.7em 1em;
    border-radius: 6px;
    margin: 1em 0;
}

/* Results table */
.halsan-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

.halsan-results-table th,
.halsan-results-table td {
    padding: 0.65em 0.9em;
    text-align: left;
    border-bottom: 1px solid #dde;
}

.halsan-results-table thead th {
    background: #f0f4ff;
    font-weight: 600;
    color: #333;
}

.halsan-results-table tfoot th {
    background: #f8f9fa;
    font-weight: 700;
}

.halsan-bar-wrap {
    display: flex;
    align-items: center;
    gap: 0.6em;
}

.halsan-bar {
    height: 18px;
    background: #3b5bdb;
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.4s ease;
}

.halsan-bar-wrap span {
    font-size: 0.85em;
    color: #555;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 480px) {
    .halsan-candidate-label {
        padding: 0.6em 0.75em;
    }
    .halsan-submit {
        width: 100%;
        text-align: center;
    }
}
