/* =====================================================
   قرعه‌کشی ماهانه ویرامونت — استایل بلیت
===================================================== */

/* ---------- دکمه شناور ---------- */
.raffle-fab {
    position: fixed;
    left: 22px;
    bottom: 22px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    z-index: 9997;
    box-shadow: 0 8px 24px rgba(var(--color-primary-rgb), 0.45);
    animation: raffleFabPulse 2.4s ease-in-out infinite;
}

.raffle-fab:hover { transform: scale(1.08); }

.raffle-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e63946;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

@keyframes raffleFabPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(var(--color-primary-rgb), 0.45), 0 0 0 0 rgba(var(--color-primary-light-rgb), 0.5); }
    50%      { box-shadow: 0 8px 24px rgba(var(--color-primary-rgb), 0.45), 0 0 0 10px rgba(var(--color-primary-light-rgb), 0); }
}

@media (max-width: 768px) {
    .raffle-fab { width: 54px; height: 54px; font-size: 22px; left: 60px; bottom: 16px; }
}
/* ---------- اورلی مودال ---------- */
.raffle-overlay {
    position: fixed;
    inset: 0;
    max-width: 100vw;
    overscroll-behavior: contain;
    background: rgba(10, 20, 16, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    padding: 16px;
}

.raffle-overlay.show { opacity: 1; pointer-events: all; }

.raffle-box {
    background: #fff;
    border-radius: 24px;
    padding: 30px 26px 26px;
    max-width: 400px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    text-align: center;
    box-shadow: 0 30px 70px rgba(0,0,0,0.35);
    transform: translateY(30px) scale(0.96);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.22,1,0.36,1), opacity 0.45s ease;
}

.raffle-overlay.show .raffle-box { transform: translateY(0) scale(1); opacity: 1; }

.raffle-close {
    position: absolute;
    top: 12px;
    left: 14px;
    background: #f2f6f4;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.25s ease, color 0.25s ease;
}
.raffle-close:hover { background: var(--color-primary); color: #fff; }

.raffle-title {
    font-size: 21px;
    font-weight: 800;
    color: #0a2f24;
    margin: 4px 0 4px;
}

.raffle-subtitle {
    font-size: 13.5px;
    color: #6b7a75;
    margin: 0 0 20px;
    line-height: 1.9;
}

/* ---------- فرم ---------- */
.raffle-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}

.raffle-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid #e3ece8;
    background: #f8faf9;
    font-family: inherit;
    font-size: 14.5px;
    color: #1a1a1a;
    text-align: right;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.raffle-form input:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-light-rgb), 0.15);
}

.raffle-form input.invalid {
    border-color: #e63946;
    animation: raffleShake 0.4s ease;
}

/* ---------- گروه شماره موبایل با پیش‌شماره ثابت ---------- */
.raffle-phone-group {
    display: flex;
    align-items: stretch;
    border-radius: 10px;
    border: 1.5px solid #e3ece8;
    background: #f8faf9;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.raffle-phone-group:focus-within {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-light-rgb), 0.15);
}

.raffle-phone-group.invalid {
    border-color: #e63946;
    animation: raffleShake 0.4s ease;
}

.raffle-phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: #eef4f2;
    color: #4c625b;
    font-weight: 700;
    font-size: 14.5px;
    letter-spacing: 0.5px;
    border-left: 1.5px solid #e3ece8;
    white-space: nowrap;
}

.raffle-phone-group input {
    flex: 1;
    min-width: 0;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: left;
    letter-spacing: 1px;
}

.raffle-phone-group input:focus {
    box-shadow: none !important;
}

@keyframes raffleShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.raffle-error {
    color: #e63946;
    font-size: 12.5px;
    min-height: 16px;
    margin-top: -4px;
}

.raffle-submit-btn {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #fff;
    border: none;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    box-shadow: 0 10px 24px rgba(var(--color-primary-rgb), 0.3);
}
.raffle-submit-btn:hover { transform: translateY(-2px); }
.raffle-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ---------- کارت بلیت ---------- */
/* در جریان عادی صفحه، بدون هیچ absolute positioning‌ای، پس هیچ‌وقت
   روی متن‌های دیگه (نتیجه، هینت و ...) نمی‌افته. قبل از صدور بلیت
   جمع‌شده و بی‌رنگه؛ بعد از صدور با یک کادر مشخص (border + shadow)
   ظاهر می‌شه. */
.raffle-stage {
    margin: 2px auto 0;
    display: flex;
    justify-content: center;
}

.raffle-ticket {
    position: relative;
    width: 100%;
    max-width: 210px;
    margin: 0 auto;
    background: #fff;
    border: 1.5px solid #e3ece8;
    border-radius: 14px;
    box-shadow: 0 12px 26px rgba(0,0,0,0.14);
    padding: 0 14px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.96);
    transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s ease,
                transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                padding 0.4s ease;
}

.raffle-ticket.issued {
    max-height: 220px;
    opacity: 1;
    transform: scale(1);
    padding: 18px 14px 16px;
}

.raffle-ticket-perf {
    border-top: 2px dashed #d7e3de;
    margin: 10px 0 8px;
}

.raffle-ticket-label {
    font-size: 10.5px;
    color: #8a9a94;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.raffle-ticket-code {
    font-size: 19px;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: 1px;
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

.raffle-ticket-brand {
    font-size: 10px;
    color: #b7c4bf;
    margin-top: 8px;
    letter-spacing: 1px;
}

/* ---------- نتیجه زیر بلیت ---------- */
.raffle-result {
    display: none;
    margin-top: 14px;
}

.raffle-result.show {
    display: block;
    animation: raffleResultIn 0.5s cubic-bezier(0.22,1,0.36,1);
}

@keyframes raffleResultIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.raffle-result-note {
    font-size: 13px;
    color: #6b7a75;
    line-height: 1.9;
    margin: 8px 0 14px;
}

.raffle-copy-btn {
    background: #f2f8f5;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary-light);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}
.raffle-copy-btn:hover { background: var(--color-primary); color: #fff; }

.raffle-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

.raffle-action-btn {
    flex: 1;
    padding: 11px 10px;
    border-radius: 10px;
    font-size: 13.5px;
    text-decoration: none;
    font-weight: 600;
    border: 1.5px solid #e3ece8;
    color: #0a2f24;
    transition: all 0.25s ease;
}
.raffle-action-btn.primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #fff;
    border-color: transparent;
}
.raffle-action-btn:hover { transform: translateY(-2px); }

.raffle-hint {
    font-size: 12px;
    color: #9aa8a3;
    margin-top: 16px;
}

@media (prefers-reduced-motion: reduce) {
    .raffle-ticket { transition: opacity 0.3s ease; }
    .raffle-fab { animation: none; }
}
