

/* الإطار العام */
.document-form-container {
    background: #f8fafc;
    padding: 24px;
    border-radius: 16px;
}

/* الهيدر */
.form-header {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: #fff;
    padding: 20px 24px;
    border-radius: 14px;
    margin-bottom: 25px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

.form-header h1 {
    margin: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}


.form-control {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #dce3ec;
    background: #fff;
    font-size: 14px;
    transition: all .25s ease;
}

.form-control:focus {
    border-color: #1e88e5;
    box-shadow: 0 0 0 3px rgba(30,136,229,.15);
    outline: none;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #34495e;
}

.icon-accent {
    color: #1e88e5;
}
.file-upload-container {
    border: 2px dashed #cfd8dc;
    border-radius: 14px;
    padding: 18px;
    background: #fafcff;
    transition: all .25s ease;
}

.file-upload-container:hover {
    border-color: #1e88e5;
    background: #f1f7ff;
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    background: #fff;
    padding: 10px 14px;
    border-radius: 10px;
}

.step {
    opacity: .5;
    transition: all .3s ease;
}

.step.active {
    opacity: 1;
}

.step-marker {
    background: #e3f2fd;
    color: #1e88e5;
    font-weight: bold;
}

.step.active .step-marker {
    background: #1e88e5;
    color: #fff;
}

.form-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e6ed;
}

.btn {
    padding: 12px 26px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 14px;
    transition: all .25s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
}


