/*
 * FarazSMS — استایل گرویتی فرم (نشانه‌گذاری جدید / gravity-theme)
 * ---------------------------------------------------------------
 * این فایل جایگزین ۸۷ قاعده‌ی legacy است که قبلاً داخل style.css بودند و به
 * ساختار قدیمی <ul class="gform_fields"><li class="gfield"> چسبیده بودند.
 * گرویتی فرم از نسخه ۲.۵ به <div> مهاجرت کرده، پس آن سلکتورها دیگر match
 * نمی‌شدند و استایل فرم‌ها می‌افتاد.
 *
 * نگاشت انجام‌شده:
 *   ul.gform_fields li.gfield   →  .gform_fields .gfield
 *   .gform_body ul              →  .gform_fields   (خودش گرید ۱۲ ستونه است)
 *   .gfield_radio li            →  .gfield_radio .gchoice
 *   .gfield_checkbox li         →  .gfield_checkbox .gchoice
 *   .gfield_description.validation_message → .gfield_validation_message
 *   .validation_error           →  .gform_validation_errors
 *   .gform_footer.top_label     →  .gform_footer   (top_label فقط در legacy بود)
 *
 * کلاس‌های سفارشی قالب حفظ شده‌اند:
 *   .cforms  .gform_light  .gform_plans  .gform_coupon  .gfield_total
 *   .gfield.shopping  .popup_part2  .form_buy
 *
 * متغیرهای برند (--color1, --color5, --bold-font, ...) از style.css می‌آیند.
 */

/* ---------- پایه و RTL ---------- */

.gform_wrapper.gravity-theme,
.gform_wrapper.gravity-theme input,
.gform_wrapper.gravity-theme select,
.gform_wrapper.gravity-theme textarea,
.gform_wrapper.gravity-theme .gform_button {
    font-family: var(--main-font), IRANSansWeb, Tahoma, sans-serif;
}

.gform_wrapper {
    margin: 30px auto;
}

.gform_wrapper.gravity-theme {
    direction: rtl;
    text-align: right;
}

#wrapper .gform_wrapper .gform_title {
    margin-bottom: 0;
    color: #222;
    font-family: var(--bold-font);
    font-size: 18px;
}

#wrapper .gform_wrapper .gform_title,
#wrapper .gform_wrapper .gform_description {
    text-align: center;
}

.page-template-template-payment-online .gform_heading {
    display: none;
}

/* ---------- چیدمان ---------- */
/* در نشانه‌گذاری جدید .gform_fields خودش گرید است؛ فقط فاصله‌ها تنظیم می‌شود. */

#wrapper .gform_wrapper.gravity-theme .gform_fields {
    row-gap: 20px;
}

#wrapper .gform_wrapper .gfield {
    text-align: right;
    position: relative;
    padding: 0 !important;
    margin-top: 0 !important;
}

.gform_fields .gfield:before {
    content: '';
    display: none;
}

/* ---------- برچسب‌ها ---------- */

.gfield_label {
    font-weight: normal !important;
}

.gfield_required {
    vertical-align: middle;
    margin-right: 7px !important;
    display: inline-block;
    position: relative;
    top: 3px;
}

#wrapper .cforms .gfield_required {
    color: #d53343;
}

.cforms .gchoice label:before,
.cforms .gform_plans label:before {
    content: none;
    display: none;
}

/* ---------- گزینه‌های رادیو و چک‌باکس ---------- */
/* legacy: li  →  جدید: .gchoice */

.gfield_radio .gchoice label:before,
.gfield_checkbox .gchoice label:before {
    display: none;
}

.gfield_radio .gchoice input,
.gfield_checkbox .gchoice input {
    display: inline-block;
    margin-left: 5px;
    vertical-align: middle;
    position: relative;
    top: -2px;
}

/* ---------- فوتر و دکمه ارسال ---------- */

#wrapper .gform_footer {
    text-align: center;
}

#wrapper .gform_button {
    width: auto;
}

.gform_light .gform_footer .button:before {
    background: var(--color5);
}

#pd-submission-form button.button.gform_button {
    margin-top: 20px;
}

/* ---------- اعتبارسنجی و خطا ---------- */

