/* فرم‌های سفارش — رنگ هر فرم از متغیر --em-of-accent می‌آید (تنظیم از سفارش‌ها ← فرم‌ها) */
.em-of {
    --em-of-accent: #ffd966;
    --em-of-on-accent: #111;
    --em-of-glow: rgba(255, 217, 102, .22);
    direction: rtl;
    text-align: right;
    width: 100%;
}
.em-of *,
.em-of *::before,
.em-of *::after { box-sizing: border-box; }
.em-of__form { margin: 0; }

.em-of__heading {
    margin: 0 0 24px;
    padding-bottom: 14px;
    text-align: center;
    font-family: 'bold', inherit;
    font-size: 1.5rem;
    color: #080808;
    border-bottom: 3px solid var(--em-of-accent);
}

.em-of__field { margin-bottom: 20px; position: relative; }

.em-of__label {
    display: block;
    margin-bottom: 8px;
    font-family: 'bold', inherit;
    font-size: .9rem;
    font-weight: 700;
    color: #080808;
}
.em-of__req { color: #ff6b35; margin-inline-start: 4px; }

/* عنوان فیلدها وقتی مخفی است (فقط برای صفحه‌خوان‌ها) */
.em-of--nolabels .em-of__label {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.em-of input[type="text"],
.em-of input[type="tel"],
.em-of input[type="email"],
.em-of select,
.em-of textarea {
    display: block;
    width: 100%;
    margin: 0;
    padding: 14px 18px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    color: #080808;
    font-family: inherit;
    font-size: .95rem;
    line-height: 1.6;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.em-of textarea { min-height: 120px; resize: vertical; }
.em-of input::placeholder,
.em-of textarea::placeholder { color: #8a8f98; opacity: 1; }

/* شماره و ایمیل چپ‌چین (مثل نمایش اعداد انگلیسی) */
.em-of input[type="tel"],
.em-of input[type="email"] { direction: ltr; text-align: left; }
.em-of input[type="tel"]::placeholder,
.em-of input[type="email"]::placeholder { text-align: left; }

/* لیست انتخابی با فلش اختصاصی به رنگ فرم */
.em-of select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-left: 46px;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: left 16px center;
    background-size: 14px 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
.em-of select option { color: #080808; background: #fff; }
.em-of select:invalid { color: #8a8f98; } /* وقتی هنوز «انتخاب کنید...» است */
.em-of select option:not([disabled]) { color: #080808; }

.em-of input:focus,
.em-of select:focus,
.em-of textarea:focus {
    outline: none;
    border-color: var(--em-of-accent);
    box-shadow: 0 0 0 4px var(--em-of-glow);
}

.em-of .is-invalid { border-color: #e11d48 !important; }
.em-of__error {
    display: block;
    min-height: 0;
    margin-top: 6px;
    font-size: .85rem;
    color: #e11d48;
}
.em-of__error:empty { display: none; }

/* دکمه ارسال به رنگ فرم */
.em-of__submit {
    display: block;
    width: 100%;
    margin: 0;
    padding: 15px;
    background: var(--em-of-accent);
    color: var(--em-of-on-accent);
    border: 0;
    border-radius: 30px;
    font-family: 'bold', inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, opacity .2s ease;
}
.em-of__submit:hover { transform: translateY(-2px); box-shadow: 0 10px 30px var(--em-of-glow); }
.em-of__submit:focus-visible { outline: 3px solid var(--em-of-glow); outline-offset: 2px; }
.em-of__submit[disabled] { opacity: .65; cursor: wait; transform: none; }
.em-of__submit.is-loading span::after {
    content: "";
    display: inline-block;
    width: 14px; height: 14px;
    margin-inline-start: 10px;
    vertical-align: -2px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: em-of-spin .7s linear infinite;
}
@keyframes em-of-spin { to { transform: rotate(360deg); } }

/* پیام نتیجه — بالای فرم؛ بعد از ۴ ثانیه خودکار محو می‌شود */
.em-of__msg { margin: 0 0 16px; transition: opacity .35s ease, transform .35s ease; }
.em-of__msg:empty { display: none; }
.em-of__msg.is-ok,
.em-of__msg.is-bad {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: .95rem;
    line-height: 1.8;
    text-align: center;
    animation: em-of-in .3s ease both;
}
.em-of__msg.is-ok { background: var(--em-of-glow); border: 1px solid var(--em-of-accent); color: #080808; }
.em-of__msg.is-bad { background: #fff1f2; border: 1px solid #fecdd3; color: #be123c; }
.em-of__msg.is-hiding { opacity: 0; transform: translateY(-6px); }
@keyframes em-of-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* هشدار شماره موبایل در فرم‌های غیر سفارش (ورود با پیامک، دیدگاه، …) */
.em-phone-warn { display: block; margin-top: 6px; font-size: .85rem; color: #e11d48; text-align: right; direction: rtl; }
.em-phone-warn:empty { display: none; }
input.is-invalid { border-color: #e11d48 !important; }

/* فیلد تله برای ربات‌ها */
.em-of__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- ظاهر تیره (مثل فرم مشاوره صفحهٔ اول) ---------- */
.em-of--dark .em-of__label { color: #fff; }
.em-of--dark .em-of__heading { color: #fff; }
.em-of--dark input[type="text"],
.em-of--dark input[type="tel"],
.em-of--dark input[type="email"],
.em-of--dark select,
.em-of--dark textarea {
    padding: 14px 18px;
    background-color: #fff;
    border: 1px solid #444;
    color: #111;
}
.em-of--dark select { background-position: left 16px center; }
.em-of--dark input:focus,
.em-of--dark select:focus,
.em-of--dark textarea:focus { border-color: var(--em-of-accent); }
.em-of--dark .em-of__submit { border-radius: 20px; }
.em-of--dark .em-of__error { color: #ff8aa1; }
.em-of--dark .em-of__msg.is-ok { color: #fff; }
.em-of--dark .em-of__msg.is-bad { background: rgba(225, 29, 72, .15); border-color: rgba(225, 29, 72, .5); color: #ffb3c1; }

@media (max-width: 600px) {
    .em-of input[type="text"],
    .em-of input[type="tel"],
    .em-of input[type="email"],
    .em-of select,
    .em-of textarea { font-size: 16px; } /* جلوگیری از زوم خودکار در iOS */
}
