/* أنماط عامة */
/* نظام التحقق الفوري */

.live-validation {
  position: absolute;
  bottom: -22px;
  right: 0;
  font-size: 0.8em;
  width: 100%;
}

.valid-feedback {
  color: #28a745;
  display: none;
}

.invalid-feedback {
  color: #dc3545;
  display: none;
}

input:valid + label + .live-validation .valid-feedback,
input:invalid + label + .live-validation .invalid-feedback {
  display: block !important;
}
.error-message {
    color:red;
}
.sf-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    font-family: 'Segoe UI', sans-serif;
}

/* شريط التقدم */
.sf-progress-bar {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 3rem;
}

.sf-progress-step {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #666;
    z-index: 2;
    transition: all 0.3s ease;
}

.sf-progress-step.active {
    background: #2196F3;
    color: white;
    transform: scale(1.1);
}

.sf-progress-step.completed {
    background: #4CAF50;
    color: white;
}

.sf-progress-bar:before {
    content: '';
    position: absolute;
    top: 25px;
    left: 0;
    right: 0;
    height: 4px;
    background: #e0e0e0;
    z-index: 1;
}

/* خطوات النموذج */
.sf-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.sf-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* حقول الإدخال */
.sf-form-group {
    margin-bottom: 1.5rem;
}

.sf-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
}

.sf-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.sf-input:focus {
    border-color: #2196F3;
    outline: none;
}

/* أزرار التنقل */
.sf-button-group {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.sf-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sf-btn-primary {
    background: #2196F3;
    color: white;
}

.sf-btn-primary:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.sf-btn-secondary {
    background: #607D8B;
    color: white;
}

/* ملخص البيانات */
.sf-summary-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.sf-summary-item h4 {
    margin-top: 0;
    color: #2196F3;
}

/* التكيف مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .sf-container {
        margin: 1rem;
        padding: 1rem;
    }
    
    .sf-progress-step {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

body {
    font-family:Cairo;
}
:root {
  --primary-color: #0056b3;
  --text-secondary: #6c757d;
  --bg-light: #f8f9fa;
}

/* تحسينات شريط التقدم */
.progressbar {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 2rem 0 3rem;
  padding: 0 20px; /* إضافة padding للجوانب */
  list-style: none;
}

.progressbar::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% - 90px); /* تقليل العرض بمقدار حجم الأيقونات */
  height: 4px;
  background: var(--text-secondary);
  transform: translate(-50%, -50%);
  z-index: 0;
}

.progressbar li {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progressbar li::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(-50% + 22px); /* تعديل موضع البداية */
  width: calc(100% - 45px); /* تقليل العرض حسب حجم الأيقونة */
  height: 4px;
  background: var(--text-secondary);
  z-index: -1;
  transform: translateY(-50%);
  transition: all 0.3s ease;
}

.progressbar li:first-child::after,
.progressbar li:last-child::after {
  display: none; /* إخفاء الخط قبل الأول وبعد الأخير */
}

/* بقية التنسيقات كما هي */
.progressbar li i {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 45px;
  height: 45px;
  border: 3px solid var(--text-secondary);
  border-radius: 50%;
  background: #fff;
  font-size: 1.3rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.progressbar li .step-title {
  position: absolute;
  top: calc(100% + 10px);
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0.8;
}

.progressbar li.active .step-title,
.progressbar li.completed .step-title {
  color: var(--primary-color);
  opacity: 1;
  font-weight: 500;
}

.progressbar li.active i,
.progressbar li.completed i {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(var(--primary-color-rgb), 0.2);
}

.progressbar li.completed::after {
  background: var(--primary-color);
  height: 4px;
}


.step-title {
  position: absolute;
  top: calc(100% + 10px);
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .step-title {
    display: none;
  }
  
  .progressbar {
    padding: 0 10px;
    margin: 1.5rem 0 2rem;
  }
  
  .progressbar li i {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}
/* تأثيرات hover */
@media (hover: hover) {
  .progressbar li:not(.active):not(.completed):hover i {
    transform: scale(1.05);
    border-color: var(--primary-color);
    color: var(--primary-color);
  }
}
/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}
/* تعديلات خاصة لحقول الإدخال الرقمية */
/* إضافة حقل الاسم الإنجليزي للتعديلات */
.floating-label-group input[type="tel"],
.floating-label-group input[type="email"],
.floating-label-group input[type="number"],
.floating-label-group input[name="full_nameen"] { /* إضافة هذا السطر */
  direction: ltr;
  text-align: left;
  padding-left: 40px !important;
  padding-right: 15px !important;
}

.floating-label-group input[type="tel"] ~ .input-icon,
.floating-label-group input[type="email"] ~ .input-icon,
.floating-label-group input[type="number"] ~ .input-icon,
.floating-label-group input[name="full_nameen"] ~ .input-icon { /* إضافة هذا السطر */
  left: 10px !important;
  right: auto !important;
}

.floating-label-group input[type="tel"] ~ label,
.floating-label-group input[type="email"] ~ label,
.floating-label-group input[type="number"] ~ label,
.floating-label-group input[name="full_nameen"] ~ label { /* إضافة هذا السطر */
  right: 40px !important;
  left: auto !important;
  text-align: right;
}

.floating-label-group input[type="tel"]:focus ~ label,
.floating-label-group input[type="tel"]:not(:placeholder-shown) ~ label,
.floating-label-group input[type="email"]:focus ~ label,
.floating-label-group input[type="email"]:not(:placeholder-shown) ~ label,
.floating-label-group input[type="number"]:focus ~ label,
.floating-label-group input[type="number"]:not(:placeholder-shown) ~ label,
.floating-label-group input[name="full_nameen"]:focus ~ label, /* إضافة هذا السطر */
.floating-label-group input[name="full_nameen"]:not(:placeholder-shown) ~ label { /* إضافة هذا السطر */
  right: 15px !important;
  left: auto !important;
}
.floating-label-group {
  position: relative;
  margin-bottom: 1.5em;
}

/* الحقول النصية، القوائم، التواريخ */
.floating-label-group input,
.floating-label-group select {
  width: 100%;
  padding: 0.75em 0.5em;
  background-color: #fff;         /* خلفية بيضاء */
  color: #28a745;                 /* لون النص */
  border: 1px solid #28a745;      /* البوردر أخضر */
  border-radius: 4px;
  font-size: 1em;
  outline: none;
}

/* الـ label في وسط البوردر أعلى الحقل */
.floating-label-group label {
  position: absolute;
  top: -0.6em;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 0 0.3em;
  font-size: 0.9em;
  color: #28a745;
  pointer-events: none;
  z-index: 1;
}

/* تغيير اللون عند التركيز (يبقى أخضر هنا أيضًا) */
.floating-label-group input:focus,
.floating-label-group select:focus {
  border-color: #28a745;
}

.floating-label-group input:focus + label,
.floating-label-group select:focus + label {
  color: #28a745;
}

/* File Upload */
.file-upload-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  background: #fff;
  padding: 1.5rem;
  border: 2px dashed var(--text-secondary);
  border-radius: 0.5rem;
}
.upload-preview div {
  background: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  font-size: 0.9rem;
}

