@font-face {
    font-family: 'DanaVF';
    src: url('./fonts/DanaVF.woff2') format('woff2'),
         url('./fonts/DanaVF.woff') format('woff'),
         url('./fonts/DanaVF.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}




#installment-calculator {
    background-color: #f9fafb; padding: 24px; border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px; margin: 40px auto; font-family: 'DanaVF', sans-serif;
    direction: rtl; border: 1px solid #e5e7eb;
}

/* --- Timeline --- */
.calculator-timeline { display: flex; align-items: center; margin-bottom: 24px; }
.timeline-item { text-align: center; color: #9ca3af; transition: color 0.3s; }
.timeline-item.active { color: #1e40af; font-weight: 700; }
.timeline-item.completed { color: #166534; }
.timeline-dot {
    width: 32px; height: 32px; border-radius: 50%; background-color: #e5e7eb;
    color: #9ca3af; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px auto; font-weight: 700; border: 2px solid transparent;
    transition: all 0.3s;
}
.timeline-item.active .timeline-dot { background-color: #dbeafe; color: #1e40af; border-color: #3b82f6; }
.timeline-item.completed .timeline-dot { background-color: #dcfce7; color: #166534; }
.timeline-label { font-size: 12px; }
.timeline-connector {
    flex-grow: 1; height: 2px; background-color: #e5e7eb;
    transition: background-color 0.3s;
}
.timeline-connector.completed { background-color: #22c55e; }

/* --- Steps --- */
.calculator-body { padding-top: 16px; }
.calculator-step { display: none; }
.calculator-step.active { display: block; animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.step-label { font-weight: 700; font-size: 18px; color: #1f2937; margin-bottom: 16px; display: block; }

/* --- Step Navigation --- */
.step-navigation {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 24px; padding-top: 16px; border-top: 1px solid #e5e7eb;
}
.btn-next,.btn-main{
    letter-spacing: 0 !important;
    background: #2761e7 !important;
    color: #fff !important;
    border-radius: 5px !important;
}
.btn-back{
 letter-spacing: 0 !important;
    background: #e6effd !important;
    color: #285bd0 !important;
    border-radius: 5px !important;
}

.btn-next:hover, .btn-main:hover { background-color: #285bd0 !important; }

.btn-back { background-color: transparent; color: #4b5563; border: 1px solid #d1d5db; }

.btn-back:hover { background-color: #cee0fc !important; }
.step-navigation button:first-child:last-child { margin-right: auto; } /* Center single button */

/* --- Fields and Cards (Reused from previous step) --- */
.calculator-card { background-color: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
.mode-switcher, .prepayment-mode-switcher { display: flex; background-color: #f3f4f6; }
.switcher-btn { flex: 1; padding: 12px; border: none; background-color: transparent; color: #6b7280; font-size: 14px; font-weight: 700; font-family: 'DanaVF', sans-serif; cursor: pointer; transition: all 0.2s; border-bottom: 3px solid transparent; }
.switcher-btn.active { background-color: #fff; color: #1e40af; border-bottom-color: #1e40af; }
.card-content { padding: 20px; }
#installment-calculator input { width: 100%; padding: 12px; border: 1px solid #d1d5db; background-color: #fff; border-radius: 8px; box-sizing: border-box; font-size: 16px; color: #111827; font-family: 'DanaVF', sans-serif; transition: all 0.2s; }
#installment-calculator input:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25); }
.prepayment-view, .installment-view { display: none; }
.prepayment-view.active, .installment-view.active { display: block; animation: fadeIn 0.3s; }
.prepayment-view label, .installment-view label { font-size: 14px; color: #6b7280; margin-bottom: 12px; display: block; }
.slider-container { text-align: center; }
.slider { -webkit-appearance: none; width: 100%; height: 8px; background: #e5e7eb; outline: none; border-radius: 4px; margin: 16px 0; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; background: #3b82f6; cursor: pointer; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.slider-value { font-size: 24px; font-weight: 700; color: #1e40af; }
.prepayment-summary { margin-top: 16px; padding: 12px; background-color: #f9fafb; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.prepayment-summary span { color: #6b7280; }
.prepayment-summary strong { color: #1f2937; font-weight: 700; }

/* --- Footer & Results --- */
.calculator-footer { padding: 0; } /* Footer now only holds results */
#result { margin-top: 24px; padding: 16px; background-color: #fff; border: 1px solid #e5e7eb; border-radius: 12px; display: none; }
#result.visible { display: block; animation: fadeIn 0.5s; }
#result p { margin: 0; padding: 12px 0; font-size: 14px; color: #374151; display: flex; justify-content: space-between; border-bottom: 1px dashed #e5e7eb; }
#result p:last-child { border-bottom: none; }
#result p span { color: #6b7280; }
#result p strong { font-weight: 700; color: #111827; font-size: 16px; }
#result p.final-payment strong { color: #1e40af; font-size: 22px; }
#result .result-note { font-size: 12px; color: #6b7280; text-align: center; padding-top: 10px; }
/* --- Added for Step 4 & Submission --- */
.final-summary {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}
.final-summary h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    color: #1f2937;
}
.final-summary p {
    margin: 0;
    padding: 8px 0;
    font-size: 14px;
    color: #374151;
    display: flex;
    justify-content: space-between;
}
.final-summary p span { color: #6b7280; }
.final-summary p strong { font-weight: 700; color: #111827; }
.final-summary hr { border: none; border-top: 1px dashed #e5e7eb; margin: 8px 0; }

.user-info-form .form-group {
    margin-bottom: 16px;
}
.user-info-form label {
    display: block;
    font-size: 14px;
    color: #374151;
    font-weight: 700;
    margin-bottom: 8px;
}
#submission_feedback {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    display: none;
}
#submission_feedback.error {
    background-color: #fee2e2;
    color: #b91c1c;
}
.submission-success {
    background-color: #dcfce7;
    color: #166534;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
}