.cfoa-ballot {
    --cfoa-accent: #214a68;
    --cfoa-green: #176b36;
    --cfoa-inset: clamp(20px, 4vw, 36px);
    padding: var(--cfoa-inset);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 680px;
    overflow-wrap: anywhere;
    margin: 20px auto;
    border: 1px solid #d6dfe5;
    border-radius: 12px;
    background: #fff;
    color: #182e3e;
    font-family: inherit;
    line-height: 1.55;
}
.cfoa-ballot h2 { margin: 0 0 12px; font-size: 1.6em; color: inherit; }
.cfoa-ballot .cfoa-message { padding: 12px 16px; background: #edf3f7; border-radius: 6px; }
.cfoa-ballot fieldset { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
.cfoa-ballot legend { float: none; width: auto; padding: 0; border: 0; line-height: 1.4; font-weight: 700; margin-bottom: 12px; }
.cfoa-ballot .cfoa-option { display: flex; gap: 12px; align-items: center; border: 1px solid #c8d3db; padding: 14px; border-radius: 6px; margin: 10px 0; cursor: pointer; overflow-wrap: anywhere; }
.cfoa-ballot .cfoa-option:has(input:checked) { border-color: var(--cfoa-accent); background: #edf3f7; }
.cfoa-ballot input[type=radio] { appearance: auto; width: 18px; height: 18px; flex: 0 0 18px; margin: 0; accent-color: var(--cfoa-accent); }
.cfoa-ballot .cfoa-writein { margin: 16px 0; }
.cfoa-ballot [hidden] { display: none !important; }
.cfoa-ballot .cfoa-writein label { display: block; margin-bottom: 6px; font-weight: 600; }
.cfoa-ballot input[type=text] { box-sizing: border-box; width: 100%; border: 1px solid #899aa8; border-radius: 5px; padding: 12px; color: #182e3e; background: white; }
.cfoa-ballot .cfoa-submit, .cfoa-ballot .cfoa-login { display: inline-block; margin-top: 12px; border: 0; border-radius: 6px; padding: 13px 24px; background: var(--cfoa-accent); color: white; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
/* Override theme/Elementor link-state colors only on the ballot login button. */
.cfoa-ballot a.cfoa-login,
.cfoa-ballot a.cfoa-login:visited,
.cfoa-ballot a.cfoa-login:hover,
.cfoa-ballot a.cfoa-login:focus,
.cfoa-ballot a.cfoa-login:active {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: var(--cfoa-accent) !important;
    text-decoration: none !important;
}
.cfoa-ballot :focus-visible { outline: 3px solid #a76600; outline-offset: 3px; }
.cfoa-ballot .cfoa-note { font-size: .9em; margin: 14px 0 0; color: #4b5d69; text-wrap: pretty; text-align: center; }
.cfoa-ballot .cfoa-note-sentence { display: block; }
.cfoa-ballot .cfoa-note-sentence + .cfoa-note-sentence { margin-top: 4px; }
.cfoa-ballot.cfoa-recorded .cfoa-message { background: #e8f4ec; color: var(--cfoa-green); font-weight: 600; }
.cfoa-ballot .cfoa-check { font-size: 1.3em; }
/* Keep the legend inside a padded panel instead of across a fieldset background. */
.cfoa-ballot.cfoa-disabled form { margin: 20px 0 0; background: #f2f3f4; color: #5b6268; padding: 18px; border-radius: 8px; }
.cfoa-ballot.cfoa-disabled fieldset { margin: 0; padding: 0; }
.cfoa-ballot.cfoa-disabled .cfoa-option { background: #e8eaec; border-color: #c9cdd1; cursor: not-allowed; }
.cfoa-ballot.cfoa-disabled .cfoa-submit { background: #646b72; color: white; cursor: not-allowed; }
.cfoa-ballot .cfoa-login-panel { display: grid; isolation: isolate; }
.cfoa-ballot .cfoa-login-panel > form { grid-area: 1 / 1; opacity: .45; pointer-events: none; user-select: none; }
.cfoa-ballot .cfoa-login-overlay { grid-area: 1 / 1; z-index: 1; align-self: center; justify-self: center; box-sizing: border-box; max-width: 420px; margin: 18px; padding: clamp(18px, 4vw, 28px); text-align: center; background: #fff; color: #182e3e; border: 1px solid #c8d3db; border-radius: 10px; box-shadow: 0 4px 20px #182e3e18; }
.cfoa-ballot .cfoa-login-overlay h3 { margin: 0 0 12px; color: inherit; font-size: 1.25em; line-height: 1.35; }
.cfoa-ballot .cfoa-login-overlay p { margin: 0; }
@media (max-width: 480px) { .cfoa-ballot .cfoa-submit { width: 100%; } }

.cfoa-ballot.cfoa-disqualified .cfoa-message { color: #8a2424; background: #fce9e9; }

/* Keep controls contained in narrow Elementor columns and theme form styles. */
.cfoa-ballot *, .cfoa-ballot *::before, .cfoa-ballot *::after { box-sizing: border-box; }
.cfoa-ballot .cfoa-option span { min-width: 0; color: inherit; }
.cfoa-ballot .cfoa-login-panel { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.cfoa-ballot .cfoa-login-overlay { width: calc(100% - 36px); }
.cfoa-ballot button.cfoa-submit,
.cfoa-ballot button.cfoa-submit:hover,
.cfoa-ballot button.cfoa-submit:focus,
.cfoa-ballot button.cfoa-submit:active {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: var(--cfoa-accent) !important;
    max-width: 100%;
    white-space: normal;
}
.cfoa-ballot.cfoa-disabled button.cfoa-submit { background: #646b72 !important; }

/* High-contrast opening countdown, independent of the dimmed ballot behind it. */
.cfoa-ballot .cfoa-countdown-overlay {
    grid-area: 1 / 1;
    z-index: 1;
    align-self: center;
    justify-self: center;
    width: calc(100% - 24px);
    max-width: 480px;
    margin: 12px;
    padding: clamp(18px, 4vw, 28px);
    background: #102a43;
    color: #fff;
    border: 2px solid #ffdc73;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 6px 24px #102a4340;
}
.cfoa-ballot .cfoa-countdown-overlay h3 {
    margin: 0 0 18px;
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    font-size: clamp(22px, 3vw, 28px);
    line-height: 1.3;
    font-weight: 700;
}
.cfoa-ballot .cfoa-countdown-clock { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(76px, 100%), 1fr)); gap: 10px; }
.cfoa-ballot .cfoa-countdown-cell { min-width: 0; padding: 12px 4px; border: 1px solid #607d94; border-radius: 8px; background: #091e30; }
.cfoa-ballot .cfoa-countdown-value { display: block; color: #ffdc73 !important; -webkit-text-fill-color: #ffdc73; font-size: clamp(28px, 4vw, 38px); line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.cfoa-ballot .cfoa-countdown-unit { display: block; margin-top: 8px; color: #fff !important; -webkit-text-fill-color: #fff; font-size: 12px; line-height: 1.4; font-weight: 600; }
.cfoa-ballot .cfoa-countdown-help { margin: 18px 0 0; color: #fff !important; -webkit-text-fill-color: #fff; font-size: 14px; }
.cfoa-ballot .cfoa-countdown-overlay a.cfoa-login,
.cfoa-ballot .cfoa-countdown-overlay a.cfoa-login:visited,
.cfoa-ballot .cfoa-countdown-overlay a.cfoa-login:hover,
.cfoa-ballot .cfoa-countdown-overlay a.cfoa-login:focus,
.cfoa-ballot .cfoa-countdown-overlay a.cfoa-login:active { color: #102a43 !important; -webkit-text-fill-color: #102a43 !important; background: #fff !important; max-width: 100%; white-space: normal; }
.cfoa-ballot .cfoa-countdown-overlay :focus-visible { outline-color: #ffdc73; }

/* Compact closing clock stays in normal flow to avoid overlapping long titles. */
.cfoa-ballot .cfoa-ballot-header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: calc(-1 * var(--cfoa-inset)); padding-block: var(--cfoa-inset); }
.cfoa-ballot .cfoa-ballot-header ~ .cfoa-message { margin-top: 0; }
.cfoa-ballot .cfoa-ballot-header h2 { flex: 1 1 260px; min-width: 0; margin: 0; }
.cfoa-ballot .cfoa-closing-timer { flex: 0 1 auto; align-self: center; max-width: 100%; margin-left: auto; padding: 0; border: 0; background: transparent; text-align: right; line-height: 1.35; }
.cfoa-ballot .cfoa-closing-label { display: block; font-size: 12px; font-weight: 600; color: #182e3e !important; -webkit-text-fill-color: #182e3e; }
.cfoa-ballot .cfoa-closing-value { display: block; margin-top: 2px; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; color: #182e3e !important; -webkit-text-fill-color: #182e3e; }
.cfoa-ballot .cfoa-closed-notice { margin: 20px 0 0; padding: 18px; border-radius: 8px; background: #102a43; color: #fff !important; -webkit-text-fill-color: #fff; font-size: 20px; line-height: 1.4; font-weight: 700; text-align: center; }

/* Decorative vector watermark: below the controls, never a click target. */
.cfoa-ballot form { position: relative; isolation: isolate; }
.cfoa-ballot form::before {
    content: "";
    position: absolute;
    right: 8px;
    bottom: 12px;
    width: min(72%, 350px);
    aspect-ratio: 1;
    background: url("ballot-watermark-1.0.16.svg") center / contain no-repeat;
    opacity: .055;
    pointer-events: none;
    z-index: 0;
}
.cfoa-ballot fieldset { position: relative; z-index: 1; }
@media (forced-colors: active) { .cfoa-ballot form::before { display: none; } }
