/* --- Modern & Optimized Stylesheet for Pool Calculator (v4) --- */

/* Main Form Container */
.pool-form-container {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 30px 35px;
    max-width: 600px;
    min-height: 480px; /* کمی ارتفاع بیشتر برای راحتی */
    margin: 40px auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    display: flex; /* فعال کردن Flexbox برای چیدمان داخلی */
}

/* Form takes all available space */
.pool-form-container form {
    width: 100%;
    display: flex;
    flex-direction: column; /* چیدمان عمودی: محتوا در بالا، دکمه‌ها در پایین */
}

/* Wrapper for main form content */
.form-content {
    flex-grow: 1; /* این بخش رشد کرده و دکمه‌ها را به پایین هل می‌دهد */
}

/* Step Titles & Text */
.pool-form-container h3 {
    color: #1a202c;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 30px;
}

/* Input Fields (Text, Tel, Number) */
.pool-form-container input[type="text"],
.pool-form-container input[type="tel"],
.pool-form-container input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    margin-top: 8px;
    margin-bottom: 20px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.pool-form-container input[type="text"]:focus,
.pool-form-container input[type="tel"]:focus,
.pool-form-container input[type="number"]:focus {
    outline: none;
    border-color: #FFD100;
    box-shadow: 0 0 0 3px rgba(255, 209, 0, 0.3);
}

/* --- NEW: Minimal & Clean Radio Buttons --- */
.pool-form-container input[type="radio"] {
    opacity: 0;
    position: fixed;
    width: 0;
}

.pool-form-container input[type="radio"] + label {
    display: inline-block;
    cursor: pointer;
    padding: 12px 18px; /* پدینگ بهینه شده */
    border: 2px solid #e2e8f0; /* حاشیه پیش‌فرض */
    border-radius: 8px;
    margin: 4px;
    transition: all 0.2s ease-in-out;
    font-weight: 600;
    color: #4a5568;
    background-color: #ffffff; /* پس‌زمینه سفید */
    text-align: center;
    box-sizing: border-box;
    position: relative; /* برای آیکون تیک */
    padding-right: 40px; /* فضای خالی برای تیک */
    width: 100%;
}

/* استایل حالت انتخاب شده برای رادیوباتن */
.pool-form-container input[type="radio"]:checked + label {
    border-color: #00cd03; /* رنگ حاشیه سبز */
    color: #1a202c;
    background-color: #f6fff6; /* پس‌زمینه سبز بسیار کم‌رنگ */
}

/* آیکون تیک برای حالت انتخاب شده */
.pool-form-container input[type="radio"]:checked + label::after {
    content: '✔'; /* آیکون تیک */
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #00cd03;
    font-size: 18px;
    font-weight: bold;
}

/* --- NEW: Flexbox-based Action Buttons --- */
.form-actions {
    display: flex; /* چیدمان دکمه‌ها در کنار هم */
    gap: 15px;      /* فاصله بین دکمه‌ها */
    margin-top: 20px; /* فاصله از محتوای بالا */
}

/* استایل مشترک برای هر دو دکمه */
.form-actions > button {
    padding: 15px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-actions > button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: #FFD100;
}

/* استایل دکمه بازگشت */
.form-actions .prev-button {
    flex: 1; /* 1 سهم از فضا */
    background-color: #e2e8f0;
    color: #4a5568;
}

/* استایل دکمه مرحله بعد */
.form-actions .next-button,
.form-actions .final-calc-button {
    flex: 2; /* 2 سهم از فضا (دو برابر دکمه بازگشت) */
    background-color: #00cd03;
    color: #000000;
}

.form-actions .next-button:hover{
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: #00cd03;
}

.form-actions .prev-button:hover{
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: #6c6c6c;
    color: #ffffff;
}

/* رنگ‌آمیزی خاص برای دکمه نهایی */
.form-actions .final-calc-button {
    background-color: #FFD100;
}


/* --- Final Result & Summary Display --- */
.summary-list {
    list-style: none;
    padding: 0;
    font-size: 15px;
}
.summary-list li {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e2e8f0;
}
.summary-list li strong {
    color: #333;
}

.add-to-cart-btn,
.contact-us-btn {
    text-decoration: none;
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover,
.contact-us-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.add-to-cart-btn {
    background-color: #1dc224;
    color: #000000;
}

.contact-us-btn {
    background-color: #f5f100;
    color: #000000;
}



/* --- NEW: Button Loading Spinner Styles --- */

/* استایل اسپینر (دایره در حال چرخش) */
.button-spinner {
  display: none; /* در حالت عادی مخفی است */
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff; /* رنگ بخش چرخان اسپینر */
  animation: spin 1s ease-in-out infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -11px;
  margin-left: -11px;
}

/* انیمیشن چرخش */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* کلاسی که با جاوا اسکریپت به دکمه اضافه می‌شود
  تا حالت بارگذاری را فعال کند
*/
.button--loading {
  position: relative;
  cursor: wait !important; /* تغییر نشانگر موس */
}

/* در حالت بارگذاری، متن اصلی دکمه را مخفی می‌کنیم */
.button--loading .button-text {
  visibility: hidden;
  opacity: 0;
}

/* و اسپینر را نمایش می‌دهیم */
.button--loading .button-spinner {
  display: block;
}