/* Modal Overlay (Scrollable wrapper to prevent ugly internal scrollbars) */
.consultation-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4); /* Softer, more modern dim */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: flex-start; /* Allows scrolling if modal is taller than screen */
  justify-content: center;
  padding: 4vh 1rem; /* Space from top/bottom of screen */
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

/* Sleek overlay scrollbar */
.consultation-modal-overlay::-webkit-scrollbar {
  width: 8px;
}
.consultation-modal-overlay::-webkit-scrollbar-track {
  background: transparent;
}
.consultation-modal-overlay::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

/* Modal Container */
.consultation-modal-container {
  background: #ffffff;
  width: 100%;
  max-width: 540px;
  margin: auto; /* Perfectly centers vertically if enough space */
  position: relative;
  padding: 40px;
  border-radius: 24px;
  box-shadow:
    0 25px 50px -12px rgba(15, 23, 42, 0.25),
    0 0 0 1px rgba(15, 23, 42, 0.05); /* Premium diffused shadow + micro border */
  transform: translateY(15px) scale(0.98);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); /* Apple-like spring curve */
}

.consultation-modal-overlay.active .consultation-modal-container {
  transform: translateY(0) scale(1);
}

/* Floating Close Button */
.consultation-modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}
.consultation-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Header Section */
.modal-header {
  margin-bottom: 32px;
}
.modal-header-icon {
  width: 48px;
  height: 48px;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 1px solid rgba(37, 99, 235, 0.1);
}
.modal-header h3 {
  margin-bottom: 8px;
  font-size: 1.5rem;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.modal-header p {
  color: #64748b;
  margin-bottom: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Form Layout */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-group {
  margin-bottom: 16px;
}

/* Modern, Subtle Labels */
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
}

/* Crisp Inputs */
.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #0f172a;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02); /* Subtle depth */
}
.form-control:hover {
  border-color: #cbd5e1;
}
.form-control:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.02);
}
.form-control::placeholder {
  color: #94a3b8;
}

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* Premium CTA Button */
.form-submit {
  width: 100%;
  margin-top: 12px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  background: #0f172a; /* Deep slate for high contrast */
  color: #ffffff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.1);
}
.form-submit:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -2px rgba(15, 23, 42, 0.15);
}

/* Success State */
.form-success {
  display: none;
  background: #ffffff;
  text-align: center;
  padding: 20px 0;
}
.success-icon-wrapper {
  width: 64px;
  height: 64px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.success-icon-wrapper svg {
  width: 32px;
  height: 32px;
}
.form-success h4 {
  color: #0f172a;
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.form-success p {
  color: #64748b;
  font-size: 1rem;
  margin-bottom: 0;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .consultation-modal-container {
    padding: 32px 24px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .consultation-modal-close {
    top: 16px;
    right: 16px;
  }
}
