@font-face {
    font-family: "Yekan";
    src: url("../fonts/Yekan_Bakh_Fanum_Regular.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ۱. جلوگیری از بیرون زدن اینپوت‌ها و مدیریت پیام خطا بدون بهم‌ریختگی CSS */
*, *::before, *::after {
    box-sizing: border-box !important;
}

/* ==========================================
   ۱. کانتینر اصلی فرم و شبکه (Grid Layout)
   ========================================== */

   
.ordi-form-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    font-family: Yekan, sans-serif;
    direction: rtl;
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-sizing: border-box;
}

.ordi-form-title {
    text-align: center;
    color: #0d372d;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 30px;
}

.ordi-grid-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.ordi-section.span-12 { flex: 0 0 100%; width: 100%; }

.ordi-section.span-6 { flex: 0 0 calc(50% - 10px); width: calc(50% - 10px); }

.ordi-section.span-8 { 
    flex: 0 0 calc(74.666% - 10px); 
    width: calc(74.666% - 10px); 
}

.ordi-section.span-7 { 
    flex: 0 0 calc(60% - 10px); 
    width: calc(60% - 10px); 
}

.ordi-section.span-5 { 
    flex: 0 0 calc(40% - 10px); 
    width: calc(40% - 10px); 
}

/* نسبت دقیقاً یک سوم عرض (۴ ستون از ۱۲) */
.ordi-section.span-4 { 
    flex: 0 0 calc(33.333% - 14px); 
    width: calc(33.333% - 14px); 
}

/* نسبت‌های سفارشی دقیق برای ۳ ستون ناهمسان مثل ردیف پایین عکس (۳۵٪، ۴۰٪، ۲۵٪) */
.ordi-section.span-3-5 { 
    flex: 0 0 calc(35% - 14px); 
    width: calc(35% - 14px); 
}

.ordi-section.span-4-5 { 
    flex: 0 0 calc(40% - 14px); 
    width: calc(40% - 14px); 
}

.ordi-section.span-2-5 { 
    flex: 0 0 calc(25% - 14px); 
    width: calc(25% - 14px); 
}

@media (max-width: 992px) {
    .ordi-section.span-8,
    .ordi-section.span-7,
    .ordi-section.span-5,
    .ordi-section.span-4,
    .ordi-section.span-3-5,
    .ordi-section.span-4-5,
    .ordi-section.span-6,
    .ordi-section.span-2-5 { 
        flex: 0 0 100%; 
        width: 100%; 
    }

    .ordi-field-pair {
        flex: 0 0 100%;
    }

        .ordi-popup-box {
        width: calc(100% - 30px);
        padding: 30px 20px 20px;
        border-radius: 16px;
    }

    .ordi-popup-icon {
        width: 55px;
        height: 55px;
        font-size: 27px;
    }

    .ordi-popup-message {
        font-size: 15px;
    }
}

/* ==========================================
   ۲. کادرهای اصلی هر بخش (Section Box)
   ========================================== */
.ordi-section {
    position: relative;
    border: 1.5px solid #8baea5;
    border-radius: 12px;
    padding: 25px 15px 15px 15px;
    background: #ffffff;
    box-sizing: border-box;
    margin: 0;
    overflow: hidden; /* جلوگیـری مطلق از بیرون زدن محتوا */
    height: auto;
}

/* عناوین کادردار بالای هر بخش */
.ordi-section legend {
    background-color: #165c4b;
    color: #ffffff;
    padding: 6px 22px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    margin: 0 auto;
    display: table;
    float: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ordi-section span, p{
    font-size: 13px;
}

/* ==========================================
   ۳. چیدمان سطرها، فیلدها و ورودی‌ها
   ========================================== */
.ordi-row {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start; /* تغییر به flex-start برای ماندن ارور در زیر فیلد */
    gap: 10px;
    margin-bottom: 12px;
    width: 100%;
    max-width: 100%;
}

.ordi-row input[type="text"],
.ordi-row input[type="email"],
.ordi-row input[type="tel"],
.ordi-row input[type="number"],
.ordi-row input[type="url"],
.ordi-row select,
.ordi-section > select,
.ordi-section select.ordi-select-field,
.ordi-section textarea {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid #b9cec9;
    border-radius: 6px;
    font-size: 13px;
    font-family: Yekan, sans-serif;
    box-sizing: border-box;
    background-color: #e8efed;
    transition: all 0.2s;
}

/* select شهر/شهرستان و هر select دیگری که مستقیماً داخل بخش قرار دارد
   (خارج از .ordi-row) هم باید همان ظاهر ورودی‌های دیگر را داشته باشد */
.ordi-section select {
    display: block;
    width: 100%;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid #b9cec9;
    border-radius: 6px;
    font-size: 13px;
    font-family: Yekan, sans-serif;
    box-sizing: border-box;
    background-color: #e8efed;
    transition: all 0.2s;
    color: #1e293b;
}

.ordi-row input.full-width,
.ordi-section textarea {
    width: 100%;
    flex: 0 0 100%;
}

.ordi-section textarea {
    min-height: 80px;
    resize: vertical;
}

.ordi-row input:focus,
.ordi-section textarea:focus,
.ordi-section select:focus {
    border-color: #457d6f;
    background-color: #ffffff;
    outline: none;
}

.ordi-row label,
.full-width {
    font-size: 13px;
    color: #1e293b;
    font-weight: 600;
}

/* لیبل مستقیماً داخل ردیف (نه داخل field-pair) باید عرض ثابت خودش را
   بگیرد و پهن نشود تا کنار اینپوتش بچسبد، نه بالای آن */
.ordi-row > label:not(.full-width) {
    flex: 0 0 auto;
    white-space: nowrap;
    align-self: center;
}

.ordi-row > label.full-width {
    flex: 0 0 100%;
}

/* ==========================================
   ۳ب. اعتبارسنجی زنده فیلدها (رنگ border سبز/قرمز)
   و پیام «این فیلد اجباری است»
   ========================================== */
.ordi-valid {
    border-color: #16a34a !important;
    background-color: #f0fdf4 !important;
}

.ordi-invalid {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.ordi-field-error {
    display: block !important;
    width: 100% !important;
    clear: both;
    color: #dc2626;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    margin-bottom: 0;
}

/* ۲. اصلاح قرارگیری IR داخل input شبا */
.ordi-iban-field-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.ordi-iban-wrapper {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important; /* باعث می‌شود هر ابجکتی (از جمله ارور) حتماً برود سطر بعدی */
    align-items: flex-start !important;
    width: 100% !important;
    direction: ltr !important;
}
.ordi-iban-prefix {
    position: absolute !important;
    left: 10px !important;
    top: 18px !important; /* تنظیم ارتفاع ثابت متناسب با اینپوت */
    transform: translateY(-50%) !important;
    font-weight: bold !important;
    color: #475569 !important;
    font-size: 13px !important;
    pointer-events: none !important;
    z-index: 5 !important;
}

.ordi-iban-wrapper input#ordi-iban {
    padding-left: 38px !important;
    text-align: left !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.ordi-iban-wrapper .ordi-field-error,
.ordi-row:has(#ordi-iban) .ordi-field-error {
    display: block !important;
    width: 100% !important;
    clear: both !important;
    direction: rtl !important; /* متن فارسی خطا راست‌چین شود */
    text-align: right !important;
    margin-top: 5px !important;
    position: relative !important;
    left: 0 !important;
}

/* ==========================================
   ۴. شبکه چک‌باکس‌ها و رادیوبوتون‌ها
   ========================================== */
.ordi-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.ordi-checkbox-grid label,
.ordi-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    font-weight: normal;
}


.ordi-checkbox-grid input[type="checkbox"],
.ordi-checkbox-grid input[type="radio"],
.ordi-row input[type="checkbox"],
.ordi-row input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.ordi-other-input {
    margin-top: 10px;
    width: 100%;
}

/* ورودی‌های بخش «سایر» دقیقاً هم‌ظاهر با سایر ورودی‌ها/تکس‌اریا باشند */
.ordi-other-input input,
.ordi-other-input textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #b9cec9;
    border-radius: 6px;
    font-size: 13px;
    font-family: Yekan, sans-serif;
    background-color: #e8efed;
    box-sizing: border-box;
    transition: all 0.2s;
}

.ordi-other-input input:focus,
.ordi-other-input textarea:focus {
    border-color: #457d6f;
    background-color: #ffffff;
    outline: none;
}

/* ==========================================
   ۵. بخش آپلود مدارک پزشکی (چند فایلی)
   ========================================== */
.ordi-upload-box {
    border: 1.5px dashed #b9cec9;
    border-radius: 8px;
    padding: 12px;
    background-color: #e8efed;
    width: 100%;
    box-sizing: border-box;
}

.ordi-upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    color: #334155;
    margin-bottom: 8px;
}

