@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700;800;900&display=swap');

.election-ultra-wrapper * {
    box-sizing: border-box;
}

/* چیدمان اصلی در دسکتاپ و موبایل بدون خراب کردن هدر/فوتر سایت */
.election-ultra-wrapper {
    direction: rtl;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(99,102,241,.25), transparent 30%),
        radial-gradient(circle at bottom left, rgba(14,165,233,.22), transparent 30%),
        linear-gradient(135deg, #020817 0%, #07111f 35%, #0f172a 100%);
    color: #fff;
    padding: 30px 24px;
    border-radius: 28px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

/* ===== موبایل: سایزهای کوچک‌تر و فشرده‌تر ===== */
@media (max-width: 768px) {
    .election-ultra-wrapper {
        margin: 0;
        border-radius: 0;
        padding: 14px 10px;
        min-height: 100vh;
        box-shadow: none;
    }

    .election-main-shell {
        max-width: 100%;
    }

    .brand-badge {
        width: 42px;
        height: 42px;
        font-size: 21px;
        border-radius: 12px;
    }

    .brand-text h1 {
        font-size: 19px;
    }

    .election-mini-info {
        padding: 8px 12px;
        font-size: 11px;
        gap: 6px;
        margin-bottom: 14px;
    }

    .election-progress {
        gap: 4px;
        margin-bottom: 12px;
    }

    .ep-step span {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .ep-step label {
        font-size: 9px;
    }

    .ep-line {
        width: 20px;
    }

    .election-glass-card {
        padding: 14px 10px;
        border-radius: 18px;
        min-height: 0;
    }

    .screen-head {
        margin-bottom: 16px;
    }

    /* تیتر مرحله‌ها کوچک‌تر تا کلمه کامل جا شود */
    .screen-head h2 {
        font-size: 18px;
        line-height: 1.4;
    }

    .screen-head p {
        font-size: 12px;
        line-height: 1.7;
    }

    .super-form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 14px;
    }

    .field-box {
        padding: 10px;
        border-radius: 14px;
    }

    .field-box label {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .field-box input {
        height: 44px;
        font-size: 15px;
        padding: 0 12px;
        border-radius: 10px;
    }

    .otp-wrap {
        margin-bottom: 14px;
    }

    .otp-main-input {
        height: 54px;
        font-size: 24px;
        letter-spacing: 8px;
        border-radius: 14px;
    }

    .action-btn {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 12px;
    }

    .action-row {
        gap: 8px;
    }

    .action-row .action-btn {
        width: 100%;
        min-width: 0;
    }

    .election-alert {
        padding: 11px 13px;
        font-size: 12px;
        border-radius: 12px;
    }

    .vote-edit-notice {
        padding: 9px 11px;
        font-size: 11px;
    }

    .selection-status {
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 12px;
    }

    .selection-status strong {
        font-size: 16px;
    }

    .candidate-ultra-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 14px;
    }

    .ultra-candidate-card {
        min-height: 210px;
        padding: 10px;
        border-radius: 16px;
    }

    .candidate-photo {
        width: 70px;
        height: 70px;
        margin-bottom: 8px;
    }

    .candidate-no-image {
        font-size: 30px;
    }

    .candidate-check {
        width: 22px;
        height: 22px;
        font-size: 12px;
        top: 8px;
        right: 8px;
    }

    .candidate-content h3 {
        font-size: 13px;
    }

    .candidate-role {
        font-size: 10px;
        padding: 1px 8px;
    }

    .candidate-content p {
        font-size: 11px;
        -webkit-line-clamp: 2;
    }

    .final-summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .summary-ultra-card {
        padding: 9px;
        gap: 10px;
    }

    .summary-ultra-photo {
        width: 40px;
        height: 40px;
    }

    .summary-ultra-text h4 {
        font-size: 13px;
    }

    .success-stage {
        padding: 20px 6px;
    }

    .success-icon {
        font-size: 48px;
        margin-bottom: 12px;
    }

    .success-stage h2 {
        font-size: 20px;
    }
}

.election-bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
    opacity: .25;
    animation: floatShape 12s infinite ease-in-out;
    z-index: 1;
}

.shape1 {
    width: 280px;
    height: 280px;
    top: -60px;
    right: -50px;
    background: #4f46e5;
}

.shape2 {
    width: 240px;
    height: 240px;
    bottom: 70px;
    left: -50px;
    background: #0891b2;
    animation-delay: 2s;
}

.shape3 {
    width: 180px;
    height: 180px;
    top: 40%;
    right: 20%;
    background: #7c3aed;
    animation-delay: 4s;
}

@keyframes floatShape {
    0%,100% { transform: translateY(0) translateX(0) scale(1); }
    50% { transform: translateY(-18px) translateX(12px) scale(1.06); }
}

.election-main-shell {
    position: relative;
    z-index: 2;
    max-width: 100%;
    margin: 0 auto;
}

.election-topbar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 14px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-badge {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: linear-gradient(135deg, rgba(255,255,255,.2), rgba(255,255,255,.08));
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
}

.brand-text h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    color: #fff;
}

.election-mini-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    margin-bottom: 20px;
    font-size: 13px;
    color: rgba(255,255,255,.85);
    text-align: center;
}

.mini-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.mini-chip strong {
    color: #fff;
    font-weight: 800;
}

.timer-chip {
    background: rgba(99,102,241,.18);
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(99,102,241,.28);
}

.timer-chip strong {
    color: #c7d2fe;
    font-variant-numeric: tabular-nums;
}

.election-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.ep-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.ep-step span {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.09);
    border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.75);
    font-weight: 900;
    transition: all .3s ease;
}

