html,
body {
  height: 100%;
}

/* * {
  outline: 1px solid red;
} */

body {
  position: relative;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  background-color: #f0f0f0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url(assets/loan-forms.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(10px);
  transform: scale(1.1);
  /* prevents blurred edges from showing gaps */
  z-index: -1;
}

main {
  flex: 1;
  padding-top: 80px;
  /* matches header height */
}

#form {
  padding: 50px 2%;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  row-gap: 70px;
}

.hero__content {
  background: linear-gradient(to right, white, teal);
  border: 1px solid #3a3a3a;
  padding: 80px;
  /* border-radius: 10px; */
  /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); */
  text-align: center;
  width: 100%;
}

.hero__content h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  color: #00423f;
  text-transform: capitalize;
}

.hero__content p {
  font-size: 1.25rem;
  margin-bottom: 30px;
}

.forms__wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 50px;
  max-width: 100%;
}

@media (max-width: 900px) {
  .forms__wrapper {
    grid-template-columns: 1fr;
  }
}

.form__container {
  max-width: 100%;
  height: fit-content;
  margin: 0;
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  /* align-items: center; */
  justify-content: center;
  gap: 20px;
  width: 100%;
  /* display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 50px; */
}


.file-upload {
  position: relative;
  width: 100%;
  max-width: 500px;
}

.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload__zone {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  background-color: #fafafa;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.passport-photo h2,
.passport-photo label {
  text-align: center;
}

.file-upload__zone svg {
  margin-bottom: 6px;
}

.file-upload__zone p {
  font-size: 0.95em;
  color: #333;
}

.file-upload__hint {
  font-size: 0.8em;
  color: #999;
}

.file-upload__preview {
  display: none;
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ddd;
  margin-bottom: 6px;
}

.file-upload__preview.file-upload__preview--visible {
  display: block;
}

.file-upload__preview--visible+.file-upload__icon {
  display: none;
  /* hide the upload icon once a preview image is showing */
}


.file-upload__list {
  list-style: none;
  margin-top: 12px;
  width: 100%;
  text-align: left;
}

.file-upload__list li {
  font-size: 0.85em;
  color: #1a1a1a;
  background: #eef7f6;
  padding: 6px 10px;
  border-radius: 6px;
  margin-top: 6px;
}

.file-upload.dragover .file-upload__zone,
.file-upload input:focus+.file-upload__zone {
  border-color: #01A9A1;
  background-color: #f0faf9;
}

.file-upload__list {
  list-style: none;
  margin-top: 12px;
  width: 100%;
  text-align: left;
}

.file-upload__list li {
  font-size: 0.85em;
  color: #1a1a1a;
  background: #eef7f6;
  padding: 6px 10px;
  border-radius: 6px;
  margin-top: 6px;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #00423f;
  text-transform: capitalize;
}

.form-grid span,
.form-group label span {
  color: red;
  font-size: 0.8rem;
  margin-left: 2px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.full-width {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  /* margin-bottom: 15px; */
}

.form-group ::placeholder {
  color: #ccc;
  font-size: 0.8rem;
}

label {
  margin-bottom: 5px;
  font-weight: bold;
  color: #00423f;
  font-size: 0.9rem;
}

input,
textarea,
select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #01A9A1;
  box-shadow: 0 0 5px rgba(1, 169, 161, 0.5);

}

select {
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 45px;
  /* room for the icon so text doesn't run under it */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='1.0' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='8 10 12 14 16 10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 26px;
  cursor: pointer;

}

.documents {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 10px;
  /* gap: 4px; */
  background-color: #ffffff;
  width: 1000px;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.documents h2 {
  font-size: 1.5rem;
  margin-bottom: 2px;
  color: #00423f;
  text-transform: capitalize;
}

.documents h3 {
  font-size: 0.7rem;
  font-style: italic;
  margin-bottom: 50px;
}

.documents form,
.applicants__documents,
.guarantor__documents {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.documents input[type="file"] {
  /* background-color: #01A9A1; */
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.declaration {
  display: flex;
  flex-direction: column;
  justify-content: left;
  align-items: flex-start;
  width: 100%;
  max-width: 800px;
  background-color: #e0e0e0;
  padding: 20px;
  border-radius: 8px;
  margin-top: 30px;
}

.form__submit {
  background-color: #01A9A1;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
  margin-left: 30px;
  margin-top: 30px;
}

.form__submit:hover {
  background-color: #00423f;
}

.declaration h2 {
  align-self: center;
}

.declaration label {
  font-size: 1.05rem;
  color: #000000;
  /* display: flex; */
  /* cursor: pointer; */
  line-height: 1.5;
  font-weight: 500;
  /* width: 500px; */
  /* flex-wrap: wrap; */
}

.declaration div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.declaration input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  /* nudges checkbox down slightly to align with first line of text */
  flex-shrink: 0;
  /* prevents checkbox from getting squished when text wraps */
  cursor: pointer;
}

.loan-calculator {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
  padding: 20px 10px;
}

.loan-calculator__display h2 {
  font-size: 2.5em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.loan-calculator__display p {
  color: #888;
  font-size: 1.1em;
  margin-bottom: 25px;
}

#loan-slider {
  width: 100%;
  height: 6px;
  border-radius: 10px;
  appearance: none;
  background: #e0e0e0;
  outline: none;
  cursor: pointer;
}

#loan-slider::-webkit-slider-thumb {
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #01A9A1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

#loan-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #01A9A1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.loan-calculator__range-labels {
  display: flex;
  justify-content: space-between;
  color: #888;
  font-size: 0.95em;
  margin-top: 10px;
  margin-bottom: 30px;
}

.loan-calculator__range-labels span,
.loan-calculator__breakdown span {
  color: #000;
}

.loan-calculator__breakdown {
  text-align: left;
}

.loan-calculator__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 1.05em;
}

.loan-calculator__row .value {
  margin-left: auto;
  color: #555;
  min-width: 80px;
  /* reserves space for up to 5-6 digits + ₵ symbol */
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot--gray {
  background-color: #999;
}

.dot--teal {
  background-color: #01A9A1;
}


/* No red anywhere until a submit attempt has failed */
.submitted-attempted input:required:invalid,
.submitted-attempted select:required:invalid {
  border-color: #e53935;
}

.submitted-attempted input:required:invalid:focus,
.submitted-attempted select:required:invalid:focus {
  border-color: #e53935;
  box-shadow: 0 0 5px rgba(229, 57, 53, 0.4);
}

.submitted-attempted .file-upload input:invalid+.file-upload__zone {
  border-color: #e53935;
}

/* Turn a field green/teal again once it's fixed, without needing another submit click */
.submitted-attempted input:required:valid,
.submitted-attempted select:required:valid {
  border-color: #01A9A1;
}

.submitted-attempted #declaration:invalid+label {
  color: #e53935;
}

.file-upload input:valid+.file-upload__zone {
  border-color: #01A9A1;
}

/* Clear red once a file is actually selected */
/* .file-upload input:valid+.file-upload__zone {
  border-color: #ccc;
} */


@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero__content {
    padding: 40px 20px;
  }

  .hero__content h1 {
    font-size: 1.8rem;
  }

  .hero__content p {
    font-size: 1rem;
  }
}