.ordi-upload-header small {
    color: #64748b;
    font-weight: normal;
}

.ordi-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.ordi-file-item {
    background: #e2e8f0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ordi-file-remove {
    border: none;
    background: transparent;
    color: #dc2626;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.ordi-upload-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: transparent;
    border: 1px solid #8baea5;
    color: #334155!important;
    padding: 6px 14px;
    border-radius: 6px;
    font-family: Yekan, sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.ordi-upload-add:hover {
    background-color: #457d6f;
}

.ordi-add-row-wrapper {
    margin-top: 10px;
}

/* ==========================================
   ۶. استایل جدول‌ها (مطابق با هدر سبز تصویر)
   ========================================== */
.ordi-table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
    margin-bottom: 12px;
}

.ordi-equipment-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #94a3b8;
}

.ordi-equipment-table th {
    background-color: #165c4b; /* سبز تیره مطابق تصویر */
    color: #ffffff;
    padding: 8px 6px;
    font-size: 12px;
    text-align: center;
    border: 1px solid #8baea5;
    font-weight: 600;
}

.ordi-equipment-table td {
    border: 1px solid #cbd5e1;
    padding: 4px;
    text-align: center;
}

.ordi-equipment-table input,
.ordi-equipment-table select {
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    padding: 5px !important;
    font-size: 12px !important;
}

