/* =========================================
   تنسيقات صفحة التقديم للاعتماد (Gpanel Apply)
   ========================================= */

/* الحاوية الرئيسية للنموذج */
.gpanel-form-container {
    max-width: 950px;
    margin: 60px auto;
    background: #ffffff;
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    border-top: 5px solid var(--primary-color, #1a5276);
}

.gpanel-header {
    text-align: center;
    margin-bottom: 40px;
}

.gpanel-header h1 {
    color: var(--primary-color, #1a5276);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.gpanel-header p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* التنسيقات المسحوبة من الـ HTML (Classes جديدة) */
.header-shadow {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-highlight {
    background: #1a5276 !important;
    color: white !important;
}

.full-width-grid {
    grid-column: 1 / -1;
}

.main-entity-select {
    font-weight: bold;
    font-size: 1.1rem;
    padding: 10px;
}

/* تنسيقات قسم مؤسسة الدولة */
.section-state-docs {
    background: #fdfefe !important;
    border: 2px solid #27ae60 !important;
}

.title-state-docs {
    color: #27ae60 !important;
}

.state-other-box {
    border: 1px dashed #e67e22 !important;
    background: #fffaf0 !important;
}

.state-other-label {
    color: #d35400 !important;
}

/* تنسيقات قسم التوصية البسيطة */
.section-lp-docs {
    background: #f9fbfd !important;
    border: 2px solid #8e44ad !important;
}

.title-lp-docs {
    color: #8e44ad !important;
}

/* تنسيقات الملاحظات والنصوص المساعدة */
.note-text {
    font-size: 0.8rem;
    color: #d35400;
    margin-top: 5px;
    margin-bottom: 0;
}

.note-text-lp {
    font-size: 0.9rem;
    color: #c0392b;
    font-weight: bold;
}

/* تنسيقات صندوق هوية المندوب */
.rep-id-box {
    background: #f4f9fc !important;
    border-color: #85b7d9 !important;
}

.rep-id-label {
    color: #2980b9 !important;
}

/* أقسام النموذج (Sections) */
.form-section {
    margin-bottom: 40px;
    padding: 35px 30px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background: #fcfcfc;
    position: relative;
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    border-color: #dee2e6;
}

.form-section h3 {
    color: var(--primary-color, #1a5276);
    margin-bottom: 25px;
    margin-top: 0;
    font-size: 1.3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--secondary-color, #d35400);
    padding-bottom: 15px;
}

.form-section h3 i {
    color: var(--secondary-color, #d35400);
    font-size: 1.5rem;
}

.form-section h4 {
    color: #343a40;
    font-size: 1.1rem;
    margin-top: 30px;
    margin-bottom: 15px;
    border-right: 3px solid var(--secondary-color, #d35400);
    padding-right: 10px;
}

/* شبكة الحقول */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

/* الحقول (Inputs) */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 700;
    color: #495057;
    font-size: 0.95rem;
}

.req {
    color: #dc3545;
    font-weight: bold;
    margin-right: 3px;
}

.form-control {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    color: #212529;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color, #1a5276);
    outline: none;
    box-shadow: 0 0 0 4px rgba(26, 82, 118, 0.1);
    background-color: #fff;
}

.form-control::placeholder {
    color: #adb5bd;
    font-size: 0.9rem;
}

/* مربعات رفع الملفات (File Upload) */
.file-upload-box {
    border: 2px dashed #adb5bd;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
    background: #ffffff;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.file-upload-box:hover {
    border-color: var(--primary-color, #1a5276);
    background: rgba(26, 82, 118, 0.02);
}

.file-upload-box label {
    display: block;
    margin-bottom: 10px;
    color: var(--primary-color, #1a5276);
    cursor: pointer;
}

.file-upload-box input[type="file"] {
    width: 100%;
    padding: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #6c757d;
}

.file-upload-box input[type="file"]::file-selector-button {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    padding: 8px 15px;
    border-radius: 5px;
    color: #495057;
    font-family: 'Cairo', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    margin-left: 10px;
}

.file-upload-box input[type="file"]::file-selector-button:hover {
    background: #e9ecef;
}

/* زر الإرسال */
.submit-btn {
    background: var(--secondary-color, #d35400);
    color: #ffffff;
    border: none;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(211, 84, 0, 0.3);
    margin-top: 20px;
}

.submit-btn:hover {
    background: #b84a00;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(211, 84, 0, 0.4);
}

.submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* رسائل الخطأ والنجاح */
#formMsg {
    text-align: center;
    font-weight: bold;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 1.1rem;
}

.msg-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 8px;
}

.msg-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 8px;
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .gpanel-form-container {
        padding: 30px 20px;
        margin: 30px 15px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-section {
        padding: 20px 15px;
    }
    
    .full-width-grid {
        grid-column: auto !important;
    }
}

/* =========================================
   إصلاح مشكلة حقل التاريخ المعكوس لجميع المتصفحات
   ========================================= */
input[type="date"] {
    direction: ltr !important; 
    text-align: right !important;
    font-family: 'Cairo', sans-serif;
    padding: 10px 15px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    margin-left: 0;
    margin-right: auto;
    cursor: pointer;
}