/* Responsibility: Application form controls, validation, upload and custom select components. */

.form-title {
  border-bottom: 1px solid rgba(227, 225, 218, 0.72);
  padding-bottom: 30px;
  margin-bottom: 28px;
}

.form-title h1 {
  margin-bottom: 16px;
}

.form-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  max-width: 760px;
}

.form-main > .back-link,
.form-title .eyebrow,
.form-title h1,
.form-title p,
.form-main > .apply-note,
.application-form > .fieldset,
.application-form > .form-actions {
  animation: contentFloatIn 0.42s var(--ease-apple) backwards;
}

.form-main > .back-link {
  animation-delay: 0.01s;
}

.form-title .eyebrow {
  animation-delay: 0.03s;
}

.form-title h1 {
  animation-delay: 0.05s;
}

.form-title p {
  animation-delay: 0.07s;
}

.form-main > .apply-note {
  animation-delay: 0.1s;
}

.application-form > .fieldset:nth-of-type(1) {
  animation-delay: 0.14s;
}

.application-form > .fieldset:nth-of-type(2) {
  animation-delay: 0.17s;
}

.application-form > .fieldset:nth-of-type(3) {
  animation-delay: 0.2s;
}

.application-form > .fieldset:nth-of-type(4) {
  animation-delay: 0.23s;
}

.application-form > .fieldset:nth-of-type(5) {
  animation-delay: 0.26s;
}

.application-form > .fieldset:nth-of-type(6),
.application-form > .form-actions {
  animation-delay: 0.29s;
}

.apply-note {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(227, 225, 218, 0.76);
  border-radius: 14px;
  background:
    linear-gradient(132deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.48)),
    radial-gradient(80% 110% at 92% 0%, rgba(18, 204, 116, 0.14), rgba(18, 204, 116, 0) 60%);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  margin-bottom: 30px;
}

.apply-note h2,
.apply-note p {
  position: relative;
  z-index: 1;
}

.apply-note h2 {
  margin: 0 0 12px;
  font-size: 23px;
}

.apply-note p {
  margin: 0;
  color: #3a3a36;
  line-height: 1.85;
}

.apply-note p + p {
  margin-top: 10px;
}

.application-form {
  display: grid;
  gap: 22px;
}

.fieldset {
  position: relative;
  border: 1px solid rgba(227, 225, 218, 0.78);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42)),
    rgba(255, 255, 255, 0.44);
  box-shadow: 0 12px 36px rgba(25, 23, 18, 0.045);
  padding: 27px;
  transition:
    border-color 0.28s var(--ease-apple),
    box-shadow 0.28s var(--ease-apple),
    transform 0.28s var(--ease-apple),
    background 0.28s var(--ease-apple);
}

.fieldset:hover {
  border-color: rgba(18, 204, 116, 0.18);
  box-shadow: 0 18px 48px rgba(25, 23, 18, 0.065);
  transform: translateY(-1px);
}

.fieldset.has-open-control {
  z-index: 70;
}

.fieldset legend {
  float: left;
  width: fit-content;
  margin: 0 0 20px;
  padding: 7px 12px;
  border: 1px solid rgba(227, 225, 218, 0.86);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.92);
  font-weight: 950;
  font-size: 17px;
  line-height: 1.2;
  box-shadow: 0 8px 20px rgba(25, 23, 18, 0.04);
}

.fieldset legend + .field-grid,
.fieldset legend + .education-history,
.fieldset legend + .declaration-check {
  clear: both;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 18px;
  align-items: start;
}

.field {
  position: relative;
  z-index: 0;
  display: grid;
  gap: 9px;
  align-content: start;
}

.field.has-open-control {
  z-index: 90;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.check-row {
  color: #2d2d2a;
  font-weight: 860;
}

.field label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  letter-spacing: 0;
}