/* Buttons */
.sf-button-group {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}
.sf-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.3rem;
  font-weight: 500;
}
fieldset { border: 1px solid #ddd; padding: 1rem; border-radius: 0.5rem; margin-bottom: 1.5rem; }
legend { padding: 0 0.5rem; font-weight: 600; color: var(--primary-color); }

/* Responsive */
@media (max-width: 576px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}
/* التعديلات المطلوبة */
.legend-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.legend-icon {
  margin-left: auto;
}

.floating-label-group {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  z-index: 1;
}

.input-icon-right {
  left: auto;
  right: 10px;
}



/* تنسيق عام للـ fieldset */
fieldset {
  border: 2px solid;
  border-radius: 12px;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: #fff;
  position: relative;
  transition: all 0.3s ease;
}

/* تنسيق الـ legend */
.legend-with-icon {
  padding: 0 15px;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* البيانات الشخصية */
fieldset:nth-of-type(1) {
  border-color: #3B82F6;
  background: linear-gradient(145deg, #f8faff 0%, #ffffff 100%);
}

fieldset:nth-of-type(1) .legend-with-icon {
  color: #1D4ED8;
}

fieldset:nth-of-type(1) .input-icon {
  color: #3B82F6;
}

/* بيانات التواصل */
fieldset:nth-of-type(2) {
  border-color: #10B981;
  background: linear-gradient(145deg, #f0fdf4 0%, #ffffff 100%);
}

fieldset:nth-of-type(2) .legend-with-icon {
  color: #047857;
}

fieldset:nth-of-type(2) .input-icon {
  color: #10B981;
}

/* بيانات الهوية */
fieldset:nth-of-type(3) {
  border-color: #8B5CF6;
  background: linear-gradient(145deg, #f5f3ff 0%, #ffffff 100%);
}

fieldset:nth-of-type(3) .legend-with-icon {
  color: #6D28D9;
}

fieldset:nth-of-type(3) .input-icon {
  color: #8B5CF6;
}

/* تحسينات إضافية */
.floating-label-group label {
  color: #4B5563;
  transition: all 0.3s ease;
}

.floating-label-group input:focus ~ label,
.floating-label-group input:not(:placeholder-shown) ~ label,
.floating-label-group select:focus ~ label,
.floating-label-group select:valid ~ label {
  color: #1F2937;
  font-weight: 500;
}

/* تأثيرات تفاعلية */
fieldset:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
/* إضافة تنسيقات خاصة */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[readonly] {
  background-color: #f8f9fa;
  cursor: not-allowed;
}
.modern-upload-container {
  display: grid;
  gap: 1.5rem;
  padding: 20px;
}

.upload-card {
  border: 2px dashed #e0e0e0;
  border-radius: 15px;
  padding: 20px;
  transition: all 0.3s;
}

.upload-card:hover {
  border-color: #3B82F6;
  transform: translateY(-3px);
}

.upload-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.upload-header .icon {
  color: #3B82F6;
  font-size: 1.5rem;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px;
  border-radius: 10px;
  background: #f8f9fa;
  cursor: pointer;
  transition: background 0.3s;
}

.upload-label:hover {
  background: #f1f5f9;
}

.upload-label small {
  color: #64748b;
  font-size: 0.85em;
}

.preview-container {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  max-width: 300px;
}

.file-preview img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 5px;
}

.remove-file {
  color: #ef4444;
  cursor: pointer;
  margin-left: auto;
}

.error-msg {
  color: #ef4444;
  font-size: 0.9em;
  margin-top: 10px;
  display: none;
}


/* تخصيصات Select2 لتناسب التصميم الحالي */
.select2-container--default .select2-selection--single {
  border: none !important;
  background: transparent !important;
  height: auto !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  left: 10px !important;
  right: auto !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  padding-right: 40px !important;
  text-align: right !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  text-align: right !important;
  direction: rtl !important;
}

.select2-dropdown {
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
}