.contact-top-sec {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8rem 2rem 4rem;
  gap: 2rem;
}

.top-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  h4 {
    color: var(--green);
  }
}

.contact-details {
  display: flex;
  flex-direction: row;
  margin: 2rem 0 4rem;
  gap: 2rem;
}

.left-details, .right-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 400px;
  gap: 2rem;
  flex: 1;
  span {
    font-weight: bold;
    color: black;
  }
  a {
    font-weight: bold;
    color: black;
    text-decoration: none;
    transition: all 0.2s ease;
  }
  a:hover {
    text-decoration: underline;
    color: var(--green);
  }
}

.loc-wrapper {
  display: flex;
  flex-direction: row;
  align-items: start;
  gap: 2rem;
}


/* FORMS SECTION */
.main-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-image: url("../images/bg2.png");
  background-position: center;
  background-size: cover;
  padding: 4rem 0;
}

.form-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 4rem 3rem 2rem;
  width: 800px;
  border-radius: 20px;
  background-color: white;
  transition: width 0.4s cubic-bezier(.4,1.4,.6,1), min-height 0.4s cubic-bezier(.4,1.4,.6,1);
  hr {
    color: black;
    opacity: 100%;
    margin: 0;
  }
  textarea {
    max-width: stretch;
  }
}

.form-row {
  display: flex;  
  width: 100%;
  gap: 1.5rem;
  label {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #ccc;
  border-top: 3px solid #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 0;
}

.form-control {
  font-family: 'figtree';
  font-size: 1rem;
  color: #333;
  width: 100%;
  height: 3rem;
  background: none;
  border: none;
  border-bottom: 1px solid black;
  border-radius: 0;
  box-sizing: border-box;
  padding: 0;
}

.form-control::placeholder{
  font-size: 1rem;
  font-weight: 300;
}

.form-control:focus {
  outline: none;
}

::placeholder {
  color: #999999;
  opacity: 1;
  font-weight: 400;
}

.submit-btn {
  display: flex;
  align-self: center;
  font-family: 'figtree';
  font-size: 1rem;
  padding: 0.5rem 2rem;
  width: max-content;
  background: var(--green);
  color: white;
  border-radius: 24px;
  border: none;
  transition: background 0.2s;
  cursor: pointer;
}

.submit-btn:hover, .submit-btn:focus {
  color: var(--green);
  background-color: white;
}

.popup-overlay {
  display: none; 
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.popup-details {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 1rem;
  padding: 1rem 0;
}

.popup-content {
  background: #fff;
  padding: 20px 30px;
  border-radius: 12px;
  max-width: 800px;
  width: 80vw;
  overflow: hidden;
  text-align: center;
  box-shadow: 0px 8px 25px rgba(0,0,0,0.2);
  animation: fadeInScale 0.3s ease-in-out;
}

.popup-close {
  float: right;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  color: #666;
}

.popup-close:hover {
  color: #000;
}

#popupOk {
  margin-top: 15px;
  padding: 8px 16px;
  background: #007BFF;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#popupOk:hover {
  background: #0056b3;
}

.custom-popup {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.custom-popup.success .popup-content { border-left: 6px solid #4CAF50; }
.custom-popup.error .popup-content { border-left: 6px solid var(--orange); }
.custom-popup.info .popup-content { border-left: 6px solid var(--blue); }

.popup-content button {
  margin-top: 15px;
  padding: 8px 16px;
  border: 1px solid transparent;
  background: var(--green);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: figtree;
}

.popup-content button:hover {
  color: var(--green);
  background-color: white;
  border: 1px solid var(--green);
}

@keyframes fadeInScale {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.form-row input.form-control {
  flex: 1 1 0;
}

.form-row:last-child {
  flex-direction: column;
  gap: 0;
}

@media (max-width: 1024px) {

  .contact-top-sec {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 2rem;
  }

/* FORMS SECTION  */
  .main-wrapper {
    padding: 2rem 1rem;
  }

  .contactus-container {
    flex-direction: column;
    gap: 2rem;
    align-items: stretch;
  }

  .form-card {
    padding: 2rem;
    width: 70vw;
  }

  form { 
    gap: 1.5rem; 
  }
}

@media (max-width: 768px) { 
  .contact-top-sec {
    gap: 1rem;
  }
  .contact-details {
    flex-direction: column;
    gap: 1rem;
    margin: 3rem 0;
  }
  .left-details, .right-details {
    gap: 1rem;
  }
  .loc-wrapper {
    flex-direction: column-reverse;
    gap: 1rem;
    iframe {
      width: 85vw;
    }
  }

}

@media (max-width: 546px) {
  .form-row {
    flex-direction: column;
    gap: 1.5rem;
  }
}