/* Contact Form Basic Styles
========================================================*/
#contact-form {
  position: relative;
}
#contact-form label {
  position: relative;
  background: none;
  letter-spacing: normal;
  display: block;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  margin-bottom: 1.0625rem;
  width: 100%;
}
#contact-form label:first-child {
  margin-left: 0;
}
#contact-form fieldset {
  border: none;
}
/* Contact Form Input
========================================================*/
#contact-form input[type='text'],
#contact-form input[type='email']
{
  background: none;
  border-radius: 0;
  line-height: 1.125rem;
  font-size: 0.8125rem;
  font-weight: 300;
  font-family: 'Ubuntu', sans-serif;
  padding: 1.1875rem 1.0625rem 0.4375rem 1.25rem;
  color: #504f56;
  outline: none;
  height: 3.3125rem;
  border: 1px solid #e4e3e3;
  width: 100%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  -webkit-appearance: none;
}
/* Contact Form Placeholder Styles
========================================================*/
#contact-form ._placeholder {
  width: 100% !important;
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  line-height: 1.125rem;
  font-size: 0.8125rem;
  font-weight: 300;
  font-family: 'Ubuntu', sans-serif;
  padding: 1.1875rem 1.0625rem 0.4375rem 1.25rem;
  color: #504f56;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  border-radius: 0;
  cursor: text;
}
#contact-form ._placeholder.focused {
  opacity: 0.4;
  filter: alpha(opacity=40);
}
#contact-form ._placeholder.hidden {
  display: none;
}
#contact-form .file ._placeholder {
  display: none;
}
/* Contact Form Buttons
========================================================*/
#contact-form .btn-wrapper {
  text-align: right;
  margin-top: 1.25rem;
}
#contact-form .btn {
  display: inline-block;
  padding: 10px 25px;
  background-color: #5bbee2;
  color: #ffffff;
  font-family: 'Ubuntu', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  border-radius: 4px;
  text-decoration: none;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}
#contact-form .btn:hover {
  background-color: #33323a;
  color: #ffffff;
  text-decoration: none;
}
/* Contact Form Textarea
========================================================*/
#contact-form textarea {
  width: 100%;
  margin-top: 0;
  background: none;
  border-radius: 0;
  line-height: 1.125rem;
  font-size: 0.8125rem;
  font-weight: 300;
  font-family: 'Ubuntu', sans-serif;
  padding: 1.1875rem 1.0625rem 0.4375rem 1.25rem;
  color: #504f56;
  outline: none;
  border: 1px solid #e4e3e3;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  resize: none;
  height: 12.0625rem !important;
  -webkit-appearance: none;
  overflow: auto;
}
/* Contact Form Error messages
========================================================*/
/* Hide the old, unused error spans */
#contact-form .empty-message,
#contact-form .error-message {
    display: none !important;
}

/* Style for the new validation error label generated by jQuery Validate */
#contact-form label.error {
    color: red;
    font-size: 0.8rem;
    display: block;
    margin-top: 5px; /* Add some space below the input */
    position: static; /* Prevent absolute positioning issues */
    background: none;
    text-align: left;
    font-weight: normal; /* Override general label styles if any */
    letter-spacing: normal;
    margin-bottom: 0; /* Don't add extra bottom margin */
}

/* Add a red border to invalid fields for better feedback */
#contact-form input.error,
#contact-form textarea.error {
    border-color: red !important;
}
/* Contact Form Processing Box
========================================================*/
#contact-form .contact-form-loader {
  position: absolute;
  z-index: -1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(247, 247, 247, 0.48) url('../images/form-loader.gif');
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: 5%;
  opacity: 0;
}
#contact-form.processing .contact-form-loader {
  opacity: .7;
  z-index: 99;
  -webkit-transition: all 0.3s ease-in;
  transition: all 0.3s ease-in;
}
/* Contact Form Modal
========================================================*/
.modal-open {
  overflow: hidden;
}

#contact-form .modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  overflow-y: auto;
  padding: 2rem 1rem;
  font-family: 'Ubuntu', sans-serif;
  letter-spacing: normal;
  -webkit-animation: modal-fade-in 0.4s;
  animation: modal-fade-in 0.4s;
  background: rgba(51, 50, 58, 0.9); /* Themed dark background */
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#contact-form .modal-content {
  position: relative;
  background-color: #ffffff;
  border-top: 4px solid #5bbee2; /* Themed blue border */
  border-left: 1px solid #e4e3e3;
  border-right: 1px solid #e4e3e3;
  border-bottom: 1px solid #e4e3e3;
  border-radius: 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  background-clip: padding-box;
  outline: none;
  margin: 0 auto;
  padding: 2.5rem;
  text-align: center;
  -webkit-animation: modal-slide-in 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation: modal-slide-in 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  
  /* Desktop default width */
  width: 40vw;
}

/* Modal Body Styling */
#contact-form .modal-body {
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-top: 1px solid #e4e3e3; /* Themed divider */
    margin-top: 1.5rem;
}

#contact-form .modal-content h4 {
  color: #33323a;
  font-size: 2rem;
  font-weight: 400;
  margin-top: 0;
  margin-bottom: 1.5rem; /* Space before body */
}

#contact-form .modal-content p {
  color: #504f56;
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Updated Close Button 'X' Styles */
#contact-form .close {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e4e3e3;
  color: #88868c;
  font-size: 2rem;
  font-weight: 400;
  line-height: 38px; /* Vertically center 'x' */
  text-align: center;
  text-decoration: none;
  text-shadow: none;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#contact-form .close:hover {
  background: #5bbee2; /* Themed primary color */
  color: #ffffff;
  transform: scale(1.1) rotate(90deg); /* Dynamic hover effect */
  border-color: #5bbee2;
}

@keyframes modal-slide-in {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Tablet Styles */
@media (max-width: 1024px) {
  #contact-form .modal-content {
    width: 60vw;
  }
}

/* Mobile Styles */
@media (max-width: 767px) {
  #contact-form .modal-content {
    width: 80vw;
    padding: 2rem 1.5rem;
  }

  #contact-form .modal-content h4 {
    font-size: 1.75rem;
  }

  #contact-form .modal-content p {
    font-size: 1rem;
  }

  #contact-form .close {
    top: -15px;
    right: -15px;
    width: 35px;
    height: 35px;
    line-height: 33px;
    font-size: 1.75rem;
  }
}