/* RecruitNow application form – Wise Human styling (red accent, clean layout) */

#apply-section {
  scroll-margin-top: 100px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* Constrain RecruitNow web component host so it doesn’t overflow on mobile */
#apply-section jobboard-application-form {
  display: block;
  min-width: 0;
  max-width: 100%;
}

#apply-section .rnFormWrapper {
  font-family: inherit;
  min-width: 0;
  max-width: 100%;
}

#apply-section .rnFormContainer {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.5rem 1.5rem 1.75rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
  margin-top: 10px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#apply-section .rnFormContainer > h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

#apply-section .rnTitlePrefix {
  color: #6b7280;
  font-weight: 500;
}

#apply-section .rnVacancyTitle {
  color: #111827;
}

#apply-section .rnFieldList {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
  max-width: 100%;
}

#apply-section .rnFormContainer fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

#apply-section .rnFormContainer fieldset:last-of-type {
  margin-bottom: 0;
}

#apply-section .rnFormContainer legend {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  padding: 0;
}

#apply-section .rnFormGroup {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

#apply-section .rnLabel {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  display: block;
}

#apply-section .rnLabel .required::after {
  content: " *";
  color: #b91c1c;
}

#apply-section .rnFormControl {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #111827;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

#apply-section .rnFormControl:focus {
  outline: none;
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgb(185 28 28 / 0.15);
}

#apply-section .rnFormControl::placeholder {
  color: #9ca3af;
}

#apply-section .rnFormControl[type="file"] {
  padding: 0.375rem 0;
  font-size: 0.875rem;
}

#apply-section textarea.rnFormControl {
  min-height: 6rem;
  resize: vertical;
}

/* International phone – single row: country | code | number, no redundant label */
#apply-section .rnInternationalPhone {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  max-width: 100%;
  min-width: 0;
}

#apply-section .rnErrors {
  color: #dc2626;
}

#apply-section .rnmail-and-whatsapp-consent {
  flex-direction: row-reverse;
  justify-content: flex-end;
  position: relative;

  &:has(.rnErrors) {
    margin-bottom: 30px;
  }

  .rnErrors  {
    position: absolute;
    top: 30px;
  }
}

/* Hide redundant "Nederland" text next to the country dropdown (keep the select visible) */
#apply-section .rnPhoneCountry .rnSelectBox + span,
#apply-section .rnPhoneCountry > span:first-child {
  display: none;
}
#apply-section .rnPhoneCountry select {
  display: block !important;
}

#apply-section .rnPhoneCountry .rnSelectBox,
#apply-section .rnPhoneCountry select {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  color: #374151;
  background: #fff;
  min-width: 0;
  box-sizing: border-box;
  height: 2.5rem;
}
#apply-section .rnPhoneCountry select {
  min-width: 0;
  width: 100%;
  max-width: 12rem;
}

#apply-section .rnPhoneCountry select:focus {
  outline: none;
  border-color: #b91c1c;
}

#apply-section .rnPhone {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

/* Align prefix and number input on same baseline – no offset */
#apply-section .rnPhone .rnPhonePrefix,
#apply-section .rnPhone input[readonly] {
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #6b7280;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-right: 0;
  border-radius: 0.5rem 0 0 0.5rem;
  width: auto;
  min-width: 3.5rem;
  flex-shrink: 0;
  box-sizing: border-box;
  height: 2.5rem;
  vertical-align: middle;
}

#apply-section .rnPhoneNumberInput {
  flex: 1;
  min-width: 0;
}
#apply-section .rnPhoneNumberInput input {
  border-radius: 0 0.5rem 0.5rem 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

#apply-section .rnPhoneNumberInput input:focus {
  position: relative;
  z-index: 1;
}

/* File upload – one row, no broken "Selecteer een cv" */
#apply-section .rnFileUpload {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #6b7280;
  background: #f9fafb;
  border: 2px dashed #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#apply-section .rnFileUpload:hover {
  border-color: #b91c1c;
  background: #fef2f2;
}