/* ==========================================
   ۷. تعهدات و دکمه ارسال نهایی
   ========================================== */
.terms-text {
    font-size: 13px;
    color: #334155;
    line-height: 1.6;
    margin-bottom: 12px;
}

.ordi-commitments-intro {
    font-size: 13px;
    color: #334155;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* لیست تعهدات: هر گزینه در سطر خودش و متن دقیقا زیر خودش (نه زیر گزینه بعدی) */
.ordi-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 14px;
    width: 100%;
}

.ordi-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 10px;
    width: 100%;
}

.ordi-checkbox-item input[type="checkbox"] {
    margin: 3px 0 0;
    flex-shrink: 0;
    cursor: pointer;
}

.ordi-checkbox-item span {
    flex: 1;
    line-height: 1.7;
}

.ordi-accept-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 900!important;
    color: #065f46;
    background-color: #ecfdf5;
    padding: 10px 14px;
    border: 1.5px dashed #10b981;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.ordi-submit-wrapper {
    margin-top: 20px;
    text-align: center;
}

.ordi-btn-submit {
    width: 100%;
    background-color: #165c4b;
    color: #ffffff;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-family: Yekan, sans-serif;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ordi-btn-submit:hover {
    background-color: #457d6f;
}

/* ==========================================
   ۸. جفت لیبل/اینپوت مستقل داخل یک ردیف
   (وقتی دو فیلد جدا کنار هم در یک ردیف قرار می‌گیرند،
   هر لیبل دقیقا کنار اینپوت خودش می‌ماند)
   ========================================== */
.ordi-field-pair {
    display: flex;
    flex-direction: column; /* ستونی شدن لیبل، اینپوت و ارور */
    flex: 1 1 calc(50% - 10px);
    min-width: 0; /* جلوگیری از بیرون زدن اینپوت */
    width: 50%;
}

.ordi-field-pair label {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    white-space: nowrap;
}

.ordi-field-pair input,
.ordi-field-pair select {
    flex: 1;
    width: 100%;
    min-width: 0; /* جلوگیری از بیرون زدن اینپوت از باکس */
}

/* ==========================================
   ۹. ساعات کاری و ورودی‌های همراه با واحد
   ========================================== */
.ordi-work-hours-row {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important; /* جلوگیری از رفتن به سطر بعدی */
    gap: 12px !important;
    width: 100% !important;
}

.ordi-field-item {
    position: relative !important; /* مبنا برای قرارگیری ارور */
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding-bottom: 20px !important; /* ایجاد فضای رزرو برای ارور بدون جابه‌جایی عناصر */
}
/* .ordi-field-item span {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
} */

.ordi-field-item input {
    height: 38px !important;
    margin: 0 !important;
}

.ordi-field-item .ordi-field-error,
.ordi-work-hours-row .ordi-field-error {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    white-space: nowrap !important; /* جلوگیری از چند خطی شدن ارور */
    font-size: 10px !important;
    color: #dc2626 !important;
    margin: 0 !important;
    line-height: 1 !important;
    z-index: 2 !important;
}

/* ورودی همراه با واحد، مثلاً «۱۵۰ مترمربع» یا «۵ نفر» */
.ordi-inline-input {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.ordi-inline-input input {
    flex: 1;
    min-width: 0;
}

.ordi-inline-input span {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

/* ==========================================
   ۱۰. ردیف‌های بله/خیر و دارد/ندارد
   ========================================== */
.ordi-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.ordi-toggle-row > span {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.ordi-radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* بلاک‌های مجوز (پروانه/بیمه/کد نظام) داخل بخش ۲ */
.ordi-license-block {
    width: 100%;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px dashed #b9cec9;
}

.ordi-license-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ==========================================
   ۱۱. کارت‌های آپلود مدارک (بخش ۱۰)
   ========================================== */
.ordi-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.ordi-doc-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    background: #e8efed;
    border: 1px solid #b9cec9;
    border-radius: 8px;
    padding: 14px 10px;
}

.ordi-doc-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

.ordi-file-name-preview {
    font-size: 11px;
    color: #64748b;
    word-break: break-word;
}

.ordi-file-name-preview.has-file {
    color: #16a34a;
    font-weight: 600;
}

/* ==========================================
   ORDI POPUP
========================================== */

.ordi-popup-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 999999;

    opacity: 0;
    visibility: hidden;

    transition: opacity 0.25s ease,
                visibility 0.25s ease;

    direction: rtl;
}

.ordi-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.ordi-popup-box {
    position: relative;

    width: min(90%, 430px);

    background: #fff;
    border-radius: 20px;

    padding: 35px 25px 25px;

    text-align: center;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);

    transform: translateY(20px) scale(0.95);

    transition: transform 0.25s ease;
}