.gform_validation_errors,
.validation_error {
    text-align: center;
    background: #fff5f5;
    border-radius: 10px;
    color: #d53343;
    padding: 15px;
    margin: 15px auto;
    border: none;
    box-shadow: none;
}

.gfield_validation_message,
.gfield_description.validation_message {
    font-size: 13px;
    margin: 10px auto !important;
    color: #d53343;
    background: transparent;
    border: none;
    padding: 0;
    display: none;
}

#wrapper .gfield_validation_message,
#wrapper .gfield_description.validation_message {
    padding: 0;
    margin: 0;
}

.gform_fields .gfield_error input,
.gform_fields .gfield_error textarea,
.gform_fields .gfield_error select {
    border-color: #d53343;
}

#wrapper .gform_wrapper .gfield.gfield_error {
    background-color: transparent;
    margin-bottom: 20px !important;
    border-top: none;
    border-bottom: none;
    padding-bottom: 0;
    padding-top: 0;
    box-sizing: border-box;
}

html[dir="rtl"] #wrapper .gform_wrapper .gform_fields .gfield.gfield_error {
    padding-right: 0 !important;
}

#wrapper .gform_wrapper.gform_validation_error .gform_fields .gfield.gfield_error:not(.gf_left_half):not(.gf_right_half) {
    max-width: 100% !important;
}

/* ---------- پیام تأیید ---------- */

.gform_confirmation_message {
    background: var(--color1);
    color: #fff;
    margin: 15px auto;
    border-radius: 15px;
    padding: 15px;
}

.gform_confirmation_wrapper {
    text-align: center;
}

.gform_confirmation_wrapper br {
    display: none;
}

.cdesc.cforms img.gform_ajax_spinner {
    width: auto;
}

/* ---------- حالت تیره (gform_light) ---------- */

#wrapper .gform_light input[type=text]:focus,
#wrapper .gform_light input[type=email]:focus,
#wrapper .gform_light input[type=number]:focus,
#wrapper .gform_light input[type=tel]:focus,
#wrapper .gform_light textarea:focus {
    border-color: var(--color1);
    background: transparent;
    color: #fff;
}

.gform_light .gfield_error input[type=text],
.gform_light .gfield_error input[type=email] {
    background: transparent;
    color: #fff;
}

.gform_light .cforms label,
.gform_light .cforms legend {
    font-weight: normal;
    font-family: var(--main-font);
    color: #fff !important;
    margin-bottom: 10px;
}

/* ---------- انتخاب پلن (رادیوهای قرصی‌شکل) ---------- */

.gfield.shopping .ginput_container_radio {
    display: flex;
    background: #dcd8f3;
    width: max-content;
    padding: 7px 0;
    border-radius: 25px;
}

.gfield.shopping .ginput_container_radio label {
    color: #402aa9 !important;
    background: transparent;
    margin: 0 16px;
    transition: 0.4s;
    padding: 0 13px;
    border-radius: 25px;
    border: 1px solid #fff;
}

.gfield.shopping .ginput_container_radio input {
    display: none;
}

.gfield.shopping .ginput_container_radio input[type="radio"]:checked + label {
    background: #fff;
}

.gfield.shopping .ginput_container_radio .gchoice,
.gfield.shopping .ginput_container_radio .gchoice label {
    margin-bottom: 0 !important;
}

/* ---------- پلن‌ها و کد تخفیف ---------- */

#wrapper .cforms .gform_coupon,
.gform_plans {
    background: #dcd8f3;
    border-radius: 20px;
    padding: 30px !important;
}

#wrapper .cforms .gform_coupon label,
#wrapper .cforms .gform_plans label {
    color: #222 !important;
}

.gform_plans > .gfield_label,
.gform_coupon > label {
    font-size: 16px !important;
    font-family: var(--bold-font) !important;
}

.gform_plans .gfield_radio,
.gform_plans .gfield_checkbox {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.gform_plans .gchoice {
    flex: 0 0 50%;
    max-width: 50%;
    margin-bottom: 5px !important;
}

.gform_plans .gchoice label {
    padding-right: 10px !important;
}

#wrapper .cforms .gform_plans {
    padding: 30px !important;
}

body .gform_wrapper .gform_coupon .ginput_container {
    position: relative;
    margin-top: 0 !important;
}

