/* Registration Modal Styles */
.modal-backdrop {
  background-color: transparent !important;
  opacity: 0 !important;
}

.modal-backdrop.show {
  opacity: 0 !important;
}

/* Adjust modal position and size */
.modal {
  z-index: 99999 !important;
}

.modal-dialog {
  margin: 2vh auto !important;
  max-width: 800px;
  z-index: 99999 !important;
}

.modal-backdrop {
  z-index: 99998 !important;
}

/* Ensure form fields alignment */
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.form-row > [class*="col-"] {
  padding: 0 10px;
  margin-bottom: 15px;
}

/* Make sure form groups have consistent height */
.form-group {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 5px;
}

.form-control {
  flex: 1;
  height: 36px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 4px;
  border: 1px solid #ced4da;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  margin-bottom: 8px;
}

select.form-control {
  height: 36px;
  padding-right: 24px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-check-input {
  width: 16px;
  height: 16px;
  margin-top: 0.25em;
  vertical-align: top;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: 1px solid rgba(0, 0, 0, 0.25);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-check-input[type=checkbox] {
  border-radius: 0.25em;
}

.form-check-input:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.form-check-label {
  padding-left: 0.5em;
  margin-bottom: 0;
}

.modal-content {
  border: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
}

.modal-header {
  background-color: var(--color-primary);
  color: white;
  border-bottom: none;
  padding: 20px 25px;
}

.modal-header .close {
  color: white;
  text-shadow: none;
  opacity: 0.9;
  font-size: 28px;
  padding: 0;
  margin: -10px -10px -10px auto;
}

.modal-header .close:hover {
  opacity: 1;
  color: white;
}

.modal-title {
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0;
}

.modal-body {
  padding: 20px 25px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  border-top: 1px solid #eee;
  padding: 15px 25px;
  justify-content: space-between;
}

/* Form Styles */
.form-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section h6 {
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 20px;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(240, 34, 31, 0.1);
}

textarea.form-control {
  height: auto;
  min-height: 100px;
  resize: vertical;
}

.form-check {
  margin-bottom: 10px;
}

.form-check-input {
  margin-top: 0.25rem;
}

.form-check-label {
  padding-left: 5px;
  cursor: pointer;
}

/* Custom Button Styles */
.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: white !important;
  padding: 10px 25px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border-radius: 4px;
  font-size: 15px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: #d61e1b;
  border-color: #d61e1b;
  box-shadow: 0 4px 8px rgba(240, 34, 31, 0.3);
  color: white !important;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
  padding: 10px 25px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #5a6268;
  border-color: #545b62;
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 0.5rem auto;
  }

  .modal-content {
    border-radius: 0;
  }

  .modal-body {
    padding: 20px 15px;
  }

  .form-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
  }

  .form-section h6 {
    font-size: 1rem;
    margin-bottom: 15px;
  }
}

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

.modal.fade .modal-dialog {
  animation: fadeIn 0.3s ease-out;
}

/* Form Validation */
.was-validated .form-control:invalid,
.form-control.is-invalid {
  border-color: #dc3545;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:invalid:focus,
.form-control.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-control:invalid ~ .invalid-tooltip,
.form-control.is-invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-tooltip {
  display: block;
}
