@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ─── Root Variables ─────────────────────────────────────────────────────── */
.fc-calculator-section {
    --fc-primary:    #8E3683;
    --fc-primary-bg: #f8e1e6;
    --fc-gray-track: #e0e0e0;
    --fc-white:      #ffffff;
    --fc-error:      #ff4d4d;
    --fc-orange-dot: #FF5722;
    font-family: 'Poppins', sans-serif;
}

/* ─── Outer Layout ───────────────────────────────────────────────────────── */
.fc-calculator-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 80px;
    padding: 40px 40px 60px;
    box-sizing: border-box;
    flex-wrap: wrap;
}

/* ─── Mobile dropdown ────────────────────────────────────────────────────── */
.fc-mobile-tab-select { display: none; }
.fc-mobile-tab-select select {
    width: 100%; padding: 25px;
    border: 2px solid var(--fc-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 16px; color: white;
    background: var(--fc-primary); appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 15px center; background-size: 15px;
    cursor: pointer;
}
#fc-plan-dropdown:focus-visible { outline: none; }

/* ─── Left Tabs ──────────────────────────────────────────────────────────── */
.fc-calc-tabs { flex: 1; padding-right: 50px; }
.fc-calc-tabs h2 {
    font-size: 48px; font-weight: 700; color: #222;
    margin-bottom: 40px; line-height: 1.2; padding-right: 60px;
}
.fc-calc-tabs > p { margin-bottom: 40px; color: #2D2D2D; font-size: 16px; width: 85%; }
.fc-bundle-sett { display: flex; flex-direction: column; gap: 20px; width: 70%; }

.fc-tab-btn {
    position: relative; display: flex; align-items: flex-start;
    width: 100%; padding: 23px; border: none; background: var(--fc-white);
    border-radius: 25px; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.04); text-align: left;
    box-sizing: border-box;
}
.fc-tab-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(0,0,0,0.08); }
.fc-tab-btn.active {
    background: var(--fc-primary); color: var(--fc-white);
    box-shadow: 0 15px 40px rgba(142,54,131,0.35);
}

button.fc-btn-reset.btn-cancel {
    width: 100%;
    margin-top: 15px;
}
.fc-icon {
    margin-right: 20px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; margin-top: 2px; width: 60px;
}
.fc-tab-btn.active .fc-icon img { filter: brightness(0) invert(1); }
.fc-icon img { width: 100%; height: auto; transition: 0.3s; }