.ordi-popup-overlay.show .ordi-popup-box {
    transform: translateY(0) scale(1);
}

/* دکمه بستن */

.ordi-popup-close {
    position: absolute;

    top: 12px;
    left: 15px;

    width: 32px;
    height: 32px;

    border: none;
    background: transparent;

    font-size: 28px;
    line-height: 1;

    color: #777;

    cursor: pointer;
}

.ordi-popup-close:hover {
    color: #222;
}

/* آیکون */

.ordi-popup-icon {
    width: 65px;
    height: 65px;

    margin: 0 auto 20px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 32px;
    font-weight: 700;
}

/* موفقیت */

.ordi-popup-box.success .ordi-popup-icon {
    background: #e8f8ef;
    color: #20a05a;
}

/* خطا */

.ordi-popup-box.error .ordi-popup-icon {
    background: #fdeaea;
    color: #dc3545;
}

/* متن */

.ordi-popup-message {
    font-size: 17px;
    line-height: 2;

    color: #333;

    margin-bottom: 25px;
}

/* دکمه */

.ordi-popup-ok {
    width: 100%;

    border: none;
    border-radius: 10px;

    padding: 12px 20px;

    background: #165c4b;
    color: #fff;

    font-family: Yekan, sans-serif !important;
    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.ordi-popup-ok:hover {
    /* opacity: 0.9;
    transform: translateY(-1px); */
    background-color: #457d6f;
}

/* ==========================================
   تقویم شمسی (Persian Datepicker) - هماهنگ‌سازی جهت و فونت
   ========================================== */
.ordi-form-wrapper input.ordi-date-field,
.ordi-admin-section-10-form input.ordi-date-field {
    cursor: pointer;
    background-color: #e8efed;
}

.pwt-datepicker,
.pwt-datepicker * {
    font-family: Yekan, sans-serif !important;
    direction: rtl;
}

/* ==========================================
   ۱۵. دکمه حذف ردیف جدول تجهیزات
   ========================================== */
.ordi-remove-row-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #dc2626;
    background-color: #fef2f2;
    color: #dc2626;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}

.ordi-remove-row-btn:hover {
    background-color: #dc2626;
    color: #fff;
}

/* ==========================================
   ۱۶. استایل‌های مدیریت پنل ادمین (Admin UI)
   ========================================== */
.ordi-details-card {
    background: #ffffff;
    border: 1.5px solid #8baea5;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    margin-top: 10px;
    direction: rtl;
    font-family: Yekan, sans-serif !important;
}

.ordi-details-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 700;
    color: #165c4b;
    border-bottom: 2px solid #165c4b;
    padding-bottom: 10px;
}

.ordi-details-title.ordi-admin-title-green {
    color: #065f46;
    border-color: #10b981;
}

.ordi-grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px 20px;
    margin-bottom: 25px;
}

.ordi-grid-item {
    background: #e8efed;
    border: 1px solid #b9cec9;
    border-radius: 8px;
    padding: 12px 16px;
}

.ordi-grid-item.full-width {
    grid-column: 1 / -1;
}

.ordi-item-label {
    font-size: 12px;
    color: #165c4b;
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.ordi-item-value {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.6;
    word-break: break-word;
}

.ordi-doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: #165c4b;
    border: 1px solid #8baea5;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    margin: 4px 4px 4px 0;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ordi-doc-badge:hover {
    background: #165c4b;
    color: #ffffff;
    border-color: #165c4b;
}

.ordi-admin-details-row {
    display: none;
    background: #f8faf9;
}

.ordi-admin-details-cell {
    padding: 15px !important;
}

.ordi-status-pending {
    color: #d97706;
    font-weight: 600;
}

.ordi-status-completed {
    color: #2563eb;
    font-weight: 600;
}

.ordi-status-submitted {
    color: #0d9488;
    font-weight: 600;
}

.ordi-status-done {
    color: #16a34a;
    font-weight: 600;
}