/* Keep instruction text on one line on desktop; allow wrap on mobile */
#apply-section .rnFileUpload .rnAction,
#apply-section .rnFileUpload .rnFilename,
#apply-section .rnFileUpload .rnPlaceholder,
#apply-section .rnFileUpload > span {
  white-space: nowrap;
}

#apply-section .rnFileUpload .rnAction {
  color: #b91c1c;
  font-weight: 500;
}

#apply-section .rnFileUpload .rnFilename {
  color: #374151;
}

/* File input: styled "Choose File" button to match form */
#apply-section .rnFileUpload input[type="file"] {
  min-width: 10rem;
  max-width: 100%;
  flex-shrink: 1;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
}
/* Style the native "Choose File" button (red accent, rounded) */
#apply-section .rnFileUpload input[type="file"]::file-selector-button {
  padding: 0.4rem 0.75rem;
  margin-right: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: #b91c1c;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
#apply-section .rnFileUpload input[type="file"]::file-selector-button:hover {
  background: #991b1b;
}
/* WebKit (Chrome, Safari, Edge) */
#apply-section .rnFileUpload input[type="file"]::-webkit-file-upload-button {
  padding: 0.4rem 0.75rem;
  margin-right: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: #b91c1c;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
#apply-section .rnFileUpload input[type="file"]::-webkit-file-upload-button:hover {
  background: #991b1b;
}

/* Checkbox */
#apply-section .rnCheckbox {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
}

#apply-section .rnCheckbox input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.125rem;
  accent-color: #b91c1c;
  cursor: pointer;
}

#apply-section .rnCheckbox .rnLabel,
#apply-section .rnFormGroup.rncheckboxField .rnLabel {
  font-weight: 400;
  color: #374151;
}

#apply-section .rnFormGroup.rncheckboxField .rnLabel a {
  color: #b91c1c;
  text-decoration: underline;
}

#apply-section .rnFormGroup.rncheckboxField .rnLabel a:hover {
  color: #991b1b;
}

/* Buttons */
#apply-section .rnButtons {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

#apply-section .rnButton {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #b91c1c;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

#apply-section .rnButton:hover {
  background: #991b1b;
}

#apply-section .rnButton:active {
  transform: scale(0.98);
}

#apply-section .rnButton:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgb(185 28 28 / 0.3);
}

/* Validation / error state (if RecruitNow adds classes) */
#apply-section .rnFormGroup.rnInvalid .rnFormControl,
#apply-section .rnFormGroup.error .rnFormControl {
  border-color: #dc2626;
}

#apply-section .rnFormGroup.rnInvalid .rnErrorMessage,
#apply-section .rnFormGroup.error .rnErrorMessage {
  font-size: 0.875rem;
  color: #dc2626;
  margin-top: 0.25rem;
}

/* Mobile: prevent overflow and improve touch targets */
@media (max-width: 768px) {
  #apply-section {
    padding-left: 0;
    padding-right: 0;
  }

  #apply-section .rnFormContainer {
    padding: 1rem;
    border-radius: 0.75rem;
  }

  #apply-section .rnFormContainer > h2 {
    font-size: 1.125rem;
  }

  #apply-section .rnFormControl {
    font-size: 16px; /* avoids zoom on focus in iOS */
  }

  /* Phone row: allow wrap so country + number don’t overflow */
  #apply-section .rnInternationalPhone {
    flex-wrap: wrap;
  }

  #apply-section .rnPhoneCountry select {
    max-width: 100%;
  }

  #apply-section .rnPhone {
    min-width: 0;
    flex: 1 1 100%;
  }

  /* File upload: allow text to wrap so it doesn’t overflow */
  #apply-section .rnFileUpload .rnAction,
  #apply-section .rnFileUpload .rnFilename,
  #apply-section .rnFileUpload .rnPlaceholder,
  #apply-section .rnFileUpload > span {
    white-space: normal;
    word-break: break-word;
  }

  #apply-section .rnFileUpload {
    flex-wrap: wrap;
  }

  #apply-section .rnFileUpload input[type="file"] {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  #apply-section .rnButton {
    width: 100%;
    text-align: center;
    padding: 0.875rem 1rem;
  }
}
