
/* ----- ریست و متغیرها ----- */
.fp-calc-wrapper {
    direction: rtl;
    font-family: 'iranyekan', Tahoma, sans-serif;
    background: var(--fp-bg, #FFFFFF);
    max-width: 800px;
    margin: 0 auto;
    border-radius: 28px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    border: 1px solid #F1F1F1;
    --fp-primary: #C8161E;
    --fp-primary-light: #FFF0F0;
    --fp-gray-bg: #F9FAFB;
    --fp-text-dark: #111827;
    --fp-text-soft: #6B7280;
    --fp-border-light: #E5E7EB;
}

/* ----- هدر ----- */
.fp-header {
    background: var(--fp-primary);
    color: white;
    padding: 24px 28px;
    text-align: center;
}

.fp-header h2 {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.2px;
}

/* ----- بخش اسلایدرها ----- */
.fp-sliders-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 28px 24px 16px;
}

.fp-slider-card,
.fp-thickness-card {
    background: var(--fp-gray-bg);
    border-radius: 20px;
    padding: 20px 18px;
    border: 1px solid var(--fp-border-light);
}

.fp-slider-card label,
.fp-thickness-card label {
    display: block;
    font-weight: 700;
    font-size: 16px;
    color: var(--fp-text-dark);
    margin-bottom: 18px;
}

.fp-value-badge {
    background: var(--fp-primary);
    color: white;
    padding: 5px 16px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    margin-right: 8px;
}

/* ----- اسلایدر Range (روش نهایی و تست‌شده) ----- */
.fp-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 10px;
    outline: none;
    margin: 14px 0 8px;
    /* پس‌زمینه پایه خاکستری */
    background-color: #E2E8F0;
    /* گرادیان قرمز با زاویه 270deg (از راست به چپ) */
    background-image: linear-gradient(270deg, var(--fp-primary) 0%, var(--fp-primary) 100%);
    background-repeat: no-repeat;
    /* شروع از سمت راست */
    background-position: 100% 0;
    background-size: 0% 100%;
    /* بدون direction ltr برای ثبات بیشتر */
}

.fp-range::-webkit-slider-runnable-track {
    height: 8px;
    background: transparent;
    border-radius: 10px;
}

.fp-range::-moz-range-track {
    height: 8px;
    background: transparent;
    border-radius: 10px;
}

.fp-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border: 5px solid var(--fp-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(200, 22, 30, 0.3);
    transition: transform 0.15s;
    margin-top: -8px;
    position: relative;
    z-index: 2;
}

.fp-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: white;
    border: 5px solid var(--fp-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(200, 22, 30, 0.3);
}

/* لیبل‌های اسلایدر - چیدمان صحیح RTL */
.fp-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--fp-text-soft);
    font-weight: 500;
    direction: rtl;
}

/* ----- دکمه‌های ضخامت ----- */
.fp-thickness-buttons {
    display: flex;
    gap: 12px;
}

.fp-thickness-btn {
    flex: 1;
    padding: 15px 5px;
    border-radius: 18px;
    border: 2px solid #D1D5DB;
    background: white;
    font-weight: 700;
    font-size: 16px;
    color: #4B5563;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.fp-thickness-btn.active {
    border-color: var(--fp-primary);
    background: var(--fp-primary-light);
    color: var(--fp-primary);
    box-shadow: 0 6px 12px rgba(200, 22, 30, 0.08);
}

/* ----- کارت‌های نتایج ----- */
.fp-main-results {
    padding: 10px 24px 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.fp-result-item {
    display: flex;
    flex-direction: column;
    background: var(--fp-gray-bg);
    border-radius: 18px;
    padding: 18px 8px;
    text-align: center;
    border: 1px solid var(--fp-border-light);
}

.fp-result-label {
    color: var(--fp-text-soft);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 10px;
}

.fp-result-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--fp-text-dark);
    line-height: 1.3;
}

.fp-energy-badge {
    background: #FEE2E2;
    color: #B91C1C;
    padding: 8px 10px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 700;
    margin-top: 6px;
    display: inline-block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    white-space: nowrap;
}

.fp-energy-badge.active {
    background: #DCFCE7;
    color: #15803D;
}

/* ----- کادر مقایسه با هبلکس ----- */
.fp-comparison-box {
    background: #FFF0F0;
    margin: 8px 24px 22px;
    padding: 18px 22px;
    border-radius: 18px;
    border-right: 6px solid var(--fp-primary);
}

.fp-comparison-box p {
    margin: 6px 0;
    color: #7F1D1D;
    font-weight: 500;
}

.fp-comparison-box p:first-child {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.fp-comparison-text {
    font-size: 16px;
    font-weight: 700;
    color: #1E293B;
}

.fp-comparison-text span {
    font-size: 26px;
    font-weight: 900;
    color: var(--fp-primary);
    margin: 0 4px;
}

/* ----- کارت‌های پایین ----- */
.fp-bottom-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 6px 24px 28px;
}

.fp-bottom-card {
    background: white;
    padding: 20px 10px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--fp-border-light);
    transition: all 0.2s;
}

.fp-bottom-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(200, 22, 30, 0.06);
    border-color: var(--fp-primary-light);
}

.fp-bottom-card span {
    display: block;
    font-size: 13px;
    color: var(--fp-text-soft);
    margin-bottom: 12px;
    font-weight: 500;
}

.fp-bottom-card strong {
    font-size: 18px;
    font-weight: 800;
    color: var(--fp-primary);
    line-height: 1.4;
}

/* ----- دکمه تحلیل پروژه ----- */
.fp-btn-wrapper {
    text-align: center;
    padding: 0 24px 32px;
}

.fp-analyze-btn {
    background: var(--fp-primary);
    color: white;
    border: none;
    padding: 16px 42px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 20px -6px rgba(200, 22, 30, 0.25);
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}

.fp-analyze-btn:hover {
    background: #A01017;
    transform: scale(1.02);
    box-shadow: 0 16px 28px -6px rgba(200, 22, 30, 0.35);
}

/* ----- مودال ----- */
.fp-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease;
}

.fp-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.fp-modal-content {
    background: white;
    padding: 30px 24px;
    border-radius: 28px;
    max-width: 580px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: 0.2s ease;
    box-shadow: 0 30px 40px -15px rgba(0,0,0,0.2);
}

.fp-modal-overlay.active .fp-modal-content {
    transform: scale(1);
}

.fp-close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    background: var(--fp-gray-bg);
    border-radius: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 300;
    cursor: pointer;
    color: var(--fp-text-dark);
    transition: background 0.2s;
    border: 1px solid var(--fp-border-light);
}

.fp-close-modal:hover {
    background: #E5E7EB;
}

.fp-modal-body {
    margin-top: 8px;
}

/* ----- واکنش‌گرایی ----- */
@media (max-width: 640px) {
    .fp-sliders-section {
        grid-template-columns: 1fr;
        padding: 20px 18px;
    }
    .fp-main-results {
        grid-template-columns: 1fr;
        padding: 5px 18px;
    }
    .fp-comparison-box {
        margin: 10px 18px 18px;
        padding: 16px 16px;
    }
    .fp-bottom-cards {
        grid-template-columns: 1fr;
        padding: 6px 18px 24px;
    }
}