/* Animated Contact Section - Bold & Dynamic Styling with Improved Spacing & Responsiveness */
.ftco-section {
  padding: 6rem 0 4rem; /* Using rem for better scaling */
  background: linear-gradient(135deg, #f6f9fc 0%, #eef1f5 100%);
  position: relative;
  overflow: hidden;
}

.ftco-section::before {
  content: '';
  position: absolute;
  width: 30%; /* Using percentage instead of fixed pixels */
  height: 30vw; /* Using viewport units for responsiveness */
  max-height: 300px; /* Limit the maximum size */
  background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
  border-radius: 50%;
  top: -10%;
  left: -10%;
  opacity: 0.1;
  animation: float 15s infinite ease-in-out;
  will-change: transform; /* Performance optimization */
}

.ftco-section::after {
  content: '';
  position: absolute;
  width: 20%;
  height: 20vw;
  max-height: 200px;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  border-radius: 50%;
  bottom: -5%;
  right: -5%;
  opacity: 0.1;
  animation: float 20s infinite ease-in-out reverse;
  will-change: transform; /* Performance optimization */
}

@keyframes float {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  25% { transform: translate3d(10px, 15px, 0) rotate(5deg); }
  50% { transform: translate3d(5px, 10px, 0) rotate(0deg); }
  75% { transform: translate3d(15px, 5px, 0) rotate(-5deg); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

/* Wrapper styling with dramatic shadow and increased top margin */
.wrapper {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(0);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-top: 1.875rem; /* Changed to rem units */
  margin-bottom: 1.875rem; /* Added bottom margin for better spacing */
  max-width: 1200px; /* Added max-width for extra-large screens */
  margin-left: auto;
  margin-right: auto;
}

.wrapper:hover {
  transform: translateY(-5px);
}

/* Contact Form Area with increased vertical padding */
.contact-wrap {
  background-color: #ffffff;
  padding: 3.5rem 2.5rem !important; /* Keeping this for now */
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.contact-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 30%; /* Percentage-based size */
  height: 30%; /* Percentage-based size */
  max-width: 150px;
  max-height: 150px;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.07) 0%, rgba(108, 99, 255, 0) 70%);
  border-radius: 50%;
  z-index: -1;
  animation: pulse 5s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.1; }
  50% { transform: scale(1.2); opacity: 0.15; }
  100% { transform: scale(1); opacity: 0.1; }
}

.contact-wrap h3 {
  color: #333333;
  font-weight: 700;
  position: relative;
  padding-bottom: 0.9375rem; /* Converted to rem */
  margin-bottom: 2.1875rem; /* Converted to rem */
  font-size: 1.75rem; /* Convert to rem for better scaling */
}

