@font-face {
  font-family: "Mazaj";
  src: url("../fonts/mazaj.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Ubuntu";
  src: url("../fonts/ubuntu.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2c5e92;
  --primary-dark: #1a4b7a;
  --secondary-color: #f5f7fa;
  --accent-color: #ff7e33;
  --text-color: #333;
  --light-gray: #f9fbfd;
  --border-color: #d1dbe5;
  --error-color: #e74c3c;
  --success-color: #2ecc71;
  --dropdown-bg: #ffffff;
  --dropdown-hover: #f5f7fa;
  --dropdown-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  --dropdown-gradient: linear-gradient(135deg, #f5f7fa 0%, #e6e9f2 100%);
}

body {
  font-family: "Ubuntu", sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e6e9f2 100%);
  color: var(--text-color);
  line-height: 1.6;
  padding: 20px;
  min-height: 100vh;
  direction: rtl;
}

.form-container {
  max-width: 1000px;
  margin: 20px auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.form-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.form-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  transform: rotate(30deg);
}

.header-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.2);
}

.form-header h1 {
  font-family: "Mazaj", serif;
  font-size: 2.2rem;
  margin-bottom: 10px;
  position: relative;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.form-header p {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 80%;
  margin: 0 auto;
}

.form-section {
  padding: 25px 30px;
  border-bottom: 1px solid #e0e9f2;
  background: white;
  transition: all 0.3s ease;
}

.form-section:hover {
  background: var(--light-gray);
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

.section-header i {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-left: 15px;
}

.section-header h2 {
  font-family: "Mazaj", serif;
  font-size: 1.5rem;
  color: var(--primary-color);
}

.sub-section-header {
  display: flex;
  align-items: center;
  margin: 20px 0 15px;
  color: var(--primary-dark);
  font-size: 1.2rem;
}

.sub-section-header i {
  margin-left: 10px;
  font-size: 1.2rem;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  flex: 1;
  min-width: 250px;
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--primary-dark);
}

.form-group label.required::after {
  content: " *";
  color: var(--error-color);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 15px;
  color: var(--primary-color);
  font-size: 1.1rem;
}

input, textarea, select {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: "Ubuntu", sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(44, 94, 146, 0.2);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input[type="date"] {
  padding: 11px 15px 11px 45px;
}

input[type="checkbox"] {
  width: auto;
  opacity: 0;
  position: absolute;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.checkbox-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  padding-right: 25px;
}

.checkbox-custom {
  position: absolute;
  right: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary-color);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.checkbox-option input:checked ~ .checkbox-custom {
  background-color: var(--primary-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

.checkbox-label {
  margin-right: 8px;
}

.conditional-section {
  display: none;
  margin-top: 15px;
  padding: 15px;
  background-color: rgba(44, 94, 146, 0.05);
  border-radius: 8px;
  border-right: 3px solid var(--primary-color);
  animation: fadeIn 0.4s ease-out;
}

.declaration-section {
  background-color: rgba(44, 94, 146, 0.05);
}

.declaration-text {
  padding: 15px;
  background-color: white;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  padding: 25px 30px;
  background: var(--light-gray);
  border-top: 1px solid var(--border-color);
}

/* Validation styles */
input:invalid, textarea:invalid, select:invalid {
  border-color: var(--error-color);
}

input:valid, textarea:valid, select:valid {
  border-color: var(--success-color);
}

/* Responsive styles */
@media (max-width: 768px) {
  .form-container {
    border-radius: 0;
    margin: 0;
    box-shadow: none;
  }
  
  .form-header {
    padding: 20px 15px;
  }
  
  .form-header h1 {
    font-size: 1.8rem;
  }
  
  .form-header p {
    max-width: 100%;
  }
  
  .form-section {
    padding: 20px 15px;
  }
  
  .form-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .form-group {
    min-width: 100%;
    margin-bottom: 15px;
  }
  
  .checkbox-group {
    flex-direction: column;
    gap: 10px;
  }
  
  .form-actions {
    flex-direction: column-reverse;
    gap: 10px;
    padding: 20px 15px;
  }
}

@media (min-width: 992px) {
  .form-row {
    gap: 30px;
  }
  
  .form-group {
    min-width: calc(50% - 15px);
  }
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-section {
  animation: fadeIn 0.5s ease forwards;
}

/* For RTL specific adjustments */
[dir="rtl"] .input-with-icon i {
  right: 15px;
  left: auto;
}

[dir="rtl"] input, [dir="rtl"] textarea, [dir="rtl"] select {
  padding: 12px 45px 12px 15px;
}

[dir="rtl"] .checkbox-option {
  padding-right: 0;
  padding-left: 25px;
}

[dir="rtl"] .checkbox-custom {
  right: auto;
  left: 0;
}

[dir="rtl"] .checkbox-label {
  margin-right: 0;
  margin-left: 8px;
}

[dir="rtl"] .btn i {
  margin-left: 0;
  margin-right: 8px;
}

/* Beautiful Button Styles */
.btn {
  padding: 14px 28px;
  border: none;
  border-radius: 8px;
  font-family: "Ubuntu", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(0);
}

.btn i {
  transition: all 0.3s ease;
}

/* Submit Button */
.btn-submit {
  background: linear-gradient(135deg, #2c5e92 0%, #1a4b7a 100%);
  color: white;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(44, 94, 146, 0.3);
  background: linear-gradient(135deg, #1a4b7a 0%, #2c5e92 100%);
}

.btn-submit:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(44, 94, 146, 0.3);
}

.btn-submit::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn-submit:hover::after {
  transform: translateX(100%);
}

/* Reset Button */
.btn-reset {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  color: #555;
  border: 1px solid #d1d1d1;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.btn-reset:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
  color: #333;
}

.btn-reset:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-reset::before {
  content: "↻";
  position: absolute;
  left: -20px;
  opacity: 0;
  transition: all 0.3s ease;
}

.btn-reset:hover::before {
  left: 15px;
  opacity: 1;
}

/* Button Group Spacing */
.form-actions {
  display: flex;
  justify-content: space-between;
  padding: 30px;
  background: var(--light-gray);
  border-top: 1px solid var(--border-color);
  gap: 15px;
}

/* Responsive Button Styles */
@media (max-width: 768px) {
  .form-actions {
    flex-direction: column-reverse;
    padding: 20px;
  }
  
  .btn {
    width: 100%;
    padding: 16px 24px;
  }
  
  .btn-reset {
    order: 2;
  }
  
  .btn-submit {
    order: 1;
  }
}

/* Button Loading State (for when form is submitting) */
.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease infinite;
}

.btn-reset.loading::after {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #555;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

