/* Reference-led four-step application form. Loaded only on the application page. */
.apply-hero {
  position: relative;
  min-height: 124px;
  height: clamp(124px, 15vw, 168px);
  overflow: hidden;
  background: var(--kcid-charcoal);
  color: var(--kcid-paper);
}

.apply-hero__image,
.apply-hero__veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.apply-hero__image {
  object-fit: cover;
  object-position: center 42%;
}

.apply-hero__veil {
  background: linear-gradient(90deg, rgba(5, 8, 9, 0.93) 0%, rgba(5, 8, 9, 0.75) 43%, rgba(5, 8, 9, 0.18) 100%);
}

.apply-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: inherit;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 clamp(1rem, 4.5vw, 3.5rem);
}

.apply-hero__content h1 {
  margin: 0;
  color: #fff;
  font-family: Poppins, "DM Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.apply-hero__content h1 span {
  color: var(--kcid-yellow);
}

.apply-hero__content > p {
  margin: 0.3rem 0 0;
  color: #fff;
  font-size: clamp(0.78rem, 1.35vw, 0.95rem);
  font-weight: 500;
  line-height: 1.35;
}

.apply-section {
  position: relative;
  z-index: 2;
  padding: 0 clamp(1rem, 7vw, 6rem) 3rem;
  background: #f4f9fc;
}

.apply-card {
  width: min(100%, 1120px);
  margin: -2.2rem auto 0;
  padding: clamp(1rem, 2.5vw, 2rem) clamp(1rem, 5.2vw, 3rem) 1.1rem;
  border: 1px solid rgba(217, 226, 234, 0.82);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 36px rgba(17, 37, 58, 0.1);
}

/* Keep the floating chat control from covering form fields and its actions. */
body.kcid-application-page .chaty-widget {
  display: none !important;
}

.application-form [hidden] {
  display: none !important;
}

.application-form {
  margin-top: 0;
  scroll-margin-top: 5.75rem;
}

.application-progress {
  position: relative;
  margin: 0 0 1.2rem;
  padding: 0;
}

.application-progress::before,
.application-progress::after {
  position: absolute;
  top: 14px;
  left: 12.5%;
  height: 1px;
  content: "";
}

.application-progress::before {
  right: 12.5%;
  background: #d9e0e8;
}

.application-progress::after {
  width: var(--application-progress, 0%);
  background: #209bea;
  transition: width 180ms ease;
}