.contact-wrap h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 4px;
  background: linear-gradient(to right, #6c63ff, #a777e3);
  border-radius: 2px;
  animation: width-expand 1s forwards cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

@keyframes width-expand {
  from { width: 0; }
  to { width: 50px; }
}

/* Form Elements with animated focus */
.form-group {
  position: relative;
  margin-bottom: 1.5625rem; /* Converted to rem */
}

.form-control {
  height: 54px;
  background-color: #f8f9fa;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0 1.25rem; /* Converted to rem */
  font-size: 1rem; /* Converted to rem */
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  width: 100%; /* Ensure full width */
}

.form-control:focus {
  border-color: #6c63ff;
  background-color: #ffffff;
  box-shadow: 0 5px 15px rgba(108, 99, 255, 0.15);
  transform: translateY(-2px);
  outline: none; /* Remove default browser outline */
}

/* Accessibility improvement: visible focus indicator for keyboard users */
.form-control:focus-visible {
  outline: 2px solid #6c63ff;
  outline-offset: 2px;
}

textarea.form-control {
  min-height: 120px;
  padding: 0.9375rem 1.25rem; /* Converted to rem */
  resize: vertical; /* Allow vertical resizing only */
}

.label {
  color: #555555;
  font-weight: 600;
  font-size: 0.875rem; /* Converted to rem */
  transition: all 0.3s ease;
  display: block;
  margin-bottom: 0.5rem; /* Converted to rem */
}

/* Animated Submit Button */
.btn-primary {
  background: linear-gradient(45deg, #6c63ff 0%, #a777e3 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  padding: 0.875rem 1.875rem; /* Converted to rem */
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(108, 99, 255, 0.3);
  margin-top: 0.625rem; /* Converted to rem */
  min-height: 3.375rem; /* Added to ensure good tap target */
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(45deg, #a777e3 0%, #6c63ff 100%);
  transition: all 0.5s;
  z-index: -1;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(108, 99, 255, 0.4);
}

.btn-primary:hover::before {
  width: 100%;
}

.btn-primary:active {
  transform: translateY(0);
}

/* Info Box Styling */
.info-wrap {
  background: linear-gradient(135deg, #6c63ff 0%, #5a50db 100%) !important;
  padding: 3.5rem 2.5rem !important; /* Keeping this for now */
  position: relative;
  overflow: hidden;
}

.info-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

.info-wrap h3 {
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 2.1875rem; /* Converted to rem to match form heading */
  position: relative;
  display: inline-block;
  font-size: 1.75rem; /* Match form heading size */
}

.info-wrap h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 0;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.6);
  animation: width-expand 1s 0.3s forwards cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

.info-wrap .dbox {
  margin-bottom: 2.1875rem; /* Converted to rem to ensure consistent spacing */
  display: flex;
  transition: all 0.3s ease;
}

.info-wrap .dbox:hover {
  transform: translateX(5px);
}

.info-wrap .icon {
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  margin-right: 1.25rem; /* Converted to rem */
  position: relative;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  flex-shrink: 0; /* Prevent icon from shrinking on small screens */
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-wrap .dbox:hover .icon {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.info-wrap .fa {
  font-size: 1.25rem; /* Converted to rem */
  color: #ffffff;
  opacity: 0.9;
}

.info-wrap .text {
  color: rgba(255, 255, 255, 0.9);
  flex-grow: 1; /* Allow text to grow and fill available space */
}

.info-wrap .text p {
  margin-bottom: 0;
  line-height: 1.7;
  font-size: 1rem; /* Ensure consistent font size */
}

.info-wrap .text .fw-bold {
  color: #ffffff;
  font-weight: 700;
  display: block;
  margin-bottom: 0.3125rem; /* Converted to rem */
  letter-spacing: 0.5px;
}

.info-wrap .text a {
  color: #ffffff;
  text-decoration: none;
  position: relative;
  display: inline-block;
  transition: all 0.3s ease;
  /* Added padding for better touch target on mobile */
  padding: 0.125rem 0;
}

.info-wrap .text a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: #ffffff;
  transition: all 0.3s ease;
}

.info-wrap .text a:hover::after {
  width: 100%;
}

/* Accessibility improvement: focus states for links */
.info-wrap .text a:focus {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

/* Alert Animations */
.contact-alert {
  padding: 0.9375rem; /* Converted to rem */
  margin-top: 1.5625rem; /* Converted to rem */
  border-radius: 8px;
  transform-origin: center top;
  animation: slide-down 0.5s forwards cubic-bezier(0.68, -0.55, 0.27, 1.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@keyframes slide-down {
  from { 
    opacity: 0;
    transform: translateY(-20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.contact-alert.success {
  background-color: #d4f8e8;
  color: #0d6e42;
  border-left: 4px solid #0d6e42;
}

.contact-alert.error {
  background-color: #ffe6e6;
  color: #d62828;
  border-left: 4px solid #d62828;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.25rem; /* Converted to rem */
  cursor: pointer;
  padding: 0.5rem; /* Added padding for better touch target */
  line-height: 1;
  opacity: 0.5;
  transition: all 0.3s ease;
  margin-left: 0.625rem; /* Added margin for spacing */
}

.btn-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

/* Loading Animation */
.submitting {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  animation: spin 0.8s infinite linear;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Input Field Animations */
@keyframes field-focus {
  from { transform: scale(0.95); opacity: 0.8; }
  to { transform: scale(1); opacity: 1; }
}

/* Responsive Adjustments with Additional Breakpoints */
@media (max-width: 1199.98px) {
  /* Large devices */
  .wrapper {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

@media (max-width: 991.98px) {
  /* Medium devices */
  .ftco-section {
    padding: 5rem 0 3rem;
  }
  
  .contact-wrap h3, .info-wrap h3 {
    font-size: 1.5rem; /* Slightly smaller on tablets */
    margin-bottom: 1.875rem;
  }
  
  .info-wrap .dbox {
    margin-bottom: 1.875rem; /* Reduce spacing slightly */
  }
}

@media (max-width: 767.98px) {
  /* Small devices */
  .ftco-section {
    padding: 4rem 0 2rem;
  }
  
  .info-wrap, .contact-wrap {
    padding: 2rem 1.5rem !important;
  }

  .wrapper {
    margin: 1.25rem 0.9375rem; /* Adjusted margins for mobile */
    border-radius: 12px; /* Slightly smaller radius on mobile */
  }
  
  .contact-wrap h3, .info-wrap h3 {
    font-size: 1.375rem; /* Smaller on mobile */
    margin-bottom: 1.5rem;
  }
  
  .form-group {
    margin-bottom: 1.25rem; /* Tighter spacing on mobile */
  }
  
  .form-control {
    height: 50px; /* Slightly smaller height on mobile */
    font-size: 0.9375rem; /* Smaller font on mobile */
  }
  
  textarea.form-control {
    min-height: 100px; /* Smaller textarea on mobile */
  }
  
  .btn-primary {
    width: 100%;
    padding: 0.75rem 1rem; /* Larger touch target on mobile */
  }
  
  .info-wrap .dbox {
    margin-bottom: 1.5rem; /* Tighter spacing on mobile */
  }
  
  .info-wrap .text p {
    font-size: 0.9375rem; /* Smaller font on mobile */
  }
}

@media (max-width: 575.98px) {
  /* Extra small devices */
  .ftco-section {
    padding: 3rem 0 1.5rem;
  }
  
  .contact-wrap, .info-wrap {
    padding: 1.5rem 1.25rem !important;
  }
  
  .wrapper {
    margin: 1rem 0.625rem;
    border-radius: 10px;
  }
  
  .contact-wrap h3, .info-wrap h3 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
  }
  
  .info-wrap .icon {
    width: 40px;
    height: 40px;
    margin-right: 1rem;
  }
  
  .info-wrap .fa {
    font-size: 1rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .ftco-section {
    background: linear-gradient(135deg, #1a1f25 0%, #121418 100%);
  }
  
  .contact-wrap {
    background-color: #252836;
  }
  
  .contact-wrap h3 {
    color: #e0e0e0;
  }
  
  .form-control {
    background-color: #1e2130;
    color: #e0e0e0;
  }
  
  .form-control:focus {
    background-color: #2a2e42;
  }
  
  .label {
    color: #b0b0b0;
  }
  
  .contact-alert.success {
    background-color: rgba(13, 110, 66, 0.2);
    color: #4dd494;
  }
  
  .contact-alert.error {
    background-color: rgba(214, 40, 40, 0.2);
    color: #ff6b6b;
  }
}

/* Reduced motion preference support */
@media (prefers-reduced-motion: reduce) {
  .ftco-section::before,
  .ftco-section::after {
    animation: none;
  }
  
  .wrapper:hover {
    transform: none;
  }
  
  .form-control:focus {
    transform: none;
  }
  
  .contact-wrap h3::after,
  .info-wrap h3::after,
  .info-wrap .text a::after {
    transition: none;
    animation: none;
  }
  
  .btn-primary:hover {
    transform: none;
  }
  
  .info-wrap .dbox:hover {
    transform: none;
  }
  
  .info-wrap .dbox:hover .icon {
    transform: none;
  }
  
  .btn-close:hover {
    transform: none;
  }
}