/* DR E-Voting v0.21.7 compatibility layer.
   Fixes theme wrappers that make portals look embedded and improves contrast
   when a compatible theme exposes its dark-mode state on html[data-theme="dark"]. */

/* Keep the active WordPress theme header and footer visible. The plugin should
   expand within the normal page flow, never replace or cover the site chrome. */
body.dr-evoting-app-page .skip-link:not(:focus) { position:absolute !important; clip:rect(0,0,0,0) !important; clip-path:inset(50%) !important; width:1px !important; height:1px !important; overflow:hidden !important; white-space:nowrap !important; }
body.dr-evoting-app-page .site-shell { display:block !important; min-height:0; width:100%; max-width:none; margin:0; padding:0; }
body.dr-evoting-app-page #main-content,
body.dr-evoting-app-page main.content-area,
body.dr-evoting-app-page main.standard-page,
body.dr-evoting-app-page .site-main,
body.dr-evoting-app-page .dr-evoting-route-recovery { width:100% !important; max-width:none !important; min-width:0; margin:0 !important; padding:0 !important; }
body.dr-evoting-app-page .entry-card,
body.dr-evoting-app-page article.entry-card,
body.dr-evoting-app-page .entry-header,
body.dr-evoting-app-page .entry-content { width:100% !important; max-width:none !important; margin:0 !important; padding:0 !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; background:transparent !important; }
body.dr-evoting-app-page .entry-header { display:none !important; }
body.dr-evoting-app-page .dr-ev-app { width:100% !important; max-width:1600px !important; margin:0 auto !important; border-radius:0 !important; min-height:0; }
body.dr-evoting-app-page .dr-ev-candidate-app,
body.dr-evoting-app-page .dre-fintech-portal,
body.dr-evoting-app-page .dr-ev-org-login-wrap { width:100% !important; max-width:none !important; margin:0 auto !important; }
body.dr-evoting-app-page .dr-ev-app .dr-ev-app-shell-nav { top:0; }
@media(min-width:1500px){body.dr-evoting-app-page .dr-ev-app{padding-left:clamp(24px,3vw,56px)!important;padding-right:clamp(24px,3vw,56px)!important}}

/* v0.21.11: preserve the theme header and footer on plugin pages. */

