/* متغیرهای رنگی برای تغییر آسان */
:root {
    --primary-color: #4F7E3A;   /* سبز اصلی */
    --primary-dark: #3e632d;    /* سبز تیره */
    --secondary-color: #E4572E; /* نارنجی (رنگ تاکید) */
    --text-color: #5C5859;      /* خاکستری متن */
    --bg-color: #f8f9fa;        /* پس زمینه روشن */
    --border-color: #ddd;
    --white: #ffffff;
    --error-color: #d32f2f;
    --success-color: #2e7d32;
}

/* کانتینر اصلی فرم */
#rastak-wrapper {
    max-width: 600px;
    margin: 40px auto;
    background: var(--white);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    font-family: 'IRANSans', Tahoma, Arial, sans-serif;
    direction: rtl;
    text-align: right;
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
    overflow: hidden;
}

/* عناوین */
#rastak-wrapper h3 {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    text-align: center;
}

#rastak-wrapper h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 10px 0;
    color: var(--text-color);
}

/* فیلدهای ورودی */
#rastak-wrapper input[type="text"],
#rastak-wrapper input[type="number"],
#rastak-wrapper input[type="tel"] {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box; /* جلوگیری از بیرون زدگی */
    background-color: #fdfdfd;
}

#rastak-wrapper input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 126, 58, 0.1);
}

/* فیلدهای فقط خواندنی (مثل نام شرکت) */
#rastak-wrapper input[readonly] {
    background-color: #f2f2f2;
    color: #888;
    cursor: default;
    border-color: #eee;
}

/* دکمه‌ها */
#rastak-wrapper button {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    font-family: inherit;
    margin-top: 10px;
}

#rastak-wrapper button:hover {
    background-color: var(--primary-dark);
}

#rastak-wrapper button:active {
    transform: scale(0.98);
}

#rastak-wrapper button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* دکمه ارسال مجدد کد (اگر بخواهید اضافه کنید) */
.resend-btn {
    background: none !important;
    color: var(--secondary-color) !important;
    padding: 5px !important;
    font-size: 12px !important;
    width: auto !important;
    margin-top: 5px !important;
    text-align: left;
}

/* باکس SLA (توافق‌نامه) */
#sla-content {
    background: #fafafa;
    border: 1px solid var(--border-color);
    padding: 15px;
    height: 250px;
    overflow-y: auto; /* اسکرول عمودی */
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    line-height: 1.8;
    text-align: justify;
    color: #444;
}

/* استایل اسکرول بار برای باکس SLA */
#sla-content::-webkit-scrollbar {
    width: 8px;
}
#sla-content::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

/* چک‌باکس قبول قوانین */
.sla-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
}

.sla-checkbox-wrapper input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* طراحی مدرن دکمه‌های رادیویی (انتخاب پکیج و پرداخت) */
/* نکته: باید در HTML دور اینپوت و متن یک <label class="radio-card"> بگذارید */

.radio-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.radio-card {
    flex: 1;
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: #fff;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0; /* مخفی کردن دکمه رادیویی واقعی */
    width: 0;
    height: 0;
}

.radio-card:hover {
    border-color: #aaa;
}

/* حالت انتخاب شده */
.radio-card:has(input:checked) {
    border-color: var(--secondary-color);
    background-color: #fff5f2; /* پس زمینه نارنجی خیلی کمرنگ */
    color: var(--secondary-color);
    font-weight: bold;
}

/* آیکون چک مارک (اختیاری) */
.radio-card:has(input:checked)::after {
    content: '✔';
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 12px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* قیمت‌ها در دکمه رادیویی */
.price-tag {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: var(--text-color);
}
.radio-card:has(input:checked) .price-tag {
    color: var(--secondary-color);
}

/* انیمیشن تعویض مراحل */
.step {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* پیام‌های خطا و موفقیت */
.rastak-msg {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    display: none; /* پیش‌فرض مخفی */
}

.rastak-msg.error {
    background-color: #ffebee;
    color: var(--error-color);
    border: 1px solid #ffcdd2;
    display: block;
}

.rastak-msg.success {
    background-color: #e8f5e9;
    color: var(--success-color);
    border: 1px solid #c8e6c9;
    display: block;
}

/* لودینگ (اسپینر) */
.rastak-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ریسپانسیو (موبایل) */
@media screen and (max-width: 480px) {
    #rastak-wrapper {
        padding: 20px;
        margin: 10px;
    }
    
    .radio-group {
        flex-direction: column; /* دکمه‌ها زیر هم قرار بگیرند */
    }
    
    #rastak-wrapper button {
        font-size: 14px;
    }
}