/* ============================================
   CONTACT FORM MODAL STYLES
   ============================================ */

/* ============================================
   COLOR CUSTOMIZATION
   ============================================ */
:root {
  --modal-overlay-bg: rgba(11, 26, 46, 0.85);
  --modal-bg: #ffffff;
  --modal-title-color: #0b347a;
  --modal-subtitle-color: #4a5568;
  --form-label-color: #0b347a;
  --form-input-border: #e0e7f1;
  --form-input-focus-border: #006efe;
  --form-input-text: #1a202c;
  --form-placeholder: #9ca3af;
  --button-submit-bg: #25d366;
  --button-submit-hover-bg: #20ba5a;
  --close-button-color: #6b7280;
  --close-button-hover-color: #0b347a;
}

/* ============================================
   MODAL OVERLAY
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 40px 20px 20px;
  backdrop-filter: blur(4px);
  /* Hidden by default — JS adds .open to show */
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

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

/* ============================================
   MODAL WRAPPER
   ============================================ */
.modal-wrapper {
  position: relative;
  max-width: 520px;
  width: 100%;
  animation: slideUp 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   MODAL CONTAINER
   ============================================ */
.modal-container {
  position: relative;
  background-color: var(--modal-bg);
  border-radius: 16px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

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

/* ============================================
   CLOSE BUTTON
   ============================================ */
.modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 40px;
  height: 40px;
  border: none;
  background: linear-gradient(135deg, #006efe 0%, #0056d6 100%);
  color: #ffffff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease-out;
  z-index: 11;
  box-shadow: 0 4px 16px rgba(0, 110, 254, 0.4);
  border: 3px solid #ffffff;
}

.modal-close:hover {
  background: linear-gradient(135deg, #0056d6 0%, #003d9e 100%);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 110, 254, 0.5);
}

/* ============================================
   MODAL HEADER
   ============================================ */
.modal-header {
  padding: 40px 40px 32px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}

.modal-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--modal-title-color);
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.modal-subtitle {
  font-size: 15px;
  color: var(--modal-subtitle-color);
  margin: 0;
  line-height: 1.5;
}

/* ============================================
   CONTACT FORM
   ============================================ */
.modal-contact-form {
  padding: 32px 34px 40px 40px;
  overflow-y: auto;
  flex: 1;
}

.modal-form-group {
  margin-bottom: 24px;
}

.modal-form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--form-label-color);
  margin-bottom: 8px;
  line-height: 1.4;
}

.modal-form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--form-input-text);
  background-color: #ffffff;
  border: 1.5px solid var(--form-input-border);
  border-radius: 8px;
  transition: all 200ms ease-out;
  font-family: inherit;
}

.modal-form-input:focus {
  outline: none;
  border-color: var(--form-input-focus-border);
  box-shadow: 0 0 0 3px rgba(0, 110, 254, 0.1);
}

.modal-form-input::placeholder {
  color: var(--form-placeholder);
}

/* ============================================
   PHONE INPUT GROUP
   ============================================ */
.modal-phone-input-group {
  display: flex;
  gap: 12px;
}

.modal-country-code-select {
  width: 120px;
  padding: 12px 12px;
  font-size: 14px;
  color: var(--form-input-text);
  background-color: #ffffff;
  border: 1.5px solid var(--form-input-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms ease-out;
  font-family: inherit;
}

.modal-country-code-select:focus {
  outline: none;
  border-color: var(--form-input-focus-border);
  box-shadow: 0 0 0 3px rgba(0, 110, 254, 0.1);
}

.modal-phone-input {
  flex: 1;
}

.modal-service-select-wrapper {
  position: relative;
}

.modal-service-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.3;
  min-height: 40px;
  cursor: pointer;
}

.modal-service-trigger-icon {
  flex-shrink: 0;
  transition: transform 150ms ease;
}

.modal-service-trigger.is-open .modal-service-trigger-icon {
  transform: rotate(180deg);
}

.modal-service-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid var(--form-input-focus-border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  max-height: 200px;
  overflow-y: auto;
  z-index: 12;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--form-input-focus-border) #f0f7ff;
}

.modal-service-option {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--form-input-text);
  font-size: 14px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.modal-service-option:hover,
.modal-service-option.active {
  background: rgba(0, 110, 254, 0.08);
  color: #0b347a;
  font-weight: 600;
}

.modal-service-options::-webkit-scrollbar {
  width: 8px;
}

.modal-service-options::-webkit-scrollbar-track {
  background: #f0f7ff;
  border-radius: 4px;
}

.modal-service-options::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #006efe 0%, #0056d6 100%);
  border-radius: 4px;
}

.modal-service-options::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #0056d6 0%, #003d9e 100%);
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.btn-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--button-submit-bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms ease-out;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
  margin-top: 8px;
}

.btn-submit:hover {
  background-color: var(--button-submit-hover-bg);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.4);
  transform: translateY(-2px);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Tablet */
@media (max-width: 767px) {
  .modal-overlay {
    padding: 32px 16px 16px;
  }

  .modal-container {
    border-radius: 12px;
    max-height: 85vh;
  }

  .modal-header {
    padding: 32px 24px 24px;
  }

  .modal-title {
    font-size: 24px;
  }

  .modal-subtitle {
    font-size: 14px;
  }

  .modal-contact-form {
    padding: 24px 20px 32px 24px;
  }

  .modal-form-group {
    margin-bottom: 20px;
  }

  .modal-form-label {
    font-size: 13px;
  }

  .modal-form-input {
    padding: 11px 14px;
    font-size: 14px;
  }

  .modal-country-code-select {
    width: 100px;
    padding: 11px 10px;
    font-size: 13px;
  }

  .btn-submit {
    padding: 13px 28px;
    font-size: 15px;
  }

  .modal-close {
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border: 2px solid #ffffff;
  }
}

/* Mobile Small */
@media (max-width: 480px) {
  .modal-overlay {
    padding: 28px 12px 12px;
  }

  .modal-header {
    padding: 28px 20px 20px;
  }

  .modal-title {
    font-size: 22px;
  }

  .modal-contact-form {
    padding: 20px 16px 28px 20px;
  }

  .modal-phone-input-group {
    gap: 8px;
  }

  .modal-country-code-select {
    width: 90px;
  }

  .modal-close {
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border: 2px solid #ffffff;
  }

  .modal-close svg {
    width: 18px;
    height: 18px;
  }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.modal-contact-form::-webkit-scrollbar {
  width: 6px;
}

.modal-contact-form::-webkit-scrollbar-track {
  background: #f0f7ff;
  border-radius: 3px;
}

.modal-contact-form::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #006efe 0%, #0056d6 100%);
  border-radius: 3px;
}

.modal-contact-form::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #0056d6 0%, #003d9e 100%);
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .modal-overlay,
  .modal-container {
    animation: none;
  }

  .modal-close:hover,
  .btn-submit:hover {
    transform: none;
  }
}
