/* استایل‌های اصلی فرم محاسبه FM-200 (بدون تغییر) */
.fmac-calculator {
  max-width: 450px;
  margin: 30px auto;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  text-align: right;
  font-family: Tahoma, sans-serif;
}

.fmac-calculator h2 {
  color: #333;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.fmac-calculator label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
  color: #555;
}

.fmac-calculator input[type="number"] {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.fmac-calculator small {
  display: block;
  margin-top: 5px;
  margin-bottom: 15px;
  color: #888;
  font-size: 0.85em;
}

.fmac-calculator button[type="submit"] {
  background: #431243;
  color: #fff;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
  margin-top: 25px;
  transition: background-color 0.3s;
}

.fmac-calculator button[type="submit"]:hover {
  background: #5a275a;
}

.fmac-result {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid #d4edda;
  background: #f1f8f3;
  color: #155724;
  border-radius: 5px;
  font-family: Tahoma, sans-serif;
}

.fmac-result .final-result {
  font-size: 1.15em;
  font-weight: bold;
  color: #431243;
  margin-top: 10px;
}

/* === استایل‌های پاپ‌آپ (مدال) - اصلاح شده برای فاصله‌گذاری و پنهان‌سازی پیش‌فرض === */
.fm200-modal {
  /* اصلاح: پنهان کردن پیش‌فرض مدال - برای حل مشکل باز شدن خودکار */
  display: none; 
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); 
  z-index: 9999; 
  justify-content: center;
  align-items: center;
  font-family: Tahoma, sans-serif;
}

.fm200-modal.show {
  display: flex; /* نمایش مدال فقط با افزودن این کلاس توسط JS */
}

.fm200-modal-content {
  background: #fff;
  /* اصلاح اصلی: پدینگ افقی به کانتینر اصلی داده شد */
  padding: 30px 60px 40px 60px; /* بالا 30px، چپ و راست 60px، پایین 40px */
  border-radius: 15px;
  /* --- تغییرات عرض شما حفظ شد --- */
  max-width: 70vw; 
  width: 95%; 
  min-width: 350px; 
  /* ------------------------------------------------ */
  text-align: right;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  position:relative;
  overflow: hidden; 
}

/* دکمه بستن (X) */
#fm200-close {
  position:absolute;
  /* اصلاح تراز: تراز کردن دکمه بستن با پدینگ جدید 60px */
  top: 30px; 
  right: 60px; 
  /* --- */
  font-size: 32px; 
  font-weight: 300;
  cursor:pointer;
  color: #444; 
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  z-index: 10; 
}

/* محتوای داخلی */
.modal-inner-content {
  /* اصلاح: حذف پدینگ افقی اضافی (چون به کانتینر اصلی داده شد) */
  padding: 20px 0 20px 0; 
}

/* متن بالای فرم (پیام مقدماتی) */
#modal-initial-message {
  font-size: 16px; 
  font-weight: normal; 
  color: #333;
  margin: 35px 0 35px 0; 
  line-height: 1.6;
  text-align: center; 
}
/* --- */

/* استایل فیلدهای ورودی مدال (ارتفاع کشیده و گوشه‌های گرد حفظ شده) */
#user-input-form input {
  width: 100%;
  padding: 18px 15px; 
  margin-bottom: 18px; 
  border: 1px solid #ccc; 
  border-radius: 12px; 
  box-sizing: border-box;
  font-size: 16px;
  text-align: right;
  font-family: Tahoma, sans-serif;
  background-color: #f9f9f9; 
  box-shadow: none; 
  height: 60px; 
  color: #333;
}

/* استایل متن راهنمای (Placeholder) */
#user-input-form input::placeholder {
  color: #555; 
  font-size: 15px;
  font-weight: normal; 
}

/* --- */

/* استایل دکمه‌های مدال (ارتفاع کشیده و گوشه‌های گرد حفظ شده) */
.modal-button-container {
  /* اصلاح: حذف پدینگ افقی اضافی (چون به کانتینر اصلی داده شد) */
  padding: 0; 
}

#modal-submit-btn, #modal-back-btn {
  border: none;
  padding: 18px; 
  border-radius: 12px; 
  cursor: pointer;
  font-size: 17px; 
  width: 100%;
  font-weight: bold;
  margin-top: 15px; 
  transition: background-color 0.3s;
  height: 60px; 
  box-shadow: none; 
}

#modal-submit-btn {
  background: #6f42c1;
  color: #fff;
  margin-bottom: 15px; 
}

#modal-submit-btn:hover {
  background: #5a369d;
}

#modal-back-btn {
  background: #4a6fa5;
  color: #fff;
  margin-top: 0; 
}

#modal-back-btn:hover {
  background: #3c5a84;
}

/* استایل نتایج داخل مدال */
#modal-calculation-result {
  text-align: center !important;
  padding: 20px 0 !important;
}
#modal-calculation-result p {
  font-size: 16px !important;
  margin: 10px 0 !important;
}
.error {
  color: red !important;
  font-weight: bold !important;
}
