/* Job application - layered on rclsg-main.css (rclform-* inputs, buttons) */

/* Let the window scroll, not <body>. The site's base CSS (height:100% + overflow-x:hidden on
   html AND body) turns <body> into its own scroll box; on iPhones the page then jumps far down
   when the keyboard closes after AutoFill. Sideways scrolling stays blocked (html's overflow-x). */
html {
  height: auto;
}
body {
  height: auto;
  overflow-x: visible;
}

.app-logo {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 0 0.75rem;
}

.app-eeo {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #333;
  margin: 0 0 0.5rem;
}

.app-section {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid #d6dae4;
  border-radius: 8px;
  background: #fff;
  min-width: 0;
}

.app-section > legend {
  padding: 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.app-note {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.65);
  line-height: 1.45;
}

/* Fields: one column on phones, more as space allows */
.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem 1rem;
}

.app-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  margin-bottom: 0.5rem;
}

.app-field > label {
  font-weight: 600;
  font-size: 0.9rem;
}

.app-req {
  color: #b3151b;
}

.app-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.app .rclform-input,
.app .rclform-inputopt {
  font-size: 16px;    /* stops iPhone zooming into fields */
}

.app textarea {
  resize: vertical;
}

.app-count {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.55);
  text-align: right;
}

/* Errors */
.app-err {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #b3151b;
}

.app-err:empty {
  display: none;
}

.app [aria-invalid="true"] {
  border-color: #b3151b;
  box-shadow: 0 0 0 2px rgba(179, 21, 27, 0.25);
}

.app-alert {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid #b3151b;
  border-left-width: 6px;
  border-radius: 6px;
  background: #fff6f6;
  font-weight: 600;
}

/* Yes / No questions */
.app-q {
  padding: 0.85rem 0;
  border-bottom: 1px solid #e6e9f1;
  min-width: 0;
}

.app-qtext {
  margin: 0 0 0.5rem;
  font-weight: 600;
  line-height: 1.45;
}

/* Main questions number themselves: 1) 2) 3) ... (follow-ups are not numbered) */
.app-questions {
  counter-reset: app-q;
}

.app-questions > .app-q > .app-qtext::before {
  counter-increment: app-q;
  content: counter(app-q) ") ";
}

.app-yn {
  display: flex;
  gap: 0.5rem;
}

.app-yn label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  min-width: 5.5rem;
  padding: 0 1rem;
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.app-yn label:has(input:checked) {
  border-color: #990000;
  background: #fff6f6;
}

.app-yn input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: #d61f26;
}

.app-followup {
  margin: 0.25rem 0 0.75rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid #d61f26;
  background: #f7f7f9;
  border-radius: 0 6px 6px 0;
}

.app-followup .app-q {
  border-bottom: 0;
  padding: 0.5rem 0;
}

/* Employment history */
.app-wh {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e6e9f1;
  border-radius: 6px;
  background: #fbfbfd;
}

.app-wh-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-weight: 800;
  cursor: pointer;
}

.app-wh-toggle input,
.app-check input {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  accent-color: #d61f26;
}

.app-wh-body {
  margin-top: 0.5rem;
}

/* Statement and signature */
.app-statement {
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #e6e9f1;
  border-radius: 6px;
  background: #f7f7f9;
  font-size: 0.85rem;
  line-height: 1.5;
}

.app-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.75rem 0 0.25rem;
  line-height: 1.45;
  cursor: pointer;
}

.app-check input {
  margin-top: 0.15rem;
}

/* Checkbox lists (positions, skills): one column on phones, more as space allows */
.app-checks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1rem;
  margin-bottom: 1rem;
}

.app-checks .app-check {
  margin: 0;
  min-height: 44px;
  align-items: center;
}

.app-checks .app-check input {
  margin-top: 0;
}

@media (min-width: 640px) {
  .app-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .app-checks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Honeypot: invisible to people, irresistible to bots.
   display:none, not just off-screen: iPhone AutoFill filled an off-screen field
   (and scrolled down to it), which made real applications look like spam. */
.app-hp {
  display: none;
}

.app .rclform-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

[hidden] {
  display: none !important;
}

/* Tablets and up */
@media (min-width: 640px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-wide {
    grid-column: 1 / -1;
  }

  .app-q {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 1.5rem;
    align-items: center;
  }

  .app-q > .app-qtext {
    grid-column: 1;
    margin: 0;
  }

  .app-q > .app-note {
    grid-column: 1;
    grid-row: 2;
  }

  .app-q > .app-yn {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .app-q > .app-err {
    grid-column: 1 / -1;
  }
}

/* Desktop */
@media (min-width: 1000px) {
  .app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-narrow .rclform-inputopt {
    max-width: 5rem;
  }
}