.application-steps {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.application-step {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 0.38rem;
  color: #75839a;
  text-align: center;
}

.application-step__number {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border-radius: 50%;
  background: #f0f3f8;
  color: #637189;
  font-size: 0.78rem;
  font-weight: 700;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.application-step.is-active .application-step__number,
.application-step.is-complete .application-step__number {
  background: #209bea;
  color: #fff;
}

.application-step.is-active .application-step__number {
  box-shadow: 0 0 0 4px rgba(32, 155, 234, 0.12);
}

.application-step.is-active .application-step__label,
.application-step.is-complete .application-step__label {
  color: #111827;
  font-weight: 700;
}

.application-step__label {
  max-width: 100%;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25;
}

.application-panel {
  min-width: 0;
}

.application-panel__heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.5rem;
}

.application-section__icon {
  display: inline-grid;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 2.45rem;
  place-items: center;
  border-radius: 50%;
}

.application-section__icon svg {
  width: 1.22rem;
  height: 1.22rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.application-section__icon--blue {
  background: #e2f4ff;
  color: #0797ec;
}

.application-section__icon--pink {
  background: #ffe3f1;
  color: #ec1882;
}

.application-section__icon--yellow {
  background: #fff1bf;
  color: #dca900;
}

body:not(.home) main > section.apply-section .application-panel__heading h2 {
  margin: 0;
  color: #111827;
  font-family: Poppins, "DM Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

body:not(.home) main > section.apply-section .application-panel__heading p {
  margin: 0.12rem 0 0;
  color: #778399;
  font-size: 0.72rem;
  line-height: 1.35;
}

.application-grid {
  display: grid;
  min-width: 0;
  gap: 0.8rem 1rem;
}

.application-grid + .application-grid {
  margin-top: 0.45rem;
}

.application-grid--one {
  grid-template-columns: minmax(0, 1fr);
}

.application-grid--split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.application-grid--personal {
  grid-template-columns: minmax(0, 0.76fr) minmax(0, 1.55fr);
}

.application-grid--contact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.application-grid--course {
  grid-template-columns: minmax(0, 1.5fr) minmax(175px, 0.8fr);
}

.application-field,
.application-gender {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: #192235;
  font-size: 0.66rem;
  font-weight: 700;
}

.application-field > span:first-child,
.application-gender > legend {
  display: block;
  width: 100%;
  margin: 0 0 0.26rem;
  padding: 0;
  color: #172033;
  font: inherit;
  line-height: 1.3;
}

.application-field b,
.application-gender b {
  color: #ec1882;
  font-weight: 800;
}

.application-field > input,
.application-field > select,
.application-input-wrap {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  border: 1px solid #d8e0e8;
  border-radius: 5px;
  background: #fff;
  color: #28354c;
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
}

.application-field > input,
.application-field > select {
  min-height: 28px;
  padding: 0.25rem 0.65rem;
}

.application-input-wrap {
  gap: 0.55rem;
  padding: 0 0.65rem;
}

/* The legacy application styles also target every direct span inside a field.
 * Keep the icon-and-input wrapper horizontal and remove its label spacing. */
.application-field > span.application-input-wrap:not([aria-hidden="true"]) {
  display: flex;
  min-height: 32px;
  margin: 0;
}

.application-input-wrap input {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #28354c;
  font: inherit;
  line-height: 1.2;
  padding: 0;
}

.application-input-wrap input[type="date"] {
  display: block;
  height: 30px;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 699px) {
  .application-form {
    scroll-margin-top: 9.5rem;
  }

  .application-field > input,
  .application-field > select,
  .application-field > span.application-input-wrap:not([aria-hidden="true"]) {
    min-height: 42px;
  }

  .application-field > input,
  .application-field > select {
    padding: 0.55rem 0.7rem;
  }
}

.application-input-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
}

.application-field input::placeholder {
  color: #8391a7;
  opacity: 1;
}

.application-input-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: #445777;
}

.application-field .application-input-wrap .application-input-icon {
  color: #445777;
}

.application-input-icon svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.application-field > input:focus,
.application-field > select:focus,
.application-input-wrap:focus-within {
  border-color: #49aaf0;
  box-shadow: 0 0 0 3px rgba(73, 170, 240, 0.15);
  outline: 0;
}

.gender-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.gender-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  border: 1px solid #d8e0e8;
  border-radius: 5px;
  background: #fff;
  color: #28354c;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: none;
}

.gender-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.gender-option:has(input:checked) {
  border-color: #49aaf0;
  background: #eaf7ff;
  box-shadow: inset 0 0 0 1px #49aaf0;
  color: #1a5d89;
}

.gender-option:focus-within {
  outline: 3px solid rgba(73, 170, 240, 0.28);
  outline-offset: 2px;
}

.gender-option__symbol {
  color: #0797ec;
  font-size: 1rem;
  line-height: 1;
}

.gender-option:nth-child(2) .gender-option__symbol {
  color: #ec1882;
}