.required {
  color: var(--warning);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(201, 207, 197, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    var(--field-bg);
  color: var(--ink);
  border-radius: 14px;
  min-height: 52px;
  padding: 13px 15px;
  font-weight: 500;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    border-color 0.24s var(--ease-apple),
    background 0.24s var(--ease-apple),
    box-shadow 0.24s var(--ease-apple),
    transform 0.24s var(--ease-apple);
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding: 13px 48px 13px 15px;
  background-image:
    linear-gradient(45deg, transparent 50%, #244b34 50%),
    linear-gradient(135deg, #244b34 50%, transparent 50%),
    linear-gradient(180deg, rgba(18, 204, 116, 0.12), rgba(18, 204, 116, 0.04));
  background-position:
    calc(100% - 25px) 23px,
    calc(100% - 18px) 23px,
    calc(100% - 42px) 0;
  background-size:
    7px 7px,
    7px 7px,
    1px 100%;
  background-repeat: no-repeat;
  color: #22221f;
  cursor: pointer;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(18, 204, 116, 0.38);
  background-color: var(--field-bg-active);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(25, 23, 18, 0.045);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: rgba(18, 204, 116, 0.72);
  background-color: var(--field-bg-active);
  box-shadow:
    0 0 0 5px rgba(18, 204, 116, 0.1),
    0 16px 34px rgba(18, 204, 116, 0.07);
  transform: translateY(-1px);
}

select:required:invalid,
select:has(option[value=""]:checked) {
  color: var(--muted);
}

select option {
  color: var(--ink);
  background: var(--paper);
}

.native-proxy {
  display: none !important;
}

.custom-control {
  position: relative;
  width: 100%;
}

.custom-control.is-open {
  z-index: 100;
}

.field-trigger {
  width: 100%;
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(201, 207, 197, 0.72);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    var(--field-bg);
  color: var(--ink);
  padding: 0 15px;
  font-weight: 500;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    border-color 0.24s var(--ease-apple),
    background 0.24s var(--ease-apple),
    box-shadow 0.24s var(--ease-apple),
    transform 0.24s var(--ease-apple);
}

.field-trigger:hover,
.custom-control.is-open .field-trigger {
  border-color: rgba(18, 204, 116, 0.54);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.08)),
    var(--field-bg-active);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 28px rgba(18, 204, 116, 0.08);
  transform: translateY(-1px);
}

.field-trigger:focus-visible {
  outline: none;
  border-color: rgba(18, 204, 116, 0.76);
  box-shadow:
    0 0 0 4px rgba(18, 204, 116, 0.12),
    0 16px 34px rgba(18, 204, 116, 0.07);
}

.field-trigger.is-placeholder {
  color: var(--muted);
}

.field-trigger:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.field-trigger:disabled:hover {
  border-color: rgba(18, 18, 16, 0.11);
  box-shadow: none;
  transform: none;
}

.field-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-chev {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-right: 2px solid #244b34;
  border-bottom: 2px solid #244b34;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.26s var(--ease-apple);
}

.custom-control.is-open .field-chev {
  transform: translateY(2px) rotate(225deg);
}

.custom-popover {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 110;
  border: 1px solid rgba(201, 207, 197, 0.78);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #fffefa, #fbfaf5),
    var(--paper);
  box-shadow: 0 24px 60px rgba(25, 23, 18, 0.14);
  padding: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.985);
  transform-origin: top;
  transition:
    opacity 0.22s var(--ease-apple),
    transform 0.22s var(--ease-apple);
}

.custom-control.is-open .custom-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.custom-control.opens-upward .custom-popover {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translateY(6px) scale(0.985);
  transform-origin: bottom;
}

.custom-control.is-open.opens-upward .custom-popover {
  transform: translateY(0) scale(1);
}

