/* Application form (/apply/). Linked only from the apply page.
   Recreates the original Formidable Forms Pro form: 10 steps, segmented progress bar,
   conditional questions, repeatable groups, toggles and upload drop zones.
   Values measured from the live form (14px/600 progress titles, 18px Open Sans labels,
   46px inputs with #ccc borders, #fb2534 buttons, 32px field spacing). */

.apply { background: #fff; padding: 50px 0 80px; }
.apply__inner { width: 86%; max-width: 1302px; margin: 0 auto; }

.ap-form { font-family: "Open Sans", Arial, sans-serif; color: #555; }
.ap-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 12-column layout, as Formidable's frm6 / frm4 / frm12 ---------- */
.ap-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 2%;
  align-items: start;
}
.ap-col-12 { grid-column: span 12; }
.ap-col-6 { grid-column: span 6; }
.ap-col-4 { grid-column: span 4; }

/* ---------- Progress bar ---------- */
.ap-progress { margin: 0 0 34px; }
.ap-progress__steps {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}
.ap-progress__btn {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 26px;
  color: #555;
  text-align: center;
  cursor: default;
}
.ap-progress__btn:not(:disabled) { cursor: pointer; }
.ap-progress__btn:not(:disabled):hover { color: #f71020; text-decoration: underline; }
.ap-progress__step.is-current .ap-progress__btn { color: #f71020; }
.ap-progress__track {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  height: 28px;
  border-radius: 14px;
  overflow: hidden;
  background: #dfdfdf;
}
.ap-progress__seg { background: #dfdfdf; border-right: 1px solid #c8c8c8; transition: background-color .3s; }
.ap-progress__seg:last-child { border-right: 0; }
.ap-progress__seg.is-done { background: #f71020; border-right-color: rgba(255,255,255,.35); }
.ap-progress__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding: 0 3px;
  font-size: 14px;
  font-weight: 600;
  line-height: 23.8px;
  color: #666;
}

/* ---------- Fields ---------- */
.ap-field { margin: 0 0 32px; padding: 0; border: 0; min-width: 0; }
.ap-label {
  display: block;
  padding: 0 0 5px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.32em;
  color: #353535;
}
legend.ap-label { padding: 0 0 5px; }
.ap-req { color: #b94a48; }
.ap-input {
  display: block;
  width: 100%;
  height: 46px;
  padding: 10px;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3em;
  color: #555;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.ap-input:focus { outline: none; border-color: #f71020; box-shadow: 0 0 0 3px rgba(247,16,32,.15); }
.ap-input--half { max-width: 50%; }
.ap-input--narrow { max-width: 400px; }
.ap-input--tiny { max-width: 160px; }
.ap-textarea { height: auto; min-height: 140px; resize: vertical; }
.ap-select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23777' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.ap-desc, .ap-sublabel {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 300;
  line-height: 23.8px;
  color: #666;
}
.ap-sublabel { margin-top: 2px; }

/* radios / checkboxes */
.ap-choices { display: flex; flex-direction: column; gap: 4px; }
.ap-choices--cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 2%; }
.ap-choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 16px;
  line-height: 1.6em;
  color: #555;
  cursor: pointer;
}
.ap-choice input { flex: none; width: 17px; height: 17px; margin: 4px 0 0; accent-color: #f71020; cursor: pointer; }
.ap-choice--consent { font-size: 16px; }

/* No / Yes toggle (Formidable toggle field) */
.ap-toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; color: #555; cursor: pointer; }
.ap-toggle__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ap-toggle__track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #e2e2e2;
  box-shadow: inset 0 0 0 1px #d4d4d4;
  transition: background-color .2s;
}
.ap-toggle__track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .2s;
}
.ap-toggle__input:checked + .ap-toggle__track { background: #f71020; box-shadow: none; }
.ap-toggle__input:checked + .ap-toggle__track::after { transform: translateX(18px); }
.ap-toggle__input:focus-visible + .ap-toggle__track { outline: 3px solid rgba(247,16,32,.35); outline-offset: 2px; }

/* upload drop zone */
.ap-drop { position: relative; width: 180px; }
.ap-drop__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.ap-drop__face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 210px;
  padding: 18px 12px;
  border: 1px dashed #ccc;
  border-radius: 4px;
  text-align: center;
  color: #444;
  transition: border-color .2s, background-color .2s;
}
.ap-drop__icon { color: #555; margin-bottom: 4px; }
.ap-drop__text { font-size: 17px; line-height: 1.4em; }
.ap-drop__max { margin-top: 6px; font-size: 12px; line-height: 1.4em; color: #555; }
.ap-drop:hover .ap-drop__face,
.ap-drop.is-over .ap-drop__face,
.ap-drop__input:focus-visible + .ap-drop__face { border-color: #f71020; background: #fff6f6; }
.ap-drop.has-file { width: auto; max-width: 480px; }
.ap-drop.has-file .ap-drop__face { display: none; }
.ap-drop.has-file .ap-drop__input { display: none; }
.ap-drop__file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-bottom: 4px solid #f71020;
  border-radius: 4px;
  font-size: 15px;
  color: #444;
}
.ap-drop__file[hidden] { display: none; }
.ap-drop__name { overflow-wrap: anywhere; }
.ap-drop__remove {
  flex: none;
  width: 24px; height: 24px;
  border: 1px solid #555;
  border-radius: 50%;
  background: #fff;
  font-size: 16px;
  line-height: 20px;
  color: #333;
  cursor: pointer;
}
.ap-drop__remove:hover { background: #f71020; border-color: #f71020; color: #fff; }

/* ---------- Information blocks ---------- */
.ap-block { margin: 0 0 32px; font-size: 16px; font-weight: 500; line-height: 1.7em; color: #666; }
.ap-block p { margin: 0 0 14px; }
.ap-block p:last-child { margin-bottom: 0; }
.ap-block ul { margin: 0 0 14px; padding-left: 18px; list-style: disc outside; }
.ap-block li { display: list-item; line-height: 26px; }
.ap-block__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3em;
  color: #333;
}
.ap-block--warn {
  padding: 14px 18px;
  border-left: 4px solid #f71020;
  background: #fff4f4;
  color: #533;
}

/* ---------- Sections (Address History, SIA Licence, references…) ---------- */
.ap-section { margin: 4px 0 32px; padding-top: 22px; border-top: 1px solid #ddd; }
.ap-section__title { margin: 0 0 4px; font-size: 24px; font-weight: 500; line-height: 1.3em; color: #353535; }
.ap-section__intro { margin: 0 0 26px; font-size: 15px; font-weight: 300; line-height: 23.8px; color: #666; }
.ap-section__title + .ap-grid,
.ap-section__title + .ap-repeat { margin-top: 26px; }
.ap-repeat__row + .ap-repeat__row { margin-top: 8px; padding-top: 26px; border-top: 1px dashed #ddd; }
.ap-repeat__ctrl { display: flex; gap: 4px; }

/* ---------- Buttons ---------- */
.ap-actions { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 10px; }
.ap-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid #fb2534;
  border-radius: 0;
  background: #fb2534;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  color: #fff;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.ap-btn:hover { background: #d40f1f; border-color: #d40f1f; }
.ap-btn:focus-visible { outline: 3px solid rgba(247,16,32,.35); outline-offset: 2px; }
.ap-btn--ghost { background: #fff; color: #fb2534; }
.ap-btn--ghost:hover { background: #fff4f4; color: #d40f1f; }
.ap-btn--icon { padding: 16px 20px; }
.ap-btn--icon span { font-size: 22px; line-height: 1; }
.ap-btn[hidden] { display: none; }

/* ---------- Errors & status ---------- */
.ap-alert {
  margin: 0 0 26px;
  padding: 14px 18px;
  border: 1px solid #ebccd1;
  background: #f2dede;
  color: #a94442;
  font-size: 16px;
}
.ap-alert[hidden] { display: none; }
.ap-error { display: none; margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: #b94a48; }
.ap-field.has-error .ap-error { display: block; }
.ap-field.has-error .ap-input,
.ap-field.has-error .ap-drop__face { border-color: #b94a48; }
.ap-status { margin: 14px 0 0; font-size: 15px; color: #555; min-height: 1.4em; }

/* conditional + step visibility */
[data-show-if].is-hidden, .ap-step[hidden] { display: none !important; }

/* ---------- Closing band without a form ---------- */
.cta-band--solo { padding-bottom: 90px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .ap-progress__btn { font-size: 12px; }
  .ap-choices--cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .apply { padding: 36px 0 60px; }
  .apply__inner { width: 90%; }
  .ap-col-6, .ap-col-4 { grid-column: span 12; }
  .ap-input--half { max-width: none; }
  /* ten titles don't fit a phone: show only the current one, centred over the bar */
  .ap-progress__steps { display: block; text-align: center; }
  .ap-progress__step { display: none; }
  .ap-progress__step.is-current { display: block; }
  .ap-progress__track { height: 16px; border-radius: 8px; }
  .ap-choices--cols3 { grid-template-columns: minmax(0, 1fr); }
  .ap-label { font-size: 17px; }
  .ap-actions { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-progress__seg, .ap-toggle__track, .ap-toggle__track::after, .ap-btn, .ap-drop__face { transition: none; }
}