body #wrapper #main_wrap .cforms .gform_coupon {
    margin-top: -55px !important;
}

.gf_coupon_code {
    background: transparent !important;
    border: 2px solid var(--color2) !important;
    color: #222 !important;
}

.gf_coupon_name_container {
    padding-right: 0 !important;
}

#gf_coupon_button {
    position: absolute;
    left: 0;
    top: 6px;
    margin: auto;
    height: 37px;
}

#gf_coupon_info {
    margin-top: 0;
}

#gf_coupon_info span {
    border-radius: 50px;
}

.form_buy #gf_coupon_spinner {
    width: unset;
    height: unset;
    top: 1px;
    right: -20px;
    position: absolute;
}

/* ---------- مبلغ کل ---------- */

.gfield_total {
    display: flex;
    align-items: center;
}

#wrapper .gfield_total * {
    margin: 0;
}

#wrapper .gfield_total .gfield_label {
    margin-left: 15px !important;
    font-size: 16px;
}

#wrapper .gfield_total .ginput_total {
    color: var(--color1) !important;
    font-size: 20px !important;
    font-family: var(--bold-font);
    background-color: transparent;
    border: none;
}

#wrapper .gform_light .gfield_total .ginput_total {
    color: #fff !important;
}

/* ---------- فرم داخل پاپ‌آپ ---------- */

.popup_part2 .gform_wrapper .gfield {
    margin-bottom: 10px !important;
}

/* ================= واکنش‌گرا ================= */

@media screen and (max-width: 992px) {
    .gform_plans .gchoice {
        flex: 0 0 100%;
        max-width: 100%;
        display: flex;
    }
}

@media screen and (min-width: 992px) {
    .gform_coupon {
        display: flex;
        justify-content: space-between;
        margin-bottom: 40px !important;
    }
}

@media screen and (max-width: 768px) {
    #pd-submission-form button.button.gform_button {
        margin-top: 25px;
    }
}

@media screen and (max-width: 576px) {
    .gfield_total {
        text-align: center;
        justify-content: center;
    }

    .gfield_radio .gchoice,
    .gfield_checkbox .gchoice {
        flex: 0 0 50%;
        max-width: 50%;
    }

    #wrapper .cforms .gform_plans {
        padding: 20px !important;
    }
}

@media screen and (min-width: 576px) {
    .page-template-template-buy .form_buy .gform_footer {
        position: relative;
    }

    .page-template-template-buy .form_buy .gform_footer .button {
        position: absolute;
        left: 30px;
        top: -60px;
    }

    .gfield_total {
        margin-right: 30px;
    }

    .gform_coupon > label {
        margin-top: 12px;
    }

    #gf_coupon_spinner {
        position: absolute;
        right: -30px;
        bottom: 1px;
    }

    #wrapper .cforms .gform_coupon {
        padding-bottom: 30px !important;
    }

    body .gform_wrapper .gform_coupon .ginput_container {
        flex: 0 0 400px;
        max-width: 400px;
    }

    #wrapper .popup_part2 .gfield_validation_message,
    #wrapper .popup_part2 .gfield_description.validation_message {
        padding: 0;
        margin: 0;
        position: absolute;
        display: none !important;
    }

    #wrapper .popup_part2 .gform_wrapper .gfield_error input,
    #wrapper .popup_part2 .gform_wrapper .gfield_error textarea {
        border: 1px solid #d53343 !important;
        background: transparent;
    }

    #wrapper .popup_part2 .gform_wrapper .gfield.gfield_error {
        margin-bottom: 10px !important;
    }

    .popup_part2 .gform_wrapper .gfield_validation_message,
    .popup_part2 .gform_wrapper .validation_message {
        color: #be4848;
    }

    #wrapper .popup_part2 .gform_footer {
        text-align: left;
    }

    .popup_part2 .gform_footer {
        margin: 0 !important;
    }

    #wrapper .popup_part2 .gform_wrapper .gfield {
        margin-bottom: 0;
    }

    .popup_part2 .gform_wrapper textarea.medium {
        height: 100px;
        min-height: 100px;
    }

    .popup_part2 .gfield_required {
        display: none;
    }
}