/* Dark mode — use high-specificity rules because plugin components include legacy fixed colors. */
html[data-theme="dark"] .dr-ev-app,
html[data-theme="dark"] .dr-ev-candidate-app,
html[data-theme="dark"] .dr-ev-admin,
html[data-theme="dark"] .dr-ev-grid,
html[data-theme="dark"] .dre-fintech-portal,
html[data-theme="dark"] .dr-ev-org-login-wrap {
  --dre-ink:#edf2fb; --ink:#edf2fb; --muted:#b5c1d4; --line:#344258; --surface:#151f30; --soft:#111a29;
  color:#edf2fb !important; color-scheme:dark;
}
html[data-theme="dark"] .dr-ev-app,
html[data-theme="dark"] .dr-ev-candidate-app,
html[data-theme="dark"] .dr-ev-admin,
html[data-theme="dark"] .dr-ev-grid { background:#0b1220 !important; }
html[data-theme="dark"] .dr-ev-app p,
html[data-theme="dark"] .dr-ev-app li,
html[data-theme="dark"] .dr-ev-app label,
html[data-theme="dark"] .dr-ev-app legend,
html[data-theme="dark"] .dr-ev-app small,
html[data-theme="dark"] .dr-ev-app dt,
html[data-theme="dark"] .dr-ev-app dd,
html[data-theme="dark"] .dr-ev-app td,
html[data-theme="dark"] .dr-ev-app th,
html[data-theme="dark"] .dr-ev-candidate-app p,
html[data-theme="dark"] .dr-ev-candidate-app li,
html[data-theme="dark"] .dr-ev-candidate-app label,
html[data-theme="dark"] .dr-ev-candidate-app small,
html[data-theme="dark"] .dr-ev-candidate-app td,
html[data-theme="dark"] .dr-ev-candidate-app th,
html[data-theme="dark"] .dre-fintech-portal p,
html[data-theme="dark"] .dre-fintech-portal li,
html[data-theme="dark"] .dre-fintech-portal label,
html[data-theme="dark"] .dre-fintech-portal small,
html[data-theme="dark"] .dr-ev-org-login-wrap p,
html[data-theme="dark"] .dr-ev-org-login-wrap label { color:#d8e1ef !important; }
html[data-theme="dark"] .dr-ev-app h1,
html[data-theme="dark"] .dr-ev-app h2,
html[data-theme="dark"] .dr-ev-app h3,
html[data-theme="dark"] .dr-ev-app h4,
html[data-theme="dark"] .dr-ev-app h5,
html[data-theme="dark"] .dr-ev-app h6,
html[data-theme="dark"] .dr-ev-app strong,
html[data-theme="dark"] .dr-ev-app b,
html[data-theme="dark"] .dr-ev-candidate-app h1,
html[data-theme="dark"] .dr-ev-candidate-app h2,
html[data-theme="dark"] .dr-ev-candidate-app h3,
html[data-theme="dark"] .dr-ev-candidate-app strong,
html[data-theme="dark"] .dre-fintech-portal h1,
html[data-theme="dark"] .dre-fintech-portal h2,
html[data-theme="dark"] .dre-fintech-portal h3,
html[data-theme="dark"] .dre-fintech-portal strong { color:#f5f7ff !important; }
html[data-theme="dark"] .dr-ev-app .dr-ev-election-card,
html[data-theme="dark"] .dr-ev-app .dr-ev-category-card,
html[data-theme="dark"] .dr-ev-app .dr-ev-candidate-card,
html[data-theme="dark"] .dr-ev-app .dr-ev-profile,
html[data-theme="dark"] .dr-ev-app .dr-ev-panel,
html[data-theme="dark"] .dr-ev-app .dr-ev-empty,
html[data-theme="dark"] .dr-ev-app .dr-ev-election-search,
html[data-theme="dark"] .dr-ev-candidate-app .dr-ev-candidate-panel,
html[data-theme="dark"] .dr-ev-candidate-app .dr-ev-candidate-card,
html[data-theme="dark"] .dr-ev-candidate-app .dr-ev-panel,
html[data-theme="dark"] .dre-fintech-portal .dre-portal-card,
html[data-theme="dark"] .dr-ev-org-login-wrap .dr-ev-panel { background:#151f30 !important; border-color:#344258 !important; color:#edf2fb !important; }
html[data-theme="dark"] .dr-ev-app .dr-ev-app-shell-nav,
html[data-theme="dark"] .dr-ev-app .dr-ev-secondary,
html[data-theme="dark"] .dr-ev-app .dr-ev-voter-quicklinks,
html[data-theme="dark"] .dr-ev-candidate-app nav,
html[data-theme="dark"] .dre-portal-nav { background:#111a29 !important; border-color:#344258 !important; }
html[data-theme="dark"] .dr-ev-app a:not(.dr-ev-primary),
html[data-theme="dark"] .dr-ev-candidate-app a:not(.dr-ev-candidate-button),
html[data-theme="dark"] .dre-fintech-portal a { color:#b9caff; }
html[data-theme="dark"] .dr-ev-app .dr-ev-app-shell-nav a,
html[data-theme="dark"] .dr-ev-candidate-app nav a { color:#d8e1ef !important; }
html[data-theme="dark"] .dr-ev-app input:not([type=checkbox]):not([type=radio]):not([type=submit]),
html[data-theme="dark"] .dr-ev-app select,
html[data-theme="dark"] .dr-ev-app textarea,
html[data-theme="dark"] .dr-ev-candidate-app input:not([type=checkbox]):not([type=radio]):not([type=submit]),
html[data-theme="dark"] .dr-ev-candidate-app select,
html[data-theme="dark"] .dr-ev-candidate-app textarea,
html[data-theme="dark"] .dre-fintech-portal input:not([type=checkbox]):not([type=radio]):not([type=submit]),
html[data-theme="dark"] .dre-fintech-portal select,
html[data-theme="dark"] .dre-fintech-portal textarea { background:#0d1727 !important; color:#f4f7ff !important; border-color:#455571 !important; }
html[data-theme="dark"] .dr-ev-app input::placeholder,
html[data-theme="dark"] .dr-ev-app textarea::placeholder,
html[data-theme="dark"] .dr-ev-candidate-app input::placeholder,
html[data-theme="dark"] .dr-ev-candidate-app textarea::placeholder { color:#aebbd1 !important; opacity:1 !important; }
html[data-theme="dark"] .dr-ev-app table,
html[data-theme="dark"] .dr-ev-app tr,
html[data-theme="dark"] .dr-ev-app th,
html[data-theme="dark"] .dr-ev-app td,
html[data-theme="dark"] .dr-ev-candidate-app table,
html[data-theme="dark"] .dr-ev-candidate-app tr,
html[data-theme="dark"] .dr-ev-candidate-app th,
html[data-theme="dark"] .dr-ev-candidate-app td { border-color:#344258 !important; color:#d8e1ef !important; }
html[data-theme="dark"] .dr-ev-app .dr-ev-primary,
html[data-theme="dark"] .dr-ev-app button,
html[data-theme="dark"] .dr-ev-candidate-app button,
html[data-theme="dark"] .dr-ev-candidate-app .dr-ev-candidate-button { color:#fff !important; }
html[data-theme="dark"] .dr-ev-app .dr-ev-secondary { color:#edf2fb !important; }
html[data-theme="dark"] .dr-ev-app .notice,
html[data-theme="dark"] .dr-ev-app .error,
html[data-theme="dark"] .dr-ev-app .success,
html[data-theme="dark"] .dr-ev-candidate-app .notice,
html[data-theme="dark"] .dr-ev-candidate-app .error,
html[data-theme="dark"] .dr-ev-candidate-app .success { color:#edf2fb !important; }

/* v0.21.9 readability fix: receipts and leaderboards must remain legible in either theme. */
.dr-ev-receipt,.dr-ev-receipt p,.dr-ev-receipt li,.dr-ev-receipt td,.dr-ev-receipt th,
.dr-ev-leaderboard,.dr-ev-leaderboard p,.dr-ev-leaderboard li,.dr-ev-leaderboard td,.dr-ev-leaderboard th,
.dr-ev-org-leaderboard,.dr-ev-org-leaderboard p,.dr-ev-org-leaderboard td,.dr-ev-org-leaderboard th { color:var(--dr-ev-text,#172033); }
html[data-theme="dark"] .dr-ev-receipt,html[data-theme="dark"] .dr-ev-receipt p,html[data-theme="dark"] .dr-ev-receipt li,html[data-theme="dark"] .dr-ev-receipt td,html[data-theme="dark"] .dr-ev-receipt th,
html[data-theme="dark"] .dr-ev-leaderboard,html[data-theme="dark"] .dr-ev-leaderboard p,html[data-theme="dark"] .dr-ev-leaderboard li,html[data-theme="dark"] .dr-ev-leaderboard td,html[data-theme="dark"] .dr-ev-leaderboard th,
html[data-theme="dark"] .dr-ev-org-leaderboard,html[data-theme="dark"] .dr-ev-org-leaderboard p,html[data-theme="dark"] .dr-ev-org-leaderboard td,html[data-theme="dark"] .dr-ev-org-leaderboard th { color:#e7edf7 !important; }
html[data-theme="dark"] .dr-ev-receipt a,html[data-theme="dark"] .dr-ev-leaderboard a,html[data-theme="dark"] .dr-ev-org-leaderboard a { color:#8fc5ff !important; }


/* v0.21.10: branded fintech modal for closed elections */
.dr-ev-modal-backdrop{position:fixed;inset:0;z-index:999999;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(5,13,27,.68);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}
.dr-ev-modal-backdrop.is-open{display:flex;animation:drEvModalFade .18s ease-out}
.dr-ev-modal-card{box-sizing:border-box;width:min(100%,440px);max-height:calc(100vh - 40px);overflow:auto;padding:30px 28px 24px;border:1px solid rgba(218,173,48,.38);border-radius:24px;background:linear-gradient(155deg,#fff 0%,#f7f9fc 100%);box-shadow:0 28px 90px rgba(0,0,0,.34);color:#14233b;text-align:center;outline:none}
.dr-ev-modal-brand{display:flex;align-items:center;justify-content:center;gap:10px;margin-bottom:24px;color:#14233b;font-size:12px;font-weight:800;letter-spacing:.12em}
.dr-ev-modal-mark{display:grid;place-items:center;width:36px;height:36px;border-radius:12px;background:#d9ad2e;color:#10213b;font-size:13px;font-weight:900;letter-spacing:0;box-shadow:0 5px 14px rgba(217,173,46,.25)}
.dr-ev-modal-icon{display:grid;place-items:center;width:58px;height:58px;margin:0 auto 16px;border-radius:18px;background:#fff4d5;color:#9a6a00}
.dr-ev-modal-icon svg{width:29px;height:29px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.dr-ev-modal-card h2{margin:0 0 10px;color:#14233b;font-size:23px;line-height:1.25;font-weight:800;letter-spacing:-.025em}
.dr-ev-modal-card p{margin:0;color:#536176;font-size:14px;line-height:1.65;overflow-wrap:anywhere}
.dr-ev-modal-confirm{display:block;width:100%;min-height:48px;margin:24px 0 14px;padding:12px 18px;border:0;border-radius:14px;background:linear-gradient(135deg,#d9ad2e,#f0cc64);color:#10213b!important;font-size:14px;font-weight:800;cursor:pointer;box-shadow:0 8px 20px rgba(177,133,16,.2);transition:transform .15s ease,box-shadow .15s ease}
.dr-ev-modal-confirm:hover{transform:translateY(-1px);box-shadow:0 11px 24px rgba(177,133,16,.28)}
.dr-ev-modal-confirm:focus-visible{outline:3px solid #527fca;outline-offset:3px}
.dr-ev-modal-card .dr-ev-modal-footnote{font-size:11px;color:#7a8798}
body.dr-ev-modal-open{overflow:hidden}
html[data-theme="dark"] .dr-ev-modal-card{background:linear-gradient(155deg,#101c2e 0%,#17263b 100%);border-color:rgba(240,204,100,.42);color:#edf3fc}
html[data-theme="dark"] .dr-ev-modal-brand,html[data-theme="dark"] .dr-ev-modal-card h2{color:#f4f7fc}
html[data-theme="dark"] .dr-ev-modal-card p{color:#c2cee0}
html[data-theme="dark"] .dr-ev-modal-icon{background:#382f1b;color:#f0cc64}
html[data-theme="dark"] .dr-ev-modal-card .dr-ev-modal-footnote{color:#a9b8ce}
@keyframes drEvModalFade{from{opacity:0}to{opacity:1}}
@media(max-width:480px){.dr-ev-modal-backdrop{padding:14px}.dr-ev-modal-card{padding:24px 20px 20px;border-radius:20px}.dr-ev-modal-card h2{font-size:21px}}
@media(prefers-reduced-motion:reduce){.dr-ev-modal-backdrop.is-open{animation:none}.dr-ev-modal-confirm{transition:none}}