@keyframes scaleIn {
    from { transform: scale(.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* رأس المودال */
.modal-header {
    padding: 18px 22px;
    font-weight: 700;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}
.progress-bar-large {
    background: #e5edf7;
    border-radius: 14px;
    overflow: hidden;
    height: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e88e5, #42a5f5);
    border-radius: 14px;
    transition: width .4s ease;
}

.stage {
    display: flex;
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    transition: all .3s ease;
}

.stage.active {
    background: #e3f2fd;
    border-color: #1e88e5;
}

.stage.completed {
    background: #e8f5e9;
    border-color: #2ecc71;
}

.stage-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e88e5;
    font-size: 16px;
}

.mini-progress-modal {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 280px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,.25);
    animation: slideUp .4s ease;
    z-index: 9999;
}

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

.mini-header {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: #fff;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.mini-progress-bar {
    height: 10px;
    background: #e5edf7;
    border-radius: 10px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #42a5f5, #1e88e5);
    transition: width .3s ease;
}

body.tawkid-dark .document-form-container {
    background: #0f172a;
    color: #e5e7eb;
}

body.tawkid-dark .form-control {
    background: #020617;
    border-color: #1e293b;
    color: #e5e7eb;
}

body.tawkid-dark .modal-content {
    background: #020617;
}
.form-section {
    display: none;
}

.form-section.active {
    display: block;
}



/* تصميم حقل تحميل الملفات */
.file-upload-container {
    position: relative;
    margin-top: 15px;
}

.file-input {
    display: none;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 25px 15px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-upload-label:hover {
    border-color: #2980b9;
    background-color: #e3f2fd;
}

.upload-icon {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 10px;
}

.upload-text {
    display: flex;
    flex-direction: column;
}

.browse-text {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.file-types {
    font-size: 12px;
    color: #7f8c8d;
}

.file-preview {
    display: flex;
    align-items: center;
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #f1f8ff;
    border-radius: 6px;
    border-left: 4px solid #4da6ff;
}

.file-icon {
    font-size: 24px;
    color: #4da6ff;
    margin-right: 10px;
}

.file-name {
    flex-grow: 1;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-file-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    margin-left: 10px;
}

.remove-file-btn:hover {
    color: #c0392b;
}
/* أنماط الـ modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    background: #e74c3c;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 10px;
}

.modal-body {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.6;
}

.modal-footer {
    padding: 15px 20px;
    text-align: left;
    border-top: 1px solid #eee;
}

     :root {
      --primary: #2C3E50;
      --primary-dark: #1A252F;
      --accent: #1ABC9C;
      --accent-light: #d1f2eb;
      --bg: #F4F6F9;
      --white: #FFFFFF;
      --border: #DDE3EA;
      --text: #2C3E50;
      --muted: #6B7A8F;
      --radius: 0.75rem;
      --gap: 1rem;
      --transition: 0.3s ease;
      --input-height: 2.75rem;
      --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
      --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
      --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  font-family: 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
}

.document-form-container {
  max-width: 800px;
  margin: 1.5rem auto;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  position: relative;
}

/* تحسين وضوح الهيدر */
.form-header {
  background: var(--primary);
  color: var(--white);
  padding: var(--gap);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  
  h1 {
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  }
}

.form-body {
  padding: var(--gap);
  background: var(--bg);
}

.progress-tracker {
  position: relative;
  padding-bottom: var(--gap);
}

.progress-bar {
  height: 4px;
  background: var(--accent);
  width: 0;
  transition: width var(--transition);
  border-radius: 2px;
}

.multi-section-form {
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

/* تأثيرات الانتقال الأساسية */
.form-section {
    transition: all 0.5s cubic-bezier(0.65, 0.05, 0.36, 1);
    transform-style: preserve-3d;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transform: translateX(30px);
}

.form-section.active {
    opacity: 1;
    height: auto;
    transform: translateX(0);
    overflow: visible;
}

/* تأثيرات خاصة للخطوات */
.form-section:nth-child(odd) {
    transform: translateX(-30px);
}

.form-section:nth-child(odd).active {
    transform: translateX(0);
}

/* تأثيرات شريط التقدم */
.progress-bar-fill {
    transition: width 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* تأثيرات الأزرار */
.btn {
    transition: all 0.3s ease, transform 0.2s cubic-bezier(0.72, 1.25, 0.57, 1.49);
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(1px);
}

/* تأثيرات الحقول */
.form-control {
    transition: all 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* تأثيرات خاصة للخطوة النشطة */
.form-section.active {
    animation: fadeInUp 0.7s forwards;
}

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

/* تأثيرات الدخول والخروج */
.slide-enter-active {
    animation: slideIn 0.5s;
}

.slide-leave-active {
    animation: slideOut 0.5s;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    align-items: flex-start;
}


/* تحسينات الهيدر */
.form-header {
  background: var(--primary);
  padding: var(--gap);
  position: relative;
  
  h1 {
    color: var(--white);
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    letter-spacing: -0.5px;
  }
}

/* تحسينات الحقول */
.form-group {
  margin-bottom: 1.25rem;
  position: relative;

  label {
    display: block;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.75rem;
    font-weight: 500;
    
    .required-star {
      color: var(--accent);
      margin-inline-start: 0.25rem;
    }
  }

  input, select, textarea {
    width: 100%;
    height: var(--input-height);
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: calc(var(--radius) - 0.25rem);
    font-size: 1rem;
    background: var(--white);
    transition: all var(--transition);
    
    &:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.15);
    }
    
    &::placeholder {
      color: color-mix(in srgb, var(--muted) 50%, white);
    }
  }

  select {
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236B7A8F'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 1rem center/1.25rem;
  }

  textarea {
    min-height: 150px;
    padding: 1rem;
    line-height: 1.5;
  }
}

/* شريط التقدم المُحسّن */
.progress-tracker {
  padding: 0 var(--gap) var(--gap);

  .progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
    
    &-fill {
      height: 100%;
      width: 30%;
      background: var(--accent);
      transition: width var(--transition);
    }
  }
}

/* تحسينات الحقول مع تأثيرات تفاعلية */
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
  
  label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text);
    opacity: 0.9;
    font-size: 0.95rem;
  }
  
  input, select, textarea {
    width: 100%;
    height: var(--input-height);
    padding: 0 1.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all var(--transition);
    background: var(--white);
    
    &:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 4px rgba(26, 188, 156, 0.15);
      padding-left: 1.75rem;
    }
    
    &::placeholder {
      color: color-mix(in srgb, var(--muted) 40%, white);
    }
  }
  
  textarea {
    min-height: 150px;
    padding: 1rem 1.5rem;
    line-height: 1.6;
  }
}

