body {
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  font-family: 'Merriweather', serif;
  min-height: 100vh;
  overflow-x: hidden;  /* still prevent sideways scroll */
  overflow-y: auto;    /* allow vertical scrolling */
}


.arrow-back {
  display: flex;
  align-items: left;
}

.arrow-back-btn {
  background: none; 
  border: none; 
  cursor: pointer;
}

#back {
  font-size: 2rem;
  font-weight: 800;
  color: #1a3e62;
}

.header {
  background-color: #edbd75;
  text-align: center;
  padding: 20px 16px 55px 16px; 
  color: #1a3e62;
  position: relative;
  z-index: 1;
}

.header h1 {
  margin: 0;
  font-size: 32px;
  font-family: 'Lato', sans-serif;
}

.header p {
  margin: 5px 0 0;
  font-size: 16px; 
  color: #171A1FFF;
}

.form-container {
  font-family: 'Merriweather', serif;
  max-width: 800px;
  margin: -48px auto 32px auto; 
  background-color: #1a3e62;
  padding: 32px; 
  border-radius: 8px; 
  color: #EDBD75FF;
  position: relative;
  z-index: 2;
  padding-bottom: 2.5rem;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  
  /* animate height */
  transition: height 0.4s ease;
}

.form-container h2 {
  font-size: 24px;
  border-bottom: 2px solid #f1d9a1;
  padding-bottom: 10px;
  text-align: center;
}

.form-row {
  display: flex;
  gap: 23px;
  padding-bottom: 15px;
  margin: 10px 0;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

label {
  margin-bottom: 5px;
  text-align: left;
}

input, select {
  padding: 8px;
  border-radius: 5px;
  border: none;
}

.done-container {
  text-align: center;
  margin-top: 20px;
}

.done-container button {
  background-color: #4d5eff;
  color: white;
  font-size: 19.2px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#applicationForm {
  overflow: hidden;
}

.step {
  position: relative; /* stack naturally */
  opacity: 0;
  transform: translateY(-100%); /* start above */
  transition: transform 0.5s ease, opacity 0.5s ease;
  display: none; /* hide by default */
}

.step.active {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

/* Remove special transform for #step1, let JS handle initial animation */
#step1 {
  opacity: 1;
  transform: translateY(0);
}

.step.prev {
  transform: translateX(-100%);
  opacity: 0;
}

.stepper-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 5vh;
  margin-bottom: 4vh;
  gap: 3vw;
}

