/* static/css/funnel.css */

/* ============================================================
   تنظیمات کلی قیف
   ============================================================ */

.funnel-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* نوار پیشرفت */
.funnel-progress {
    width: 100%;
    height: 6px;
    background: var(--bg-muted, #e9ecef);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.funnel-progress-bar {
    height: 100%;
    background: rgb(var(--primary));
    border-radius: 999px;
    transition: width 0.5s ease;
    width: 0%;
}

/* ============================================================
   گام‌ها
   ============================================================ */

.funnel-step {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.funnel-step.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* عنوان گام */
.funnel-step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgb(var(--fg));
    margin-bottom: 0.5rem;
}

.funnel-step-subtitle {
    font-size: 1rem;
    color: rgb(var(--muted));
    margin-bottom: 1.5rem;
}

/* ============================================================
   گزینه‌ها (دکمه‌های انتخاب)
   ============================================================ */

.funnel-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.funnel-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgb(var(--card));
    border: 1.5px solid rgb(var(--border));
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    font-weight: 500;
    color: rgb(var(--fg));
}

.funnel-option:hover {
    border-color: rgb(var(--primary));
    background: rgb(var(--primary) / 8%);
    transform: translateY(-1px);
}

.funnel-option.selected {
    border-color: rgb(var(--primary));
    background: rgb(var(--primary) / 8%);
    box-shadow: 0 4px 12px rgb(var(--primary) / 20%);
}

.funnel-option input[type="radio"],
.funnel-option input[type="checkbox"] {
    display: none;
}

.funnel-option .icon {
    font-size: 1.5rem;
    line-height: 1;
}

.funnel-option .label {
    flex: 1;
}

.funnel-option .check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgb(var(--border));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.funnel-option.selected .check {
    background: rgb(var(--primary));
    border-color: rgb(var(--primary));
}

.funnel-option.selected .check::after {
    content: "✓";
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ============================================================
   دکمه‌ها
   ============================================================ */

.funnel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.funnel-btn-primary {
    background: rgb(var(--primary));
    color: white;
    box-shadow: 0 8px 24px rgb(var(--primary) / 35%);
}

.funnel-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgb(var(--primary) / 45%);
}

.funnel-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.funnel-btn-secondary {
    background: #f1f3f5;
    color: #1a1a2e;
}

.funnel-btn-secondary:hover {
    background: #e9ecef;
}

.funnel-btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    box-shadow: 0 8px 24px rgba(46, 204, 113, 0.3);
}

.funnel-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(46, 204, 113, 0.4);
}

.funnel-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ============================================================
   نتیجه (گام آخر)
   ============================================================ */

.funnel-result {
    background: rgb(var(--card));
    border: 1px solid rgb(var(--border));
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    margin-top: 1.5rem;
}

.funnel-result-badge {
    display: inline-block;
    padding: 0.25rem 1rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgb(var(--primary) / 12%);
    color: rgb(var(--primary));
    margin-bottom: 0.75rem;
}

.funnel-result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgb(var(--fg));
    margin-bottom: 0.5rem;
}

.funnel-result-desc {
    color: rgb(var(--muted));
    line-height: 1.6;
    margin-bottom: 1rem;
}
.funnel-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid rgb(var(--border));
    border-bottom: 1px solid rgb(var(--border));
    margin: 1rem 0;
}

.funnel-result-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgb(var(--muted));
}

.funnel-result-meta-item .icon {
    font-size: 1.25rem;
}

/* ============================================================
   فرم شماره تماس
   ============================================================ */

.funnel-phone-form {
    margin-top: 1.5rem;
}

.funnel-phone-form .form-group {
    margin-bottom: 1rem;
}

.funnel-phone-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: rgb(var(--fg));
}

.funnel-phone-form input[type="tel"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid rgb(var(--border));
    border-radius: 12px;
    font-size: 1rem;
    background: rgb(var(--bg));
    color: rgb(var(--fg));
    direction: ltr;
    transition: border-color 0.2s ease;
}

.funnel-phone-form input[type="tel"]:focus {
    outline: none;
    border-color: rgb(var(--primary));
    background: rgb(var(--card));
    box-shadow: 0 0 0 4px rgb(var(--primary) / 12%);
}

.funnel-phone-form .help-text {
    font-size: 0.8rem;
    color: rgb(var(--muted));
    margin-top: 0.5rem;
}
/* ============================================================
   تایمر تخفیف
   ============================================================ */

.funnel-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fff3cd;
    border-radius: 12px;
    font-weight: 600;
    color: #856404;
    margin: 1rem 0;
}

.funnel-timer .countdown {
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc3545;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   پیام‌های خطا و موفقیت
   ============================================================ */

.funnel-messages {
    margin-bottom: 1.5rem;
}

.funnel-message {
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    font-weight: 500;
}

.funnel-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.funnel-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.funnel-message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================================
   پاسخگو (Mobile First)
   ============================================================ */

@media (max-width: 576px) {
    .funnel-container {
        padding: 1rem;
    }

    .funnel-step-title {
        font-size: 1.25rem;
    }

    .funnel-option {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .funnel-result {
        padding: 1.25rem;
    }

    .funnel-btn {
        width: 100%;
        justify-content: center;
    }

    .funnel-actions {
        flex-direction: column;
    }

    .funnel-result-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (min-width: 768px) {
    .funnel-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .funnel-options.single-col {
        grid-template-columns: 1fr;
    }
}