.ep-step label {
    color: rgba(255,255,255,.75);
    font-size: 11px;
    font-weight: 700;
}

.ep-step.active span {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 8px 18px rgba(99,102,241,.35);
    transform: scale(1.06);
}

.ep-step.active label {
    color: #fff;
}

.ep-line {
    width: 60px;
    height: 2px;
    background: rgba(255,255,255,.18);
}

@media (max-width: 600px) {
    .ep-line {
        width: 30px;
    }
}

.election-glass-card {
    border-radius: 26px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.07));
    border: 1px solid rgba(255,255,255,.14);
    backdrop-filter: blur(22px);
    box-shadow: 0 25px 60px rgba(0,0,0,.25);
    min-height: 480px;
}

.step-screen {
    display: none;
    animation: fadeStep .45s ease;
}

.step-screen.active {
    display: block;
}

@keyframes fadeStep {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen-head {
    text-align: center;
    margin-bottom: 24px;
}

/* تیتر مرحله‌ها: فونت کوچک‌تر برای دسکتاپ هم تا کلمه کامل جا شود */
.screen-head h2 {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    line-height: 1.5;
}

.screen-head p {
    margin: 0;
    color: rgba(255,255,255,.78);
    font-size: 15px;
    line-height: 1.9;
}

.super-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .super-form-grid {
        grid-template-columns: 1fr;
    }
}

.field-box {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    padding: 16px;
}

.field-box label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #e2e8f0;
    font-weight: 700;
}

.field-box input {
    width: 100%;
    height: 52px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.92);
    color: #0f172a;
    padding: 0 16px;
    font-size: 17px;
    font-family: inherit;
    outline: none;
    transition: all .25s ease;
}

.field-box input:focus {
    box-shadow: 0 0 0 5px rgba(99,102,241,.18);
    border-color: #818cf8;
}

.otp-wrap {
    max-width: 360px;
    margin: 0 auto 22px;
    text-align: center;
}

.otp-main-input {
    width: 100%;
    height: 66px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.96);
    text-align: center;
    font-size: 30px;
    letter-spacing: 12px;
    font-weight: 900;
    color: #0f172a;
    outline: none;
}

.action-btn {
    border: none;
    outline: none;
    min-height: 52px;
    border-radius: 16px;
    padding: 13px 22px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all .25s ease;
}

.action-btn.primary {
    width: 100%;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 14px 26px rgba(79,70,229,.35);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(79,70,229,.42);
}

.action-btn.success {
    color: #fff;
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 14px 26px rgba(16,185,129,.35);
}

.action-btn.success:hover {
    transform: translateY(-2px);
}

.action-btn.light {
    color: #fff;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.12);
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.action-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-row .action-btn {
    min-width: 200px;
}

@media (max-width: 600px) {
    .action-row .action-btn {
        width: 100%;
    }
}

.election-alert {
    padding: 15px 17px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 700;
}

.alert-error {
    background: rgba(239,68,68,.16);
    border: 1px solid rgba(239,68,68,.3);
    color: #fecaca;
}

.alert-success {
    background: rgba(16,185,129,.16);
    border: 1px solid rgba(16,185,129,.3);
    color: #bbf7d0;
}

.vote-edit-notice {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(245,158,11,.14);
    border: 1px solid rgba(245,158,11,.28);
    color: #fde68a;
    font-size: 13px;
    font-weight: 700;
}

.selection-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    padding: 13px 16px;
    margin-bottom: 16px;
    color: #fff;
    font-weight: 700;
}

.selection-status strong {
    font-size: 20px;
}

/* گرید کاندیداها: ۳ ستون دسکتاپ، ۲ ستون موبایل */
.candidate-ultra-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

@media (max-width: 992px) {
    .candidate-ultra-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .candidate-ultra-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.ultra-candidate-card {
    position: relative;
    overflow: hidden;
    min-height: 280px;
    border-radius: 22px;
    padding: 16px;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
    border: 1px solid rgba(255,255,255,.14);
    transition: all .28s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ultra-candidate-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99,102,241,.4);
    background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
}

.ultra-candidate-card.selected {
    border-color: #6366f1;
    background: linear-gradient(180deg, rgba(99,102,241,.25), rgba(99,102,241,.1));
    box-shadow: 0 10px 25px rgba(99,102,241,.25);
}

.candidate-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 26px;
    height: 26px;
    background: #6366f1;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.25s ease;
    z-index: 3;
}

.ultra-candidate-card.selected .candidate-check {
    opacity: 1;
    transform: scale(1);
}

.candidate-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.1);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
}

.candidate-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.candidate-no-image {
    font-size: 40px;
}

.candidate-content h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
}

.candidate-role {
    display: inline-block;
    font-size: 12px;
    color: #818cf8;
    background: rgba(99,102,241,0.15);
    padding: 2px 10px;
    border-radius: 99px;
    margin-bottom: 8px;
    font-weight: 700;
}

.candidate-content p {
    margin: 0;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* مرور نهایی رای */
.final-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .final-summary-grid {
        grid-template-columns: 1fr;
    }
}

.summary-ultra-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px;
    border-radius: 16px;
}

.summary-ultra-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-ultra-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.summary-ultra-text h4 {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 700;
}

.summary-ultra-text span {
    font-size: 12px;
    color: #818cf8;
}

.success-stage {
    text-align: center;
    padding: 40px 10px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 18px;
}

.success-stage h2 {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 900;
}

.success-stage p {
    color: rgba(255,255,255,0.8);
    margin-bottom: 24px;
}

.election-closed-box {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
}

.election-closed-box h2 {
    margin: 0 0 10px;
    font-weight: 800;
}