.stepper-nav button {
  width: auto;
  padding: 10px 22px;
  border: none;
  border-radius: 20px;
  background: #f4f6fc;   /* light gold */
  color: #0c2c4a;        /* dark blue text */
  font-size: 16px;
  font-family: 'Merriweather', serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.stepper-nav button:hover {
  background: #0c2c4a;   /* dark blue */
  color: #edbd75;        /* gold text */
}

.stepper-nav .active {
  background: #0c2c4a;   /* dark blue */
  color: #edbd75;        /* gold text */
  font-weight: bold;
  transform: scale(1.2); /* slightly larger */
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.form-error {
  background-color: #ffe0e0;
  color: #900;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #f00;
  border-radius: 5px;
  text-align: center;
  z-index: 1001; /* Ensure it appears above other elements */
}

/* highlight invalid */
input.invalid, select.invalid, textarea.invalid {
  border: 2px solid red;
  background-color: #ffecec;
}

/* notification */
.form-notification {
  background: #ffe4b3;
  border: 1px solid #ff9800;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 6px;
  color: #333;
  font-size: 14px;
  animation: fadeIn 0.3s ease;
  text-align: center;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-navigation {
  position: fixed;      /* fix it to the viewport */
  bottom: 30px;         /* distance from bottom of page */
  left: 50%;            /* center horizontally */
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 5vw;
  z-index: 1000;        /* stay above form content */
}

.next, .back, .done {
  font-family: "Merriweather", serif;
  background-color: #4d5eff; /* default blue like accept */
  color: white;
  font-size: 20px;          /* smaller text */
  padding: 6px 14px;        /* smaller padding */
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.next:hover,
.back:hover,
.done:hover {
  background-color: #3b45d8; /* darker shade on hover */
  transform: scale(1.05);
}

/* Differentiate Back */
.back {
  background-color: #E25256; /* red like decline */
}

.back:hover {
  background-color: #c54144;
}

/* Differentiate Done */
.done {
  background-color: #16a34a; /* your dark header/nav blue */
}

.done:hover {
  background-color: #142c46; /* darker shade */
}

#payment_date.locked {
  pointer-events: none;
  background-color: #f0f0f0 !important;
  color: #555;
  opacity: 1; /* prevent it from looking faded */
  border: 1px solid #ccc;
  cursor: not-allowed;
}

.fullpage-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
}

.fullpage-modal-content {
  position: relative;
  width: 85%; 
  height: 85%;
  margin: auto;
  top: 5%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.fullpage-modal-content iframe {
  width: 100%; height: 100%;
  border: none;
}

.close-btn {
  position: absolute;
  top: 10px; right: 20px;
  font-size: 30px;
  cursor: pointer;
  color: #333;
}

.view-unit-btn {
  background-color: #edbd75;
  border: none;
  border-radius: 50%;       
  padding: 1.5px;              
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 8px;         
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25); 
  vertical-align: middle;
  animation: pulseHighlight 2s infinite; 
}

.view-unit-btn i {
  color: #1a3e62;
  font-size: 1rem;           
  transition: transform 0.3s ease, color 0.3s ease;
}

.view-unit-btn:hover {
  background-color: #1a3e62;
  transform: scale(1.15); 
}

.view-unit-btn:hover i {
  color: #edbd75;
  transform: scale(1.2);
}

/* subtle pulsing effect */
@keyframes pulseHighlight {
  0%   { box-shadow: 0 0 0 0 rgba(237, 189, 117, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(237, 189, 117, 0); }
  100% { box-shadow: 0 0 0 0 rgba(237, 189, 117, 0); }
}


@media (max-width: 768px) {
  * {
    max-width: 100%;
    box-sizing: border-box;
  }

  .header h1 {
    font-size: 40px;
  }

  .form-container {
    width: 100%;
    margin: -32px 0 24px 0;
  }

  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .stepper-nav {
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    justify-content: center;
  }

  /* FIX: Center the modal with space on all sides and allow full scroll */
  .fullpage-modal-content {
    width: 95%;
    height: auto;                /* let it adjust to content height */
    max-height: 90vh;            /* still limit height to viewport */
    margin: 5vh auto;            /* centers with space around */
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .fullpage-modal-content iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
  }
}

#unitDetails {
    display: none;          /* use flex layout immediately */
    flex-direction: row;    /* row layout */
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
}



#unitDetails .unit-info {
    flex: 1;                  /* left column takes available space */
    min-width: 200px;
}

#unitImages {
    display: flex;
    gap: 10px;
    flex: 1;                  /* right column takes available space */
    flex-wrap: wrap;
    min-width: 200px;
    justify-content: flex-start;
}

#unitImages img {
    width: 120px;
    height: 120px;
    object-fit: cover;        /* portrait or landscape scaling */
    border-radius: 5px;
    background-color: #f0f0f0;
}

/* Optional: make portrait images fit better */
#unitImages img.portrait {
    object-fit: contain;     /* shows full image without cropping */
    background-color: #f0f0f0;
}


/* Carousel Container */
.carousel-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 500px; /* matches your unitImages max width */
  margin: 20px auto; /* spacing consistent with other sections */
  border-radius: 8px; /* matches form-container and unitImages */
  box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* subtle shadow like your buttons */
}

/* Track holding slides */
.carousel-track {
  display: flex;
  transition: transform 0.3s ease-in-out;
}

/* Each slide */
.carousel-slide {
  min-width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  overflow: hidden;
}

.carousel-slide img {
  display: block;
  width: 100%;
  height: 250px; /* adjust as needed */
  object-fit: cover; /* consistent with #unitImages */
  border-radius: 8px;
}

/* Navigation Buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  background-color: rgba(26, 62, 98, 0.8); /* dark blue semi-transparent like your header text */
  color: #edbd75; /* gold highlight like your form accents */
  border: none;
  font-size: 24px;
  padding: 8px 12px;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn:hover {
  background-color: #1a3e62; /* dark blue hover like your .view-unit-btn */
  transform: scale(1.15);
}

.carousel-btn.prev {
  left: 10px;
}

.carousel-btn.next {
  right: 10px;
}



/* Laptop\1200px - 1500px */
@media screen and (min-width: 1200px) and (max-width: 1500px) {
  .header h1 {
    font-size: 36px;
  }

  .form-container {
    max-width: 900px;
    padding: 40px;
  }

  .form-container h2 {
    font-size: 28px;
  }

  .form-row {
    gap: 32px;
  }

  .stepper-nav button {
    font-size: 18px;
    padding: 12px 28px;
  }

  .next, .back, .done {
    font-size: 22px;
    padding: 8px 18px;
  }

  .fullpage-modal-content {
    width: 80%;
    height: 80%;
  }
}

/* Unit selection dropdown styling */
select[name="unit_no"] option:disabled {
  color: #999;
  background-color: #f5f5f5;
  font-style: italic;
}

select[name="unit_no"] option[disabled]:not(:first-child) {
  color: #888;
  background-color: #ffe6e6;
}