.gender-option__symbol--other svg {
  display: block;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.application-upload-field > span:first-child {
  margin-bottom: 0.28rem;
}

.application-upload {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.55rem 0.8rem;
  border: 1px dashed #aebfd2;
  border-radius: 5px;
  background: #fff;
  color: #172033;
  cursor: pointer;
  text-align: center;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.application-upload:hover,
.application-upload.is-dragging {
  border-color: #0797ec;
  background: #f5fbff;
}

.application-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.application-upload:focus-within {
  outline: 3px solid rgba(73, 170, 240, 0.25);
  outline-offset: 3px;
}

.application-upload__icon {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: #0797ec;
  font-size: inherit;
  font-weight: 400;
  line-height: normal;
}

.application-upload__icon svg {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.application-upload__copy strong,
.application-upload__copy small,
.application-upload__files {
  display: block;
}

.application-upload__copy strong {
  font-size: 0.69rem;
  font-weight: 800;
}

.application-upload__copy small {
  margin-top: 0.12rem;
  color: #78869c;
  font-size: 0.61rem;
  font-weight: 500;
}

.application-upload__files {
  margin-top: 0.28rem;
  color: #315e89;
  font-size: 0.64rem;
  font-weight: 700;
}

.application-file-result {
  display: block;
  overflow-wrap: anywhere;
}

.application-file-result[data-state="match"] {
  color: #18764a;
}

.application-file-result[data-state="review"],
.application-upload__files[data-state="error"] {
  color: #a64235;
}

.application-upload__privacy {
  margin: 0.4rem 0 0;
  color: #748198;
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1.4;
}

.application-ocr-results:empty {
  display: none;
}

.application-ocr-results {
  margin-top: 0.38rem;
  color: #46556d;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.45;
}

.application-ocr-results[data-state="match"] {
  color: #18764a;
}

.application-ocr-results[data-state="review"] {
  color: #996c00;
}

.application-ocr-results[data-state="error"] {
  color: #b42342;
}

.application-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.application-button {
  display: inline-flex;
  min-width: 8.5rem;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.application-button svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.application-button--next {
  margin-left: auto;
  background: #3da6ef;
  color: #fff;
}

.application-button--next:hover {
  background: #208fd9;
  transform: translateY(-1px);
}

.application-button--previous {
  border-color: #8dcdf8;
  background: #fff;
  color: #1b273d;
}

.application-button--previous:hover {
  background: #f3faff;
}

.application-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.application-status {
  margin: 0.55rem 0 0;
  color: #44546c;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.45;
}

.application-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.application-review-card {
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e4eaf0;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(26, 49, 74, 0.035);
}

.application-review-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.42rem;
}

body:not(.home) main > section.apply-section .application-review-card h3 {
  margin: 0;
  color: #172033;
  font-family: Poppins, "DM Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.application-edit {
  padding: 0.1rem 0;
  border: 0;
  background: transparent;
  color: #1295eb;
  cursor: pointer;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 800;
}

.application-review-card dl {
  display: grid;
  gap: 0.22rem;
  margin: 0;
}

.application-review-card dl > div {
  display: grid;
  grid-template-columns: minmax(90px, 0.75fr) minmax(0, 1fr);
  gap: 0.35rem;
  min-width: 0;
  color: #59677d;
  font-size: 0.63rem;
  line-height: 1.3;
}

.application-review-card dt {
  font-weight: 600;
}

.application-review-card dd {
  min-width: 0;
  margin: 0;
  color: #344158;
  overflow-wrap: anywhere;
}

.application-noscript {
  margin: 0.75rem 0 0;
  color: #9b2d43;
  font-size: 0.78rem;
}

@media (min-width: 761px) and (max-width: 1100px) {
  .kcid-application-page .site-utility__inner {
    width: calc(100vw - 64px);
    min-height: 22px;
    justify-content: space-between;
    gap: 0.45rem;
  }

  .kcid-application-page .site-utility__left,
  .kcid-application-page .site-utility__links,
  .kcid-application-page .site-utility__phones {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
  }

  .kcid-application-page .site-utility__item,
  .kcid-application-page .site-utility__links a {
    min-height: 22px;
    gap: 0.3rem;
    font-size: 0.6rem;
  }

  .kcid-application-page .site-utility__item svg {
    width: 0.75rem;
    height: 0.75rem;
  }

  .kcid-application-page .site-utility__phone {
    padding-left: 0.45rem;
  }

  .kcid-application-page .site-utility__links {
    gap: 0.55rem;
  }

  .kcid-application-page .site-header__inner {
    min-height: 52px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.4rem;
  }

  .kcid-application-page .brand__image {
    width: 104px;
    height: 48px;
  }

  .kcid-application-page .primary-nav {
    display: flex;
    width: auto;
    grid-column: auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(0.15rem, 0.42vw, 0.35rem);
    padding: 0;
    font-size: clamp(0.54rem, 0.8vw, 0.66rem);
  }

  .kcid-application-page .primary-nav > a,
  .kcid-application-page .primary-nav summary,
  .kcid-application-page .primary-nav__dropdown,
  .kcid-application-page .primary-nav__toggle {
    width: auto;
    min-height: 36px;
    padding: 0 0.12rem;
    white-space: nowrap;
  }

  .kcid-application-page .primary-nav__toggle {
    justify-content: center;
    gap: 0.12rem;
  }

  .kcid-application-page .primary-nav__toggle svg {
    width: 0.62rem;
    height: 0.62rem;
  }

  .kcid-application-page .site-header__cta {
    display: inline-flex;
    min-width: 78px;
    min-height: 32px;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem 0.45rem;
    border-radius: 6px;
    font-size: 0.61rem;
  }

  .kcid-application-page .menu-toggle {
    display: none;
  }
}

@media (max-width: 760px) {
  .apply-hero {
    min-height: 118px;
    height: 118px;
  }

  .apply-hero__image {
    object-position: 65% 40%;
  }

  .apply-section {
    padding-inline: 1rem;
  }

  .apply-card {
    margin-top: -1.55rem;
    padding: 1rem;
  }

  .application-grid--contact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .application-review-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .apply-hero {
    min-height: 112px;
    height: 112px;
  }

  .apply-hero__content {
    padding-inline: 1.15rem;
  }

  .apply-hero__content h1 {
    font-size: clamp(1.8rem, 8vw, 2.25rem);
  }

  .apply-hero__content > p {
    max-width: 19rem;
    font-size: 0.72rem;
  }

  .apply-section {
    padding-inline: 0.65rem;
    padding-bottom: 2rem;
  }

  .apply-card {
    margin-top: -1.3rem;
    padding: 0.9rem 0.75rem 0.85rem;
    border-radius: 11px;
  }

  .application-progress {
    margin-bottom: 1.15rem;
  }

  .application-step__number {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.7rem;
  }

  .application-progress::before,
  .application-progress::after {
    top: 14px;
  }

  .application-step__label {
    max-width: 5.2rem;
    font-size: 0.57rem;
  }

  .application-grid--personal,
  .application-grid--contact,
  .application-grid--split,
  .application-grid--course {
    grid-template-columns: minmax(0, 1fr);
  }

  .application-panel__heading {
    margin-bottom: 0.8rem;
  }

  .application-section__icon {
    width: 2.2rem;
    height: 2.2rem;
    flex-basis: 2.2rem;
  }

  .gender-options {
    gap: 0.38rem;
  }

  .gender-option {
    gap: 0.25rem;
    font-size: 0.64rem;
  }

  .application-actions {
    margin-top: 0.8rem;
  }

  .application-button {
    min-width: 7.5rem;
    min-height: 2.5rem;
  }

  .application-review-card dl > div {
    grid-template-columns: minmax(105px, 0.8fr) minmax(0, 1fr);
  }
}

@media (min-width: 700px) and (max-width: 1100px) {
  .kcid-application-page .site-utility,
  .kcid-application-page .site-utility__inner,
  .kcid-application-page .site-utility__item,
  .kcid-application-page .site-utility__links a {
    min-height: 20px;
  }

  .kcid-application-page .apply-hero {
    min-height: 88px;
    height: 88px;
  }

  .kcid-application-page .apply-hero__content h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.2rem);
  }

  .kcid-application-page .apply-hero__content > p {
    font-size: 0.78rem;
  }

  .kcid-application-page .apply-section {
    padding-left: clamp(1rem, 7vw, 6rem);
    padding-right: clamp(1rem, 5.7vw, 5rem);
  }

  .kcid-application-page .apply-card {
    margin-top: 0;
    padding-right: clamp(1rem, 4.5vw, 3rem);
    padding-left: clamp(1rem, 5.2vw, 3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .application-progress::after,
  .application-step__number,
  .application-upload,
  .application-button {
    transition: none;
  }
}

/* Keep the application comfortable to scan and complete on desktop and mobile. */
.apply-card {
  width: min(100%, 760px);
}

.application-grid--personal,
.application-grid--contact,
.application-grid--split,
.application-grid--course {
  grid-template-columns: minmax(0, 1fr);
}

.gender-options {
  grid-template-columns: minmax(0, 1fr);
}

.application-trap {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