/* تصميم أزرار مخصص مع تأثيرات حركية */
.controls {
  padding: var(--gap);
  background: var(--bg);
  border-top: 2px solid rgba(0,0,0,0.05);
  
  .btn {
    padding: 1rem 2.5rem;
    border-radius: var(--radius);
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    
    &::after {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(
        120deg,
        transparent,
        rgba(255,255,255,0.3),
        transparent
      );
      transition: left 0.6s;
    }
    
    &:hover::after {
      left: 100%;
    }
    
    &-primary {
      background: var(--accent);
      color: var(--white);
      box-shadow: var(--shadow-sm);
      
      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(26, 188, 156, 0.4);
      }
    }
    
    &-secondary {
      background: var(--white);
      border: 2px solid var(--accent);
      color: var(--accent);
      
      &:hover {
        background: var(--accent-light);
        color: var(--white);
      }
    }
  }
}

/* تحسينات الشريط الجانبي للارقام */
.number-controls {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  
  .number-btn {
    width: 28px;
    height: 28px;
    background: var(--accent-light);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    
    &:hover {
      background: var(--accent);
    }
    
    &:active {
      transform: scale(0.9);
    }
  }
}

/* تحسينات القوائم المنسدلة مع تأثيرات */
.custom-select-dropdown {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: none;
  margin-top: 0.5rem;
  
  .option {
    padding: 0.75rem 1.5rem;
    transition: all 0.2s;
    
    &:hover {
      background: var(--accent-light);
      color: var(--white);
      transform: translateX(5px);
    }
    
    &.selected {
      background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
    }
  }
}