.select-popover {
  box-sizing: border-box;
  max-height: min(460px, 56vh, var(--select-popover-max-height, 460px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.select-popover::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.custom-group-label {
  padding: 12px 12px 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 930;
}

.custom-option {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-weight: 760;
  transition:
    background 0.2s var(--ease-apple),
    color 0.2s var(--ease-apple),
    transform 0.2s var(--ease-apple);
}

.custom-option:hover,
.custom-option:focus-visible {
  outline: none;
  background: rgba(255, 212, 59, 0.14);
  color: var(--accent-dark);
}

.custom-option.is-selected {
  background: rgba(255, 212, 59, 0.18);
  color: #5f4200;
  font-weight: 900;
}

.custom-option.is-selected::after {
  content: none;
}

.date-trigger {
  padding-right: 9px;
}

.date-glyph {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
  color: #313733;
  background: rgba(18, 204, 116, 0.12);
  padding: 8px;
}

.date-popover {
  left: 0;
  right: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  border-color: rgba(60, 60, 67, 0.13);
  background:
    linear-gradient(180deg, rgba(255, 255, 252, 0.96), rgba(251, 250, 246, 0.92)),
    rgba(255, 255, 252, 0.94);
  box-shadow: 0 18px 50px rgba(25, 23, 18, 0.13);
  padding: 14px;
  backdrop-filter: blur(22px);
}

.picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
}

.picker-head b {
  font-size: 14px;
  font-weight: 780;
  letter-spacing: 0;
}

.picker-head span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 690;
}

.picker-columns {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0;
  isolation: isolate;
}

.picker-columns::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  height: 42px;
  border: 1px solid rgba(255, 190, 47, 0.3);
  border-radius: 14px;
  background: rgba(255, 212, 59, 0.14);
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 0;
}

.custom-date[data-picker-type="month"] .picker-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.picker-column {
  position: relative;
  z-index: 1;
  max-height: 224px;
  overflow: auto;
  display: grid;
  gap: 0;
  padding: 91px 2px;
  scroll-padding-block: 91px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
}

.picker-column::-webkit-scrollbar {
  display: none;
}

.picker-option {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(12, 12, 12, 0.54);
  padding: 8px 6px;
  font-size: 16px;
  font-weight: 650;
  transition:
    background 0.18s var(--ease-apple),
    color 0.18s var(--ease-apple),
    box-shadow 0.18s var(--ease-apple),
    transform 0.18s var(--ease-apple);
}

.picker-option:hover {
  outline: none;
  background: rgba(255, 212, 59, 0.12);
  color: #5f4608;
}

.picker-option:focus-visible {
  outline: none;
  background: rgba(255, 212, 59, 0.12);
  color: #5f4608;
  box-shadow: inset 0 0 0 1.5px rgba(255, 181, 35, 0.46);
}

.picker-option.is-selected {
  background: transparent;
  color: #08150f;
  font-weight: 780;
  box-shadow: none;
}

.picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 2px 0;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
}

.picker-actions button {
  min-height: 36px;
  border-radius: 999px;
  border: 0;
  padding: 0 15px;
  font-size: 14px;
  font-weight: 760;
  background: transparent;
  color: rgba(12, 12, 12, 0.66);
  transition:
    background 0.18s var(--ease-apple),
    color 0.18s var(--ease-apple),
    transform 0.18s var(--ease-apple);
}

.picker-actions button:hover,
.picker-actions button:focus-visible {
  outline: none;
  background: rgba(60, 60, 67, 0.08);
  color: var(--ink);
}

.picker-actions button:active {
  transform: scale(0.98);
}

.picker-actions .picker-confirm {
  background: rgba(255, 212, 59, 0.2);
  color: #4d3908;
}

.picker-actions .picker-confirm:hover,
.picker-actions .picker-confirm:focus-visible {
  background: rgba(255, 198, 59, 0.3);
  color: #2f2408;
}

.is-invalid input,
.is-invalid select,
.is-invalid textarea,
.is-invalid .field-trigger,
.is-invalid .upload-zone,
.declaration-check.is-invalid {
  border-color: rgba(178, 69, 40, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)),
    rgba(178, 69, 40, 0.045);
  box-shadow: 0 0 0 5px rgba(178, 69, 40, 0.08);
}

textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.7;
}

input[type="month"],
input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  padding: 13px 14px 13px 15px;
  color: #22221f;
  color-scheme: light;
}