.fc-wrap-text { flex: 1; padding-right: 100px; }
.fc-wrap-text h5 { margin: 0 0 6px 0; font-size: 16px; font-weight: 700; color: #333; }
.fc-tab-btn.active .fc-wrap-text h5 { color: #fff; }
.fc-wrap-text p { margin: 0; font-size: 13px; line-height: 1.5; color: #888; font-weight: 400; }
.fc-tab-btn.active .fc-wrap-text p { color: rgba(255,255,255,0.85); }

.fc-tab-btn::after {
    content: ''; position: absolute; top: 25px; right: 25px;
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid #ccc; background: transparent; transition: all 0.3s ease;
}
.fc-tab-btn.active::after {
    background: var(--fc-orange-dot); border-color: var(--fc-orange-dot);
    width: 14px; height: 14px; top: 26px; right: 26px;
    box-shadow: 0 2px 8px rgba(255,87,34,0.5);
}

/* ─── Right Card ─────────────────────────────────────────────────────────── */
.fc-calc-card {
    flex: 1;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: 24px; margin: 10px 0;
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
    /* 
     * KEY FIX: No fixed height here.
     * The card grows with content. Scroll lives inside .fc-form-wrap only.
    */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ─── Header + Progress ──────────────────────────────────────────────────── */
.fc-calc-header { margin-bottom: 25px; text-align: center; flex-shrink: 0; }
.fc-progress-wrapper { position: relative; max-width: 100%; }
.fc-calc-header h3 {
    text-align: left; padding: 40px 50px 25px 50px;
    margin: 0; font-size: 24px; font-weight: 700; color: #333;
}
.fc-progress-track {
    position: absolute; top: 50%; left: 0; width: 100%;
    height: 11px; background: var(--fc-gray-track);
    transform: translateY(-50%); z-index: 1;
}
.fc-progress-fill {
    position: absolute; top: 50%; left: 0; height: 11px;
    background: var(--fc-primary); width: 20%;
    transform: translateY(-50%); z-index: 2; transition: width 0.4s ease;
}
.fc-progress-steps {
    position: relative; display: flex; justify-content: space-between;
    z-index: 3; width: 65%; margin: auto;
}
.fc-step-circle {
    width: 35px; height: 35px; background: var(--fc-white);
    border: 2px solid var(--fc-gray-track); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #ccc; transition: all 0.3s ease; font-size: 14px; font-weight: 600;
}
.fc-step-circle.active {
    background: var(--fc-primary); border-color: var(--fc-primary);
    color: var(--fc-white); box-shadow: 0 4px 10px rgba(142,54,131,0.3);
}

.fc-bundle-sett .fc-tab-btn:hover {

    background: var(--fc-primary);
    color: var(--fc-white);
    box-shadow: 0 15px 40px rgb(142 54 131 / .35);
}

.fc-bundle-sett .fc-tab-btn:hover .fc-wrap-text h5 {
        color: var(--fc-white);
}
.fc-bundle-sett .fc-tab-btn:hover .fc-wrap-text p {
        color: var(--fc-white);
}

.fc-bundle-sett .fc-tab-btn:hover .fc-icon img {
    filter: brightness(0) invert(1);
}

/* ─── Scrollable form wrapper ────────────────────────────────────────────── */
/*
 * This is the key fix for the scroll issue.
 * The card stretches to ~630px on desktop. The header+progress takes ~140px.
 * We give form-wrap a max-height so it scrolls internally, not the whole page.
 * On mobile the card is auto height so max-height is removed.
*/
.fc-form-wrap {
    padding: 0 50px 40px 50px;
    overflow-y: auto;
    max-height: 490px;  /* card ~630px minus header ~140px */
    /* Thin, elegant scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #d0b0cf transparent;
}
.fc-form-wrap::-webkit-scrollbar { width: 5px; }
.fc-form-wrap::-webkit-scrollbar-track { background: transparent; }
.fc-form-wrap::-webkit-scrollbar-thumb { background: #d0b0cf; border-radius: 5px; }

/* ─── Field Sections ─────────────────────────────────────────────────────── */
.fc-field-sec { margin-bottom: 15px; }
.fc-field-sec label {
    margin-bottom: 9px !important; display: block;
    font-weight: 500; font-size: 15px; color: #444;
}

/* ─── Gender ─────────────────────────────────────────────────────────────── */
.fc-gender-group { display: flex; gap: 30px; margin-top: 20px; }
.fc-gender-group label { margin: 0; display: flex; align-items: center; cursor: pointer; font-size: 15px; color: #444; }
.fc-gender-group input { margin-right: 10px; accent-color: #ff5722; transform: scale(1.2); }

/* ─── Sliders ────────────────────────────────────────────────────────────── */
.fc-range-wrapper { display: flex; align-items: center; gap: 20px; }
.fc-range-container { flex: 1; position: relative; display: flex; align-items: center; }

.fc-calculator-section input[type=range] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 21px; border-radius: 10px;
    border: 1px solid rgba(128,128,128,0.23); background: transparent;
    cursor: pointer; z-index: 2;
    background-image: linear-gradient(to right, rgba(140,57,131,0.6) var(--fc-range-progress, 20%), var(--fc-gray-track) var(--fc-range-progress, 20%));
}
.fc-calculator-section input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 30px; width: 30px;
    border-radius: 50%; background: var(--fc-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.fc-calculator-section input[type=range]::-moz-range-thumb {
    height: 24px; width: 24px; border-radius: 50%; background: var(--fc-primary);
    border: 3px solid var(--fc-white); box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.fc-range-value-box {
    background: var(--fc-white); padding: 12px 14px; border-radius: 100px;
    font-size: 17px; color: #333; min-width: 50px; text-align: center;
    font-weight: 600; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    width: 17%; border: 1px solid #cecece; white-space: nowrap;
    box-sizing: border-box;
}
.fc-range-value-box--wide { width: 22%; font-size: 13px; }

/* ─── Course Table ───────────────────────────────────────────────────────── */
.fc-course-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 5px; }
.fc-course-table th {
    border-bottom: 2px solid #eee; padding: 8px 10px; text-align: left;
    color: #999; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
}
.fc-course-table td { padding: 9px 10px; border-bottom: 1px solid #f3f3f3; }
.fc-course-row { cursor: pointer; transition: background 0.15s; }
.fc-course-row:hover { background: #faf0f9; }
.fc-course-row.fc-active-row { background: #f3e0f2; color: var(--fc-primary); font-weight: 700; }

/* ─── Lifestyle Grid ─────────────────────────────────────────────────────── */
.fc-lifestyle-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 8px; }
.fc-lifestyle-opt {
    border: 1.5px solid #ddd; border-radius: 12px; padding: 12px 6px;
    text-align: center; cursor: pointer; font-size: 11px; color: #666;
    transition: all 0.2s; line-height: 1.5;
}
.fc-lifestyle-opt:hover { border-color: var(--fc-primary); background: #faf0f9; }
.fc-lifestyle-opt.fc-active-opt { border: 2px solid var(--fc-primary); background: #f3e0f2; color: var(--fc-primary); }
.fc-lifestyle-opt strong { display: block; font-size: 12px; margin-top: 4px; font-weight: 700; }

/* ─── Text Inputs ────────────────────────────────────────────────────────── */
.fc-form-input {
    width: 100% !important;
    padding: 16px !important;
    border: 1px solid #ddd !important;
    border-radius: 12px !important;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    transition: 0.3s;
    background: rgba(255, 255, 255, 0.8);
    font-family: 'Poppins', sans-serif;
}

button#fc-modal-submit-btn {
    background: #8e3683 !important;
    color: white !important;
}
.fc-form-input:focus {
    border-color: var(--fc-primary); background: #fff;
    box-shadow: 0 0 0 4px rgba(142,54,131,0.1);
}
.fc-form-input.fc-error { border-color: var(--fc-error); background: #fff8f8; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.fc-actions {
    margin-top: 40px; display: flex; justify-content: space-between;
    align-items: center; gap: 12px;
    /* Keep actions visible — stick to bottom of scroll area */
    position: sticky; bottom: 0;
    /*background: linear-gradient(to top, rgba(255,255,255,0.95) 85%, transparent);*/
    padding-top: 20px; margin-left: -2px; margin-right: -2px;
}
.fc-btn-reset {
    background: transparent !important;
    border: 1px solid #bbb !important;
    padding: 12px 30px !important;
    border-radius: 30px !important;
    cursor: pointer !important;
    color: #666 !important;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    font-size: 14px !important;
    transition: 0.2s ! IMPORTANT;
    font-size: 14px; transition: 0.2s;
}
.fc-btn-reset:hover { color: #222; border-color: #888; background: transparent; }
.fc-btn-primary {
    background: var(--fc-primary) !important;
    color: var(--fc-white) ! IMPORTANT;
    border: none !important;
    padding: 14px 45px !important;
    border-radius: 30px !important;
    font-weight: 600;
    font-size: 16px !important;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(142, 54, 131, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Poppins', sans-serif;
}
.fc-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgba(142,54,131,0.35); }

/* ─── Step visibility ────────────────────────────────────────────────────── */
.fc-hidden { display: none !important; }
.fc-step-content { display: none; animation: fcSlideUp 0.4s ease-out; }
.fc-step-content.fc-active { display: block; }
.fc-field-group { display: block; }
.fc-field-group.fc-hidden { display: none !important; }

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

/* ─── Result Box ─────────────────────────────────────────────────────────── */
.fc-result-box { background: var(--fc-white); border-radius: 20px; padding: 30px; text-align: center; }
.fc-result-box h3 { margin: 0 0 5px; color: #333; font-size: 18px; font-weight: 700; }
.fc-result-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 0; border-bottom: 1px solid #eee; font-size: 14px; color: #555;
    text-align: left;
}
.fc-result-row:last-child { border: none; }
.fc-result-val { color: var(--fc-primary); font-weight: 700; font-size: 1.1rem; text-align: right; }
.fc-result-highlight { font-size: 22px; }
.fc-result-note { font-size: 12px; color: #999; margin: 10px 0 0; }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.fc-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 99999;
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(4px);
}
.fc-modal-overlay.fc-modal-open { display: flex; }
.fc-modal-content {
    background: var(--fc-white); padding: 40px; border-radius: 20px;
    width: 90%; max-width: 700px; text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    background-color: white;
}
.fc-modal-content h3 {
    margin: 0 0 8px;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 700;
    color: #222;
    line-height: 1.2;
}
.fc-modal-content p { color: #777; font-size: 14px; margin-bottom: 20px; }
.fc-modal-field { margin-bottom: 15px; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — matching reference breakpoints exactly
   ═══════════════════════════════════════════════════════ */

@media (max-width: 1440px) {
    .fc-calc-tabs h2 { padding-right: 0; }
    .fc-bundle-sett { width: 100%; }
    .fc-calc-tabs > p { width: 100%; }
    .fc-calculator-section { gap: 60px; }
}

@media (max-width: 1280px) {
    .fc-calc-tabs h2 { font-size: 38px; }
    .fc-calc-tabs > p { font-size: 14px; width: 90%; }
    .fc-icon { width: 50px; }
    .fc-form-wrap { padding: 0 40px 40px 40px; }
    .fc-calculator-section input[type=range] { height: 17px; }
    .fc-field-sec { margin-bottom: 20px; }
    .fc-calculator-section { padding: 0; }
    .fc-form-wrap { max-height: 450px; }
}

@media (max-width: 1100px) {
    .fc-calc-tabs { padding-right: 0; }
    .fc-calc-tabs h2 { font-size: 35px; }
    .fc-wrap-text p { font-size: 11px; }
    .fc-calculator-section input[type=range]::-webkit-slider-thumb { height: 20px; width: 20px; }
    .fc-calculator-section input[type=range] { height: 14px; }
    .fc-range-value-box { padding: 6px 20px; width: 21%; }
    .fc-step-circle { width: 30px; height: 30px; font-size: 12px; }
    .fc-btn-reset { font-size: 12px; }
    .fc-btn-primary { padding: 14px 40px; font-size: 12px; }
    .fc-form-wrap { max-height: 430px; }
}

@media (max-width: 1024px) {
    .fc-wrap-text { padding-right: 30px; }
    .fc-wrap-text h5 { font-size: 14px; }
    .fc-calc-header h3 { padding: 30px 40px 25px 40px; font-size: 20px; }
    .fc-range-value-box { font-size: 14px; }
    .fc-field-sec { margin-bottom: 15px; }
    .fc-calc-tabs h2 { font-size: 32px; }
    .fc-calc-tabs > p { font-size: 13px; width: 95%; }
    .fc-form-wrap { max-height: 380px; }
}

@media (max-width: 768px) {
    .fc-calculator-section { flex-direction: column; gap: 0; padding: 0; }
    .fc-calc-card { border-radius: 15px; overflow: visible; }
    .fc-calc-tabs { padding: 10px; }
    .fc-field-sec { margin-bottom: 10px; }
    .fc-form-wrap { padding: 0 25px 40px 25px; max-height: none; overflow-y: visible; }
    .fc-calc-card { width: 100%; }
    .fc-bundle-sett { width: 100%; }
    .fc-wrap-text { flex: 1; padding-right: 10px; }
    .fc-mobile-tab-select { display: block; }
    .fc-bundle-sett { display: none !important; }
    .fc-calc-tabs h2 { font-size: 25px; text-align: center; }
    .fc-calc-tabs > p { width: 100%; text-align: center; margin-bottom: 20px; }
    .fc-wrap-text h5 { font-size: 19px; }
    .fc-wrap-text p { font-size: 15px; }
    .fc-progress-fill { height: 9px; }
    .fc-progress-track { height: 9px; }
    .fc-calc-header h3 { display: none; }
    .fc-calculator-section input[type=range]::-webkit-slider-thumb { height: 24px; width: 24px; }
    .fc-range-value-box { padding: 9px 14px; width: 25%; font-size: 12px; }
    .fc-progress-steps { width: 65%; }
    .fc-calculator-section input[type=range] { height: 14px; }
    .fc-progress-wrapper { max-width: 100%; margin-top: 30px; }
    .fc-form-input { font-size: 14px; }
    .fc-range-wrapper { gap: 15px; }
    .fc-step-circle { width: 30px; height: 30px; }
    .fc-tab-btn { padding: 30px; }
    /* Actions no longer need sticky on mobile */
    .fc-actions { position: static; background: none; padding-top: 0; margin-top: 30px; }
}

@media (max-width: 480px) {
    .fc-calc-header h3 { font-size: 20px; }
    .fc-form-input { font-size: 14px; }
}