/* تحسين أيقونة التحميل */
.spinner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  
  &.active {
    display: flex;
  }
  
  .spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .document-form-container {
    margin: 0;
    border-radius: 0;
  }
  
  .form-header, .controls {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .steps {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  input, select, textarea {
    height: 2.5rem;
  }
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
    direction: ltr;
    text-align: left;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-input-wrapper {
    position: relative;
}

.number-controls {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.number-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* أنماط القائمة المخصصة */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.custom-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.search-box {
    padding: 10px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 8px 30px 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-box i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.options-list {
    padding: 5px 0;
}

.option {
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.option:hover {
    background: #f5f5f5;
}

.option.selected {
    background: var(--primary);
    color: white;
}

.hidden-select {
    display: none;
}

:root {
  --primary: #2C3E50;
  --primary-dark: #1A252F;
  --accent: #1ABC9C;
  --bg: #F4F6F9;
  --white: #FFFFFF;
  --border: #DDE3EA;
  --text: #2C3E50;
  --muted: #6B7A8F;
  --radius: 0.75rem;
  --gap: 1rem;
  --transition: 0.3s ease;
  --input-height: 2.75rem;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  font-family: 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text);
}

/* حاوية النموذج */
.document-form-container {
  max-width: 860px;
  margin: 2rem auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding-bottom: 1rem;
  animation: fadeIn 0.5s ease-in-out;
}

/* رأس النموذج */
.form-header {
  background: var(--primary);
  color: var(--white);
  padding: 1.5rem;
  text-align: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.form-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* جسم النموذج */
.form-body {
  padding: var(--gap);
  background: var(--bg);
}

/* التتبع */
.progress-tracker {
  padding: 0 var(--gap) var(--gap);
}

/* هيكل رئيسي لشريط التقدم */
.progress-container {
  margin-bottom: 2rem;
  position: relative;
}

/* شريط التقدم الأساسي */
.progress-tracker {
  position: relative;
  padding-bottom: 2.5rem; /* مساحة كافية للخطوات */
}

.progress-bar {
  height: 6px;
  background-color: var(--border);
  border-radius: 3px;
  position: relative;
  margin-top: 2rem; /* مساحة للخطوات من الأعلى */
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: var(--accent);
  border-radius: 3px;
  transition: width var(--transition);
}

/* الحقول */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    align-items: flex-start;
}
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-group .required-star {
  color: var(--accent);
  margin-inline-start: 0.25rem;
}

input, select, textarea {
  width: 100%;
  height: var(--input-height);
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 1rem;
  transition: all var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(26, 188, 156, 0.15);
  outline: none;
}

select {
  appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%236B7A8F' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 1rem center/1rem;
}

textarea {
  min-height: 150px;
  resize: vertical;
  padding: 1rem;
}

/* أزرار التحكم */
.controls {
  padding: var(--gap);
  text-align: center;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  font-size: 1rem;
  display: inline-block;
  margin: 0.25rem;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.3),
    transparent
  );
  transition: left 0.6s;
}

.btn:hover::after {
  left: 100%;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: #16a085;
}

/* حركات */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.honor-field-wrapper {
    transition: all 0.3s ease;
    overflow: hidden;
}

.radio-group {
    margin-top: 10px;
    padding-inline-start: 5px;
}

.form-check-inline {
    margin-inline-end: 15px;
}

:root {
  --primary: #2C3E50;
  --primary-dark: #1A252F;
  --accent: #1ABC9C;
  --accent-light: #D1F2EB;
  --bg: #F4F6F9;
  --white: #FFFFFF;
  --border: #DDE3EA;
  --text: #2C3E50;
  --muted: #6B7A8F;
  --radius: 0.75rem;
  --gap: 1rem;
  --transition: 0.3s ease;
  --input-height: 2.75rem;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.document-form-container {
  max-width: 860px;
  margin: 2rem auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding-bottom: 1rem;
  animation: fadeIn 0.5s ease-in-out;
}

.form-header {
  background: var(--primary);
  color: var(--white);
  padding: 1.5rem;
  text-align: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.form-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-body {
  padding: var(--gap);
  background: var(--bg);
}

.progress-container {
  margin-bottom: 2rem;
}

.progress-tracker {
  position: relative;
  padding-bottom: 2.5rem;
}

.progress-bar {
  height: 6px;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    align-items: flex-start;
}

.form-section {
  display: none;
}

.form-section.active {
  display: block;
  animation: fadeIn 0.5s ease-in-out;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-group .required-star {
  color: var(--accent);
  margin-inline-start: 0.25rem;
}

input, select, textarea {
  width: 100%;
  height: var(--input-height);
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 1rem;
  transition: all var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(26, 188, 156, 0.15);
  outline: none;
}

select {
  appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%236B7A8F' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 1rem center/1rem;
}

textarea {
  min-height: 150px;
  resize: vertical;
  padding: 1rem;
}

.form-controls {
  padding: var(--gap);
  text-align: center;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  font-size: 1rem;
  display: inline-block;
  min-width: 120px;
  text-align: center;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.3),
    transparent
  );
  transition: left 0.6s;
}

.btn:hover::after {
  left: 100%;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: #16a085;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-secondary {
  background: var(--white);
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-success {
  background: #27ae60;
  color: var(--white);
}

.btn-success:hover {
  background: #219955;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: var(--primary);
}

.loading-content i {
  margin-bottom: 1rem;
}

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

@media (max-width: 768px) {
  .document-form-container {
    margin: 0;
    border-radius: 0;
  }
  
  .steps {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .step {
    flex: none;
    width: calc(50% - 0.5rem);
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .btn {
    padding: 0.75rem 1rem;
    min-width: 100px;
  }
}

.document-form-container {
  max-width: 860px;
  margin: 2rem auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding-bottom: 1rem;
  animation: fadeIn 0.5s ease-in-out;
}

.form-header {
  background: var(--primary);
  color: var(--white);
  padding: 1.5rem;
  text-align: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.form-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-body {
  padding: var(--gap);
  background: var(--bg);
}

.progress-container {
  margin-bottom: 2rem;
}

.progress-tracker {
  position: relative;
  padding-bottom: 2.5rem;
}

.progress-bar {
  height: 6px;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.steps {
  display: flex;
  justify-content: space-between;
  position: absolute;
  width: 100%;
  top: -12px;
}

.step {
  text-align: center;
  flex: 1;
  position: relative;
  cursor: pointer;
}

.step-marker {
  width: 30px;
  height: 30px;
  line-height: 30px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--border);
  color: var(--muted);
  margin: 0 auto;
  transition: all var(--transition);
  font-weight: bold;
  position: relative;
  z-index: 2;
}

.step.active .step-marker {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.progress-container {
  margin-bottom: 2.5rem;
  position: relative;
}

.progress-tracker {
  position: relative;
  padding-bottom: 3rem; /* زيادة المساحة للخطوات */
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  position: absolute;
  top: 20px; /* تعديل الموضع */
  left: 0;
  right: 0;
  z-index: 1;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.step {
  text-align: center;
  flex: 1;
  position: relative;
}

.step-marker {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--border);
  color: var(--muted);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  position: relative;
  z-index: 3;
}

.step.active .step-marker {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.step-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 10px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 2;
}

.step.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

.step-header {
  margin: -1rem 0 1.5rem;
  position: relative;
}

.step-title-frame {
  border: 2px solid var(--primary-light);
  border-radius: 12px;
  padding: 1.5rem 1rem 1.5rem 4rem; /* زيادة المساحة للأيقونة */
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: relative;
  text-align: right;
}

.step-title {
  font-size: 1.3rem;
  color: var(--primary-dark);
  font-weight: 700;
  margin: 0;
  position: relative;
  z-index: 2;
}

.step-number {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--accent);
  color: white;
  padding: 4px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.step-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-light);
  font-size: 2rem;
  opacity: 0.3;
  z-index: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
  margin-top: var(--gap);
}

.form-section {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.form-section.active {
  display: block;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-group .required-star {
  color: var(--accent);
  margin-inline-start: 0.25rem;
}

input, select, textarea {
  width: 100%;
  height: var(--input-height);
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 1rem;
  transition: all var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(26, 188, 156, 0.15);
  outline: none;
}

select {
  appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%236B7A8F' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 1rem center/1rem;
}

textarea {
  min-height: 150px;
  resize: vertical;
  padding: 1rem;
}

.form-controls {
  padding: var(--gap);
  text-align: center;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  font-size: 1rem;
  display: inline-block;
  min-width: 120px;
  text-align: center;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.3),
    transparent
  );
  transition: left 0.6s;
}

.btn:hover::after {
  left: 100%;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: #16a085;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-secondary {
  background: var(--white);
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-success {
  background: #27ae60;
  color: var(--white);
}

.btn-success:hover {
  background: #219955;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: var(--primary);
}

.loading-content i {
  margin-bottom: 1rem;
}

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

@media (max-width: 768px) {
  .document-form-container {
    margin: 0;
    border-radius: 0;
  }
  
  .steps {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .step {
    flex: none;
    width: calc(50% - 0.5rem);
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .btn {
    padding: 0.75rem 1rem;
    min-width: 100px;
  }
}


.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
    padding: 0.25rem 0.5rem;
 /*   background-color: #f8d7da;*/
    border-radius: 0.25rem;
    border: 1px solid #f5c6cb;
}

.is-invalid {
    border-color: #dc3545 !important;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}


/* أنماط خطوة الخلاصة */
.summary-step {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.summary-title {
  color: var(--primary-dark);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.summary-item {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.summary-value {
  color: var(--text);
  padding: 0.5rem;
  background: #f5f5f5;
  border-radius: 5px;
  min-height: 1.5rem;
}

.confirmation-checkbox {
  margin-top: 2rem;
  padding: 1rem;
  background: #f0f8ff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.confirmation-checkbox input {
  width: 20px;
  height: 20px;
}

.confirmation-checkbox label {
  font-weight: 500;
  color: var(--primary-dark);
}

.no-data {
  color: #666;
  text-align: center;
  padding: 1rem;
  background: #f5f5f5;
  border-radius: 5px;
  grid-column: 1 / -1;
}


/* تنسيق حقل الموافقة */
.agree-checkbox {
    margin-top: 15px;
    position: relative;
    padding-right: 30px;
}

.styled-checkbox {
    position: absolute;
    opacity: 0;
}

.styled-checkbox + label {
    position: relative;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: #555;
}

.styled-checkbox + label:before {
    content: '';
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.styled-checkbox:checked + label:before {
    background: #4CAF50;
    border-color: #4CAF50;
}

.styled-checkbox:checked + label:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 9px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.styled-checkbox:focus + label:before {
    box-shadow: 0 0 0 3px rgba(0, 120, 250, 0.2);
}

.styled-checkbox:disabled + label {
    color: #b8b8b8;
    cursor: auto;
}

.styled-checkbox:disabled + label:before {
    box-shadow: none;
    background: #ddd;
}

/* تنسيق حقل مرتبة الشرف */
.honor-radio-container {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.radio-option {
    position: relative;
    flex: 1;
}

.styled-radio {
    position: absolute;
    opacity: 0;
}

.styled-radio + label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    justify-content: center;
    min-height: 50px;
}

.styled-radio + label i {
    margin-left: 8px;
    font-size: 18px;
    color: #666;
}

.styled-radio:checked + label {
    border-color: #4CAF50;
    background-color: #e8f5e9;
    color: #2E7D32;
    font-weight: 600;
}

.styled-radio:checked + label i {
    color: #2E7D32;
}

.styled-radio:focus + label {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.styled-radio:disabled + label {
    background-color: #eee;
    color: #aaa;
    cursor: not-allowed;
}

/* تأثير عند التحويم */
.styled-radio + label:hover {
    background-color: #f1f1f1;
}



/* تصميم modal التقدم */
#progress-modal .modal-content {
    width: 90%;
    max-width: 800px;
    animation: slideInUp 0.5s ease;
}

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

.progress-overview {
    padding: 10px 0;
}

.progress-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.stat-item i {
    color: #3498db;
    font-size: 18px;
}

.stat-item span {
    font-weight: 500;
    color: #2c3e50;
}

#elapsed-time, #remaining-time, #speed-status {
    font-weight: 700;
    color: #e74c3c;
}

/* شريط التقدم الرئيسي */
.main-progress {
    margin: 25px 0;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e3e6ea;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

#overall-percentage {
    color: #3498db;
    font-size: 1.2em;
}

.progress-bar-large {
    height: 12px;
    background: #e3e6ea;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 6px;
    transition: width 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.4),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
/* =====================================================
   Stages – Improved Professional Version
   ===================================================== */

.stages-container {
    margin: 28px 0;
}

/* المرحلة */
.stage {
    display: flex;
    gap: 16px;
    padding: 16px 18px;
    margin-bottom: 12px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e5e9ef;
    transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
    opacity: .85;
}

/* الحالة النشطة */
.stage.active {
    opacity: 1;
    background: #f3f8ff;
    border-color: #3b82f6;
    box-shadow: 0 6px 18px rgba(59,130,246,.12);
}

/* مكتملة */
.stage.completed {
    opacity: 1;
    background: #f0fdf4;
    border-color: #22c55e;
}

/* خطأ */
.stage.error {
    opacity: 1;
    background: #fef2f2;
    border-color: #ef4444;
}

/* =====================================================
   Icon
   ===================================================== */

.stage-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #f1f5f9;
    color: #64748b;
}

/* أيقونة نشطة */
.stage.active .stage-icon {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59,130,246,.15);
}

/* أيقونة مكتملة */
.stage.completed .stage-icon {
    background: #22c55e;
    color: #ffffff;
}

/* أيقونة خطأ */
.stage.error .stage-icon {
    background: #ef4444;
    color: #ffffff;
}

/* =====================================================
   Content
   ===================================================== */

.stage-content {
    flex: 1;
}

/* العنوان + الحالة */
.stage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stage-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
}

/* الحالة النصية */
.stage-status {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}

/* ألوان الحالة */
.stage.active .stage-status {
    background: #3b82f6;
    color: #ffffff;
}

.stage.completed .stage-status {
    background: #22c55e;
    color: #ffffff;
}

.stage.error .stage-status {
    background: #ef4444;
    color: #ffffff;
}

/* =====================================================
   Progress Bar
   ===================================================== */

.stage-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stage-progress-bar {
    flex: 1;
    height: 7px;
    background: #e5e9ef;
    border-radius: 999px;
    overflow: hidden;
}

.stage-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    border-radius: 999px;
    transition: width .45s ease;
}

/* ألوان شريط التقدم */
.stage.completed .stage-progress-fill {
    background: linear-gradient(90deg, #4ade80, #22c55e);
}

.stage.error .stage-progress-fill {
    background: linear-gradient(90deg, #f87171, #ef4444);
}

/* النسبة */
.stage-percentage {
    min-width: 42px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: #3b82f6;
}

.stage.completed .stage-percentage {
    color: #16a34a;
}

.stage.error .stage-percentage {
    color: #dc2626;
}
/* معلومات إضافية */
.additional-info {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.info-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #f1c40f;
}

.info-box i {
    color: #f1c40f;
}

.info-box span {
    color: #2c3e50;
    font-weight: 500;
}

#current-action {
    font-weight: 600;
    color: #3498db;
}

/* أزرار التحكم */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
}

.progress-actions {
    display: flex;
    gap: 10px;
}

/* Modal مصغر */
.mini-progress-modal {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 300px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 99999;
    overflow: hidden;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.mini-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #3498db;
    color: white;
    font-weight: 600;
}

.mini-controls {
    display: flex;
    gap: 5px;
}

.mini-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.mini-btn:hover {
    background: rgba(255,255,255,0.3);
}

.mini-progress {
    padding: 15px;
}

.mini-progress-bar {
    height: 6px;
    background: #e3e6ea;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.mini-percentage {
    display: block;
    text-align: center;
    font-weight: 600;
    color: #3498db;
    font-size: 0.9em;
}

.mini-status {
    padding: 10px 15px;
    background: #f8f9fa;
    text-align: center;
    font-size: 0.85em;
    color: #7f8c8d;
    border-top: 1px solid #eee;
}
 /* === أنماط عرض النتائج الناجحة === */

/* Modal النتائج الناجحة */
.success-results-modal {
    max-width: 800px;
    width: 95%;
    animation: slideInUp 0.3s ease;
}

.success-header {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 25px;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.success-icon {
    font-size: 3rem;
    animation: pulse 1.5s infinite;
}

.success-title h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.success-subtitle {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 1rem;
}

.success-summary {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
}

.summary-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.summary-col {
    flex: 1;
}

.summary-item.success-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-item.success-item i {
    font-size: 1.8rem;
    color: #28a745;
}

.item-content {
    display: flex;
    flex-direction: column;
}

.item-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 3px;
}

.item-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #343a40;
}

.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 15px;
}

.success-message i {
    font-size: 1.2rem;
    margin-top: 2px;
}

/* أزرار الإجراءات */
.success-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.btn-action {
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: white;
    color: #495057;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid #e9ecef;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn-action i {
    font-size: 1.5rem;
}

.btn-view-details { border-color: #17a2b8; color: #17a2b8; }
.btn-view-details:hover { background: #17a2b8; color: white; }

.btn-print { border-color: #6f42c1; color: #6f42c1; }
.btn-print:hover { background: #6f42c1; color: white; }

.btn-download { border-color: #28a745; color: #28a745; }
.btn-download:hover { background: #28a745; color: white; }

.btn-share { border-color: #fd7e14; color: #fd7e14; }
.btn-share:hover { background: #fd7e14; color: white; }

.btn-new { border-color: #007bff; color: #007bff; }
.btn-new:hover { background: #007bff; color: white; }

/* معاينة الأكواد */
.codes-preview {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.preview-section {
    text-align: center;
    margin-bottom: 25px;
}

.preview-section:last-child {
    margin-bottom: 0;
}

.preview-section h4 {
    color: #495057;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.qrcode-container, .barcode-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.preview-note {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Modal الوثيقة الكاملة */
.full-document-modal {
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
}

.full-document-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 0;
}

/* Modal المشاركة */
.share-modal {
    max-width: 500px;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.share-option {
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.share-option:hover {
    border-color: #007bff;
    background: #f8f9fa;
    transform: translateY(-2px);
}

.share-option i {
    font-size: 2rem;
    color: #007bff;
}

.document-link {
    margin-top: 20px;
}

.document-link label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
}

.link-container {
    display: flex;
    gap: 10px;
}

.link-container input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 0.9rem;
}

.btn-copy {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-copy:hover {
    background: #0056b3;
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .success-actions {
        grid-template-columns: 1fr;
    }
    
    .summary-row {
        flex-direction: column;
    }
    
    .share-options {
        grid-template-columns: 1fr;
    }
    
    .success-results-modal,
    .full-document-modal {
        width: 98%;
        margin: 10px;
    }
}
/* تأثيرات للخطأ */
.error-animation {
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* تحسينات للواجهة الخلفية */
body.admin-bar #progress-modal .modal-content {
    top: 32px;
}

@media (max-width: 768px) {
    .progress-stats {
        grid-template-columns: 1fr;
    }
    
    .stage-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .mini-progress-modal {
        width: 250px;
        left: 10px;
        bottom: 10px;
    }
}

/* أنماط للأيقونات المتحركة */
.fa-spin-pulse {
    animation: spin-pulse 1.5s infinite linear;
}

@keyframes spin-pulse {
    0% {
        transform: rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: rotate(180deg);
        opacity: 0.5;
    }
    100% {
        transform: rotate(360deg);
        opacity: 1;
    }
}

/* مؤقت العملية */
.timer-display {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    font-weight: 700;
}

/* سرعة الإرسال */
.speed-indicator {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.speed-slow {
    background: #f39c12;
    color: white;
}

.speed-medium {
    background: #3498db;
    color: white;
}

.speed-fast {
    background: #2ecc71;
    color: white;
}

/* تنسيق modal التفاصيل */
#document-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.document-modal-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 10px;
    overflow-y: auto;
    z-index: 100000;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
}

/* تنسيق بطاقة التفاصيل */
.document-details-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #dee2e6;
}

.info-label {
    font-weight: bold;
    color: #555;
}

.info-value {
    color: #333;
}

/* أزرار الإجراءات */
.document-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.document-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* للشاشات الصغيرة */
@media (max-width: 768px) {
    .document-modal-content {
        width: 95%;
        height: 95vh;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* تحسين أنماط التحقق */
.validation-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    display: none;
    z-index: 5;
    transition: all 0.3s ease;
}

.validation-feedback {
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    display: none;
    animation: fadeInDown 0.3s ease;
    transition: all 0.3s ease;
}

.validation-feedback.valid {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 3px solid #28a745;
}

.validation-feedback.invalid {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #dc3545;
}

.validation-feedback.loading {
    background-color: rgba(0, 123, 255, 0.1);
    border-left: 3px solid #007bff;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تصميم جديد للأزرار في الموديل */
.modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-outline-secondary {
    border: 2px solid #6c757d;
    background: transparent;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

/* تحسين عرض معلومات الطالب */
.student-summary {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
}

.options-grid {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px dashed #adb5bd;
}

.form-check-input {
    margin-left: 8px;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* تحسين responsive design */
@media (max-width: 768px) {
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 10px;
    }
    
    .info-label {
        font-size: 14px;
        margin-bottom: 3px;
    }
}