input[type="month"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

input[type="month"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  width: 25px;
  height: 25px;
  margin-right: 0;
  padding: 5px;
  border-radius: 10px;
  background-color: rgba(255, 212, 59, 0.16);
  cursor: pointer;
  opacity: 0.72;
  transition: background-color 0.22s var(--ease-apple), opacity 0.22s var(--ease-apple);
}

input[type="month"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(255, 198, 59, 0.24);
  opacity: 0.9;
}

input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

input[type="file"]::file-selector-button {
  display: none;
}

.upload-zone {
  position: relative;
  min-height: 98px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(18, 204, 116, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(90% 140% at 0% 50%, rgba(18, 204, 116, 0.14), rgba(18, 204, 116, 0) 58%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(251, 250, 245, 0.62)),
    rgba(255, 254, 250, 0.9);
  padding: 18px 20px;
  overflow: hidden;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 14px 32px rgba(18, 204, 116, 0.055);
  transition:
    border-color 0.26s var(--ease-apple),
    background 0.26s var(--ease-apple),
    box-shadow 0.26s var(--ease-apple),
    transform 0.26s var(--ease-apple);
}

.upload-zone:hover,
.upload-zone:focus-within {
  border-color: rgba(18, 204, 116, 0.58);
  background:
    radial-gradient(90% 140% at 0% 50%, rgba(18, 204, 116, 0.18), rgba(18, 204, 116, 0) 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(251, 250, 245, 0.68)),
    rgba(255, 254, 250, 0.96);
  box-shadow: 0 18px 38px rgba(18, 204, 116, 0.09);
  transform: translateY(-1px);
}

.upload-zone.has-file {
  border-color: rgba(18, 204, 116, 0.68);
  background:
    radial-gradient(90% 140% at 0% 50%, rgba(18, 204, 116, 0.2), rgba(18, 204, 116, 0) 62%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(251, 250, 245, 0.68)),
    rgba(255, 254, 250, 0.96);
}

.upload-glyph {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(180deg, var(--accent), #14b96d);
  padding: 11px;
  box-shadow:
    0 12px 22px rgba(18, 204, 116, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.upload-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}

.upload-copy b {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.upload-copy small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.upload-action {
  flex: 0 0 auto;
  min-height: 34px;
  border-radius: 999px;
  background: rgba(18, 204, 116, 0.13);
  color: #063b22;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 920;
  line-height: 1;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.error {
  color: var(--warning);
  font-size: 13px;
  line-height: 1.5;
  min-height: 18px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.2s var(--ease-apple), transform 0.2s var(--ease-apple);
}

.error:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

.form-error-summary {
  border: 1px solid rgba(211, 71, 55, 0.28);
  border-left: 4px solid #d44737;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.4)),
    rgba(211, 71, 55, 0.075);
  color: #ad372c;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-weight: 850;
  line-height: 1.6;
  box-shadow: 0 14px 32px rgba(211, 71, 55, 0.065);
  animation: softIn 0.34s var(--ease-apple);
}

.declaration-check {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(60, 60, 67, 0.13);
  border-radius: 14px;
  padding: 17px 18px;
  cursor: pointer;
  line-height: 1.5;
  transition:
    border-color 0.24s var(--ease-apple),
    background 0.24s var(--ease-apple),
    box-shadow 0.24s var(--ease-apple);
}

.declaration-check:hover,
.declaration-check:focus-within {
  border-color: rgba(60, 60, 67, 0.22);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(25, 23, 18, 0.045);
}

.declaration-text {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.declaration-text b {
  color: #242421;
  font-size: 15px;
  font-weight: 820;
  line-height: 1.35;
}

.declaration-text small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.check-row input {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  max-width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  margin: 0;
  display: grid;
  place-content: center;
  border: 1.5px solid rgba(60, 60, 67, 0.58);
  border-radius: 7px;
  background: #fffefa;
  cursor: pointer;
  transition:
    background 0.16s var(--ease-apple),
    border-color 0.16s var(--ease-apple),
    box-shadow 0.16s var(--ease-apple);
}

.check-row input::after {
  content: "";
  width: 6px;
  height: 11px;
  border-right: 2.25px solid #282318;
  border-bottom: 2.25px solid #282318;
  transform: translateY(-1px) rotate(42deg) scale(0);
  transform-origin: center;
  transition: transform 0.14s var(--ease-apple);
}

.check-row input:checked {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 6px 14px rgba(18, 204, 116, 0.14);
}

.check-row input:checked::after {
  transform: translateY(-1px) rotate(42deg) scale(1);
}

.check-row input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 198, 59, 0.2);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.submit-status {
  color: var(--muted);
  font-weight: 750;
  min-height: 24px;
  line-height: 1.55;
  transition: color 0.22s var(--ease-apple);
}

.apply-stepper,
.mobile-step-actions {
  display: none;
}
