/* ===== Accordion Styling ===== */
#applications {
  margin: 2rem auto;
  padding: 0 2rem;
  text-align: center;
}

#applications h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #002410;
  margin-bottom: 2rem;
  text-align: left;
  display: flex;
  margin-left: 2rem;
  align-items: center;
}

#applications h2::after {
  content: "";
  flex-grow: 1;
  height: 2px;
  background-color: #002410;
  margin-left: 1rem;
  border-radius: 2px;
}

/* Centered + Reduced Width */
#applications .accordion {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 950px; /* enough width for image + form on one line */
  margin: 0 auto;
  width: 100%;
}

#applications .accordion-item {
  margin-bottom: 1rem;
  overflow: hidden;
  background-color: #fff;
  width: 100%;
}

#applications .accordion-header {
  width: 100%;
  text-align: left;
  padding: 1rem 1.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  background: linear-gradient(90deg, #1f633c ,#2E8B57);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
}

#applications .accordion-header:hover {
  background-color: #1b5e3c;
}

#applications .accordion-icon {
  transition: transform 0.3s ease;
  font-size: 1.5rem;
}

#applications .accordion-item.active .accordion-icon {
  transform: rotate(45deg);
}

#applications .accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 1.5rem;
  background-color: #ffffff;
}

#applications .accordion-item.active .accordion-content {
  max-height: 1000px;
  padding: 1.5rem;
}

/* ===== Form Layout (Side by Side) ===== */
#applications .form-wrapper {
  display: flex;
  flex-direction: row;       /* force image + form side by side */
  gap: 2.5rem;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: nowrap;         /* prevents image from jumping to top */
}

/* Image column */
#applications .form-image {
  flex: 0 0 380px; /* fixed width */
}

#applications .form-image img {
  width: 100%;
  object-fit: cover;
}

/* Form column */
#applications .form-fields {
  flex: 0 0 380px; /* fixed width */
  text-align: left;
}

/* Form inputs */
#applications input,
#applications textarea,
#applications select {
  width: 90%;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid #ccead0;
  font-size: 1rem;
  box-sizing: border-box;
}

#applications .file-label {
  font-size: 0.95rem;
  color: #002410;
  margin-bottom: 0.3rem;
  display: block;
}


#applications textarea {
  resize: none; /* Prevents resizing */
}


/* ===== Submit Button ===== */
#applications .hover-button {
  --baseColor: #2E8B57;
  --fillerColor: #ffffff;
  --baseTextColor: #ffffff;
  --hoverTextColor: #2E8B57;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: none;
  text-decoration: none;

  font-weight: 700;
  font-size: 1rem;
  padding: 0.8rem 2rem;
  background: var(--baseColor);
  color: var(--baseTextColor);
  cursor: pointer;
}

#applications .hover-button .button__text {
  position: relative;
  z-index: 2;
}

#applications .hover-button .button__filler {
  background: var(--fillerColor);
  position: absolute;
  width: 150%;
  height: 200%;
  border-radius: 50%;
  top: -50%;
  left: -25%;
  transform: translate3d(0, 75%, 0);
  z-index: 1;
}

/* Hover Animation States */
#applications .hover-button.hover-in .button__text {
  animation: textHoverIn 0.3s forwards;
}
#applications .hover-button.hover-in .button__filler {
  animation: fillerHoverIn 0.3s forwards;
}
#applications .hover-button.hover-out .button__text {
  animation: textHoverOut 0.3s forwards;
}
#applications .hover-button.hover-out .button__filler {
  animation: fillerHoverOut 0.3s forwards;
}


/* ===== Scroll Ease-In for Accordion ===== */
.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible,
.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ===== Custom File Upload Button ===== */
#applications .file-upload-wrapper {
  width: 90%;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  position: relative;
}

/* Hide actual file input */
#applications .file-upload-wrapper input[type="file"] {
  display: none;
}

/* Styled Choose File button */
#applications .custom-file-btn {
  background: #2E8B57;
  color: #ffffff;
  padding: 0.7rem 1.5rem;
  /*order-radius: 5px;*/
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: 0.3s ease;
  border: 1px solid #2E8B57;
}

#applications .custom-file-btn:hover {
  background: #ffffff;
  color: #2E8B57;
}

/* Display selected file name */
#applications .file-selected {
  font-size: 0.95rem;
  color: #002410;
  opacity: 0.8;
}

/* ==========================================================
      MOBILE — ACCORDION SECTION (max-width: 768px)
========================================================== */
@media (max-width: 768px) {

  /* Section padding */
  #applications {
    padding: 0 1rem;
  }

  /* Heading adjustments */
  #applications h2 {
    font-size: 2rem;
    margin-left: 0.5rem;
  }

  /* Accordion container */
  #applications .accordion {
    max-width: 100%;
    width: 100%;
  }

  /* Headers */
  #applications .accordion-header {
    padding: 1rem;
    font-size: 1.1rem;
  }

  /* CONTENT AREA */
  #applications .accordion-content {
    padding: 1rem;
  }

  /* ============================
       STACK IMAGE + FORM
     ============================ */
  #applications .form-wrapper {
    flex-direction: column;   /* stack vertically */
    gap: 1.5rem;
    align-items: center;
  }

  /* Image */
  #applications .form-image {
    flex: none;
    width: 100%;
    max-width: 100%;
  }

  #applications .form-image img {
    width: 100%;
    height: auto;
  }

  /* Form fields */
  #applications .form-fields {
    flex: none;
    width: 100%;
    max-width: 100%;
    text-align: left;
  }

  #applications input,
  #applications textarea,
  #applications select {
    width: 100%;
    font-size: 1rem;
  }

  /* Button full-width option */
  #applications .hover-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
  }
}

/* ==========================================================
      SMALL MOBILE — max-width: 480px
========================================================== */
@media (max-width: 480px) {

  #applications h2 {
    font-size: 1.6rem;
  }

  #applications .accordion-header {
    font-size: 1rem;
    padding: 0.9rem;
  }

  #applications .form-wrapper {
    gap: 1rem;
  }

  #applications input,
  #applications textarea,
  #applications select {
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
  }

  #applications .hover-button {
    padding: 0.9rem;
    font-size: 1rem;
  }
}
