/* Request Call Back Modal Styles */

/* Modal Overlay */
.callback-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none !important; /* Hidden by default */
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.callback-modal.show {
  display: flex !important; /* Show as flex when active */
}

.callback-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.callback-modal__container {
  position: relative;
  width: 100%;
  max-width: 703px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 10001;
}

.callback-modal__content {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.1);
  position: relative;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
}

/* Close Button */
.callback-modal__close {
  position: absolute;
  width: 40px;
  height: 40px;
  top: 30px;
  left: 30px;
  background: none;
  border: 1px solid #c4c4c4;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease;
  z-index: 10002;
}

.callback-modal__close:hover {
  background-color: #f5f5f5;
}

.callback-modal__close img {
  display: block;
  width: 15px;
  height: 15px;
  margin: auto;
}

/* Modal Header */
.callback-modal__header {
  text-align: center;
}

.callback-modal__title {
  font-family: "Sharp Sans No1 Bold", Arial, sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 50px;
  color: #10141c;
  margin: 0;
  letter-spacing: 1px;
}

/* Form Styles */
.callback-modal__form {
  width: 100%;
  max-width: 643px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.callback-modal__form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.callback-modal__label {
  font-family: "Sharp Sans No1 Book", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  color: #10141c;
  margin: 0;
}

.callback-modal__required {
  color: #b00707;
}

.callback-modal__optional {
  color: #626262;
  font-weight: 400;
}

.callback-modal__input,
.callback-modal__textarea {
  width: 100%;
  padding: 12px 20px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  font-family: "Sharp Sans No1 Book", Arial, sans-serif;
  font-size: 14px;
  line-height: 24px;
  color: #10141c;
  background-color: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.callback-modal__input:focus,
.callback-modal__textarea:focus {
  outline: none;
  border-color: var(--color-nava);
  box-shadow: 0 0 0 2px rgba(125, 154, 76, 0.1);
}

.callback-modal__input::placeholder,
.callback-modal__textarea::placeholder {
  color: #898984;
  font-family: "Sharp Sans No1 Book", Arial, sans-serif;
  font-size: 14px;
  line-height: 24px;
}

.callback-modal__textarea {
  min-height: 94px;
  resize: vertical;
  margin-bottom: 20px;
}

/* Submit Button */
.callback-modal__submit {
  width: 100%;
  max-width: 643px;
  height: 54px;
  background-color: var(--color-nava);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-family: "Sharp Sans No1", Arial, sans-serif;
  font-size: 18px;
  font-weight: 770;
  line-height: 100%;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  padding: 12px 32px;
  box-sizing: border-box;
}

.callback-modal__submit:hover {
  background-color: #6b8a3a;
  transform: translateY(-1px);
}

.callback-modal__submit:active {
  transform: translateY(0);
}

.callback-modal__submit:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  transform: none;
}

/* Form Validation Styles */
.callback-modal__input.error,
.callback-modal__textarea.error {
  border-color: #b00707;
  box-shadow: 0 0 0 2px rgba(176, 7, 7, 0.1);
}

.callback-modal__error-message {
  color: #b00707;
  font-family: "Sharp Sans No1 Book", Arial, sans-serif;
  font-size: 12px;
  line-height: 16px;
  margin-top: 4px;
  display: none;
}

.callback-modal__input.error + .callback-modal__error-message,
.callback-modal__textarea.error + .callback-modal__error-message {
  display: block;
}

/* Success Message */
.callback-modal__success {
  background-color: #f8fff9;
  color: var(--green, #00b67a);
  border: 1px solid var(--green, #00b67a);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  font-family: "Sharp Sans No1 Book", Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
  display: none;
}

.callback-modal__success.show {
  display: block;
}

/* Loading State */
.callback-modal__submit.loading {
  position: relative;
  color: transparent;
}

.callback-modal__submit.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .callback-modal {
    padding: 16px;
    align-items: center;
    padding-top: 20px;
  }
  .callback-modal__success {
    margin-bottom: 0;
  }

  .callback-modal__container {
    max-height: 95vh;
    margin-top: 0;
  }

  .callback-modal__content {
    padding: 24px;
    gap: 20px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .callback-modal__title {
    font-size: 30px;
    line-height: 32px;
    margin-bottom: 10px;
  }

  .callback-modal__form {
    gap: 16px;
  }

  .callback-modal__input,
  .callback-modal__textarea {
    padding: 12px 16px;
    font-size: 16px; /* Prevent zoom on iOS */
    min-height: 48px;
  }

  .callback-modal__textarea {
    min-height: 80px;
    margin-bottom: 4px;
  }

  .callback-modal__submit {
    height: 48px;
    font-size: 16px;
    padding: 12px 24px;
    min-height: 48px;
  }

  .callback-modal__close {
    top: 24px;
    right: 24px;
  }

  .callback-modal__close img {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .callback-modal {
    padding: 5px;
    padding-top: 10px;
  }

  .callback-modal__content {
    padding: 24px;
    gap: 16px;
    border-radius: 6px;
  }

  .callback-modal__title {
    font-size: 30px;
    line-height: 28px;
    margin-bottom: 8px;
    margin-top: 56px;
  }

  .callback-modal__form {
    gap: 14px;
  }

  .callback-modal__input,
  .callback-modal__textarea {
    padding: 10px 12px;
    font-size: 16px;
    min-height: 44px;
  }

  .callback-modal__textarea {
    min-height: 70px;
  }

  .callback-modal__submit {
    height: 44px;
    font-size: 15px;
    padding: 10px 20px;
  }

  .callback-modal__label {
    font-size: 13px;
  }
}

/* Extra small screens */
@media (max-width: 360px) {
  .callback-modal {
    padding: 2px;
    padding-top: 5px;
  }

  .callback-modal__content {
    padding: 12px 8px;
    gap: 14px;
  }

  .callback-modal__title {
    font-size: 30px;
    line-height: 24px;
    margin-top: 56px;
  }

  .callback-modal__form {
    gap: 12px;
  }

  .callback-modal__input,
  .callback-modal__textarea {
    padding: 8px 10px;
    font-size: 15px;
    min-height: 40px;
  }

  .callback-modal__textarea {
    min-height: 60px;
  }

  .callback-modal__submit {
    height: 40px;
    font-size: 14px;
    padding: 8px 16px;
  }
}

/* Animation for modal appearance */
.callback-modal.show .callback-modal__container {
  animation: modalSlideIn 0.3s ease-out;
}

.callback-modal.show .callback-modal__overlay {
  animation: overlayFadeIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
