/* =========================================================
   منصة الانتخابات — الواجهة العامة
   ========================================================= */
.election-ribbon { background: linear-gradient(90deg, #1b2a6b, #2a3a8f); color: #fff; font-size: .9rem; }
.election-ribbon.phase-voting { background: linear-gradient(90deg, #0f6b3f, #17955a); }
.election-ribbon.phase-candidacy { background: linear-gradient(90deg, #8a5d00, #c48a00); }
.election-ribbon .container { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.election-ribbon .container > i:first-child { color: #ffd76a; }
.election-ribbon span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.election-ribbon a { color: #1d1500; background: #ffd76a; padding: 2px 12px; border-radius: 999px; font-weight: 800; white-space: nowrap; font-size: .85rem; }
.election-ribbon a:hover { background: #fff; color: #000; }
.has-ribbon .page-banner { padding-top: 220px; }
.has-ribbon .hero { padding-top: 200px; }
@media (max-width: 600px) { .has-ribbon .page-banner { padding-top: 200px; } .election-ribbon { font-size: .82rem; } }
.site-header.compact .election-ribbon { font-size: .85rem; }

.el-page { --el-blue: #2a3a8f; }
.el-timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 18px; position: relative; }
.el-timeline::before { content: ""; position: absolute; top: 22px; right: 10%; left: 10%; height: 4px; background: var(--line); border-radius: 4px; }
.el-tl-step { text-align: center; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.el-tl-dot { width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 3px solid var(--line); display: grid; place-items: center; color: var(--muted); z-index: 1; font-size: 1.05rem; transition: .3s; }
.el-tl-step.done .el-tl-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.el-tl-step.now .el-tl-dot { background: var(--secondary); border-color: var(--secondary); color: #1d1500; transform: scale(1.15); box-shadow: 0 0 0 6px color-mix(in srgb, var(--secondary) 25%, transparent); animation: elPulse 2s infinite; }
@keyframes elPulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--secondary) 5%, transparent); } }
.el-tl-step b { font-size: .92rem; color: var(--ink); }
.el-tl-step small { font-size: .75rem; color: var(--muted); line-height: 1.4; }
@media (max-width: 640px) { .el-tl-step small { display: none; } .el-tl-dot { width: 38px; height: 38px; font-size: .9rem; } .el-timeline::before { top: 18px; } .el-tl-step b { font-size: .78rem; } }

.el-countdown { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; background: #fff; border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow); margin-bottom: 20px; font-weight: 700; }
.el-countdown .cd { display: flex; align-items: baseline; gap: 4px; direction: rtl; }
.el-countdown .cd b { background: var(--primary); color: #fff; min-width: 46px; text-align: center; padding: 4px 8px; border-radius: 10px; font-size: 1.35rem; }
.el-countdown .cd small { color: var(--muted); margin-inline-end: 8px; }
.el-desc { background: var(--gold-soft); border-radius: 14px; padding: 14px 18px; margin-bottom: 20px; }
.el-ident { background: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: 0 4px 14px -10px rgba(0,0,0,.3); font-size: .92rem; }
.el-ident .ok { color: #17744a; font-weight: 700; } .el-ident .no { color: #a52a1c; font-weight: 700; }

.el-card { display: flex; gap: 16px; align-items: flex-start; background: #fff; border-radius: 18px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; flex-wrap: wrap; }
.el-card > i { font-size: 2rem; color: var(--primary); }
.el-card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.el-card p { margin: 0 0 6px; }
.el-card .grow { flex: 1; min-width: 220px; }
.el-login { align-items: center; }
.el-login > div:nth-child(2) { flex: 1; min-width: 220px; }
.el-mycand { border-inline-start: 6px solid var(--secondary); }
.el-voted { border-inline-start: 6px solid #17955a; align-items: center; }
.el-voted > i { color: #17955a; font-size: 2.4rem; }
.el-runform { flex-direction: column; align-items: stretch; border-top: 5px solid var(--secondary); }
.el-runform h3 i { color: var(--secondary); }
.el-pos-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.el-pos-pick label { cursor: pointer; }
.el-pos-pick input { position: absolute; opacity: 0; }
.el-pos-pick span { display: flex; flex-direction: column; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; transition: .2s; height: 100%; }
.el-pos-pick small { color: var(--muted); }
.el-pos-pick input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.el-pos-pick input:focus-visible + span { outline: 3px solid var(--secondary); }

.el-receipt { display: flex; gap: 16px; align-items: flex-start; background: linear-gradient(120deg, #e3f6ea, #f3fbf6); border: 2px dashed #17955a; border-radius: 18px; padding: 18px 20px; margin-bottom: 20px; }
.el-receipt > i { font-size: 2.2rem; color: #17955a; }
.el-receipt h3 { margin: 0 0 4px; color: #135c32; }
.el-receipt code { display: inline-block; font-size: 1.5rem; letter-spacing: 2px; background: #fff; padding: 6px 16px; border-radius: 10px; font-weight: 800; cursor: pointer; border: 1px solid #b8e3c8; }

.el-ballot { background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); padding: 22px; margin-bottom: 24px; border-top: 6px solid var(--primary); }
.el-ballot-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.el-ballot-head > i { font-size: 2rem; color: var(--primary); }
.el-ballot-head h3 { margin: 0; }
.el-ballot-head p { margin: 4px 0 0; color: var(--muted); }
.el-bpos { border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px 16px; margin: 0 0 16px; position: relative; }
.el-bpos legend { font-weight: 800; font-size: 1.1rem; padding: 0 8px; color: var(--ink); }
.el-bpos legend small { font-weight: 600; color: var(--muted); font-size: .82rem; margin-inline-start: 6px; }
.el-bpos.too-many { border-color: #c0392b; }
.el-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.el-opt { cursor: pointer; display: block; }
.el-opt input { position: absolute; opacity: 0; }
.el-opt-box { display: flex; align-items: center; gap: 12px; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; transition: .2s; background: #fcfbf8; height: 100%; }
.el-opt-box small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.5; margin-top: 2px; }
.el-opt:hover .el-opt-box { border-color: color-mix(in srgb, var(--primary) 50%, #fff); }
.el-opt input:checked + .el-opt-box { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 6px 18px -12px var(--primary); }
.el-opt input:focus-visible + .el-opt-box { outline: 3px solid var(--secondary); }
.el-tick { color: var(--line); font-size: 1.3rem; transition: .2s; }
.el-opt input:checked + .el-opt-box .el-tick { color: var(--primary); transform: scale(1.15); }
.el-abstain .el-opt-box { background: #f6f6f6; }
.el-abstain input:checked + .el-opt-box { border-color: #777; background: #eee; box-shadow: none; }
.el-abstain input:checked + .el-opt-box .el-tick { color: #777; }
.el-count { position: absolute; top: -12px; left: 16px; background: var(--primary); color: #fff; border-radius: 999px; padding: 0 10px; font-weight: 800; }
.el-bpos.too-many .el-count { background: #c0392b; }
.el-ballot-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; background: linear-gradient(transparent, #fff 30%); padding-top: 18px; }
@media (max-width: 600px) { .el-ballot { padding: 16px 12px; } .el-opts { grid-template-columns: 1fr; } .el-ballot-foot .btn { flex: 1; } }

.el-av { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: var(--secondary); font-weight: 800; font-size: 1.1rem; flex-shrink: 0; position: relative; }
.el-av.lg { width: 70px; height: 70px; font-size: 1.6rem; }
.el-av.xl { width: 92px; height: 92px; font-size: 2.2rem; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--secondary); }
.el-av .fa-crown { position: absolute; top: -16px; color: #ffcc33; font-size: 1.4rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); animation: elBob 2.4s ease-in-out infinite; }
@keyframes elBob { 50% { transform: translateY(-4px) rotate(-6deg); } }

.el-turnout-mini { background: #fff; border-radius: 12px; padding: 12px 16px; box-shadow: 0 4px 14px -10px rgba(0,0,0,.3); margin-bottom: 20px; }
.el-turnout-mini i { color: var(--primary); }
.el-cands { margin-top: 30px; }
.el-cand-pos { margin-bottom: 22px; }
.el-cand-pos h3 { font-size: 1.1rem; border-bottom: 2px solid var(--gold-soft); padding-bottom: 6px; }
.el-cand-pos h3 small { color: var(--muted); font-weight: 600; font-size: .82rem; }
.el-cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.el-cand { background: #fff; border-radius: 16px; padding: 18px 12px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.el-cand details { width: 100%; font-size: .88rem; text-align: right; }
.el-cand summary { cursor: pointer; color: var(--primary); font-weight: 700; text-align: center; }
.el-security { display: flex; gap: 14px; background: #f1f4ff; border: 1px solid #dfe5fb; border-radius: 16px; padding: 16px 18px; margin-top: 30px; font-size: .92rem; }
.el-security > i { font-size: 1.8rem; color: var(--el-blue); }
.el-security ul { margin: 6px 0 0; padding-inline-start: 18px; }
.el-results-cta { display: flex; align-items: center; gap: 16px; background: linear-gradient(120deg, #2a3a8f, #141a3f); color: #fff; border-radius: 18px; padding: 20px 22px; margin-bottom: 20px; }
.el-results-cta > i:first-child { font-size: 2.4rem; color: #ffcc33; }
.el-results-cta span { flex: 1; display: flex; flex-direction: column; }
.el-results-cta:hover { color: #fff; transform: translateY(-2px); }

.el-modal { position: fixed; inset: 0; background: rgba(5, 15, 10, .6); z-index: 3000; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.el-modal-box { background: #fff; border-radius: 20px; padding: 22px; width: min(480px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.el-modal-box h3 i { color: var(--primary); }
.el-modal-box ul { list-style: none; padding: 0; margin: 0 0 14px; }
.el-modal-box li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.el-modal-box li span { color: var(--muted); }
.el-final-warn { color: #a52a1c; font-weight: 700; }

/* ===== النتائج ===== */
.el-podium { text-align: center; background: radial-gradient(700px 300px at 50% 0%, rgba(255,204,51,.35), transparent), linear-gradient(160deg, #1b2a6b, #0c1240); color: #fff; border-radius: 24px; padding: 30px 16px 34px; margin-bottom: 24px; position: relative; overflow: hidden; }
.el-podium h2 { color: #fff; margin: 6px 0 22px; }
.el-trophy { font-size: 3.4rem; color: #ffcc33; filter: drop-shadow(0 8px 20px rgba(255,204,51,.5)); animation: elBob 3s ease-in-out infinite; }
.el-winners { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.el-winner { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 120px; opacity: 0; animation: elRise .7s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: var(--d); }
.el-winner b { font-size: 1.05rem; }
.el-winner small { color: #ffd76a; font-weight: 700; }
@keyframes elRise { from { opacity: 0; transform: translateY(24px) scale(.9); } to { opacity: 1; transform: none; } }
.el-confetti { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: elFall linear forwards; pointer-events: none; }
@keyframes elFall { to { transform: translateY(520px) rotate(720deg); opacity: 0; } }

.el-stats { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 24px; align-items: stretch; }
@media (max-width: 760px) { .el-stats { grid-template-columns: 1fr 1fr; } .el-stats .el-ring { grid-column: 1 / -1; } }
.el-ring { --p: 0; background: #fff; border-radius: 18px; box-shadow: var(--shadow); display: grid; place-items: center; padding: 18px; }
.el-ring > div { width: 150px; height: 150px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, #fff 76%, transparent 77% 100%), conic-gradient(var(--primary) calc(var(--p) * 1%), var(--primary-soft) 0); }
.el-ring b { font-size: 1.8rem; color: var(--ink); line-height: 1; }
.el-ring small { color: var(--muted); }
.el-stat { background: #fff; border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 16px; text-align: center; }
.el-stat i { font-size: 1.6rem; color: var(--secondary); }
.el-stat b { font-size: 1.8rem; color: var(--ink); line-height: 1.2; }
.el-stat small { color: var(--muted); }

.el-res-pos { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.el-res-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.el-res-head h3 { margin: 0; font-size: 1.2rem; } .el-res-head h3 i { color: var(--secondary); }
.el-res-head small { color: var(--muted); }
.el-bar-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; margin-bottom: 6px; }
.el-bar-row.win { background: linear-gradient(90deg, transparent, rgba(255,204,51,.14)); }
.el-rank { width: 26px; height: 26px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--muted); flex-shrink: 0; }
.el-bar-row.win .el-rank { background: #ffcc33; color: #3d2c00; }
.el-bar-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.el-bar-top > span { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.el-bar-top > span b { color: var(--ink); font-size: 1.05rem; }
.el-tag { display: inline-flex; align-items: center; gap: 4px; background: #ffcc33; color: #3d2c00; font-size: .75rem; padding: 1px 9px; border-radius: 999px; margin-inline-start: 6px; }
.el-tag.tie { background: #ffe0b2; color: #7a3d00; }
.el-bar { height: 14px; background: var(--paper); border-radius: 999px; overflow: hidden; }
.el-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #4fd18b)); transition: width 1.4s cubic-bezier(.2,.8,.2,1); }
.el-bar-row.win .el-bar span { background: linear-gradient(90deg, #e0a800, #ffcc33); }
.el-bar.go span, .no-js .el-bar span { width: var(--w); }

.el-integrity { display: flex; gap: 16px; border-radius: 18px; padding: 18px 20px; margin: 24px 0 18px; }
.el-integrity.ok { background: #e3f6ea; color: #135c32; border: 1px solid #b8e3c8; }
.el-integrity.warn { background: #fdecea; color: #7a1c12; border: 1px solid #f1c6c1; }
.el-integrity > i { font-size: 2.2rem; }
.el-integrity h3 { margin: 0 0 6px; color: inherit; }
.el-integrity ul { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.el-integrity li { padding: 2px 0; }
.el-integrity li.w { font-weight: 700; }
.el-receipt-check > i { color: var(--secondary); }
.el-receipt-check input { font-family: ui-monospace, monospace; letter-spacing: 1px; }
.el-receipt-check .alert { margin-top: 10px; }

.el-list { display: flex; flex-direction: column; gap: 14px; }
.el-list-card { display: flex; align-items: center; gap: 16px; background: #fff; border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow); color: var(--ink); transition: .3s; }
.el-list-card:hover { transform: translateY(-3px); color: var(--ink); }
.el-list-card h3 { margin: 6px 0 2px; font-size: 1.15rem; }
.el-list-card small { color: var(--muted); }
.el-list-ic { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.el-list-card.ph-voting .el-list-ic { background: #e3f6ea; color: #17744a; }
.el-list-card.ph-closed .el-list-ic { background: #fff3cd; color: #b38600; }
.el-page .badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.el-page .badge-success { background: #e3f6ea; color: #17744a; } .el-page .badge-gold { background: #fbefc8; color: #7a5600; } .el-page .badge-info { background: #e5f0fb; color: #1b5a95; }
.el-page .badge-warning { background: #fff2d6; color: #8a5a00; } .el-page .badge-danger { background: #fde5e2; color: #a52a1c; } .el-page .badge-primary { background: #e5ecff; color: #2a3a8f; }

/* حالات تفاعلية (JS) */
.el-opt.off .el-opt-box { opacity: .45; cursor: not-allowed; }
code.copyable { position: relative; transition: .2s; }
code.copyable.copied { background: #e6f7ec; border-color: var(--primary); }
code.copyable.copied::after { content: attr(data-tip); position: absolute; top: -30px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; font-size: .75rem; letter-spacing: 0; padding: 3px 10px; border-radius: 8px; white-space: nowrap; font-weight: 600; }
.el-countdown.done .cd b { opacity: .5; }
.el-modal[hidden], .el-final-warn[hidden] { display: none !important; }
