/*
 * Careers Apply page. One centred card holding the CF7 application form.
 * The form markup is CF7's, so the field styling here is written against
 * CF7's own wrappers (.wpcf7-form-control) rather than bespoke classes.
 */

.a3-apply {
  padding: 48px 0 96px;
  background: #fff;
}

.a3-apply .container {
  /* Figma: card sits at left:368/right:368 on a 1440 frame -> 1440-368-368 =
     704 for the CARD. .container carries `padding: 0 15px` (global.css), so
     the max-width has to be 704+30 or the card itself comes out 674 and the
     form content 576 against Figma's 606 (776:1517 -> Form w=606, inset 49
     inside the 704 card, which our 48px padding + 1px border matches). */
  max-width: 734px;
}

.a3-apply__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: #52525b;
  text-decoration: none;
  transition: color 0.15s ease;
}

.a3-apply__back:hover {
  color: #ff6900;
}

.a3-apply__back svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.a3-apply__card {
  background: #fff;
  border: 1px solid rgba(228, 228, 231, 0.6);
  border-radius: 32px;
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.1),
    0 1px 2px -1px rgba(0, 0, 0, 0.1);
  padding: 48px;
}

.a3-apply__header {
  border-bottom: 1px solid #f4f4f5;
  padding-bottom: 32px;
  margin-bottom: 32px;
}

.a3-apply__heading {
  font-size: 36px;
  font-weight: 700;
  line-height: 40px;
  color: #18181b;
  margin: 0 0 12px;
}

.a3-apply__description {
  font-size: 18px;
  line-height: 28px;
  color: #52525b;
  margin: 0;
}

.a3-apply__role-description {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e4e4e7;
  font-size: 16px;
  line-height: 1.7;
  color: #3f3f46;
}

.a3-apply__role-description p {
  margin: 0 0 16px;
}

.a3-apply__role-description ul,
.a3-apply__role-description ol {
  margin: 0 0 16px;
  padding-left: 20px;
}

/* ---------- CF7 application form ---------- */

/* CF7 runs its own autop over the form markup, wrapping every label+input
   pair in a <p> and inserting a <br> between them. Spacing here is owned by
   .a3-apply-field, so both are neutralised rather than fought with. */
.a3-apply__form p {
  margin: 0;
}

.a3-apply__form br {
  display: none;
}

.a3-apply__form .a3-apply-row {
  display: flex;
  gap: 15px;
}

.a3-apply__form .a3-apply-field {
  flex: 1 1 0;
  min-width: 0;
  margin-bottom: 24px;
}

.a3-apply__form label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: #18181b;
  margin-bottom: 8px;
}

.a3-apply__form label .a3-apply-optional {
  font-weight: 400;
  color: #71717a;
}

.a3-apply__form .wpcf7-form-control-wrap {
  display: block;
}

.a3-apply__form input[type="text"],
.a3-apply__form input[type="email"],
.a3-apply__form input[type="tel"],
.a3-apply__form input[type="url"],
.a3-apply__form textarea {
  width: 100%;
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 0;
  padding: 16px;
  font-family: var(--a3-font-base);
  font-size: 16px;
  line-height: 20px;
  color: #18181b;
  appearance: none;
}

.a3-apply__form input::placeholder,
.a3-apply__form textarea::placeholder {
  color: rgba(24, 24, 27, 0.5);
}

.a3-apply__form input:focus,
.a3-apply__form textarea:focus {
  outline: none;
  border-color: #ff6900;
}

/* Figma (776:1566) draws this box at 606x126 - roughly four lines. CF7
   emits it with rows="10", and a `min-height` is only a floor, so the rows
   attribute won the intrinsic height and it rendered 274px: more than twice
   the design. An explicit `height` overrides rows without touching the CF7
   form definition in the database. `resize: vertical` is kept deliberately -
   a dragged textarea overrides height, so anyone with more to say can still
   expand it. */
.a3-apply__form textarea {
  /* BOTH are needed. `height` alone loses to global.css's
     `textarea { min-height: 150px }` - min-height clamps height upward no
     matter how specific the height rule is, so the box floated back to 150.
     `min-height` alone loses to the rows="10" intrinsic height, which is
     what put it at 274 in the first place. Together they pin it at 126. */
  min-height: 126px;
  height: 126px;
  line-height: 24px;
  resize: vertical;
}

/* Resume dropzone. CF7 renders a plain file input, so the dashed panel is
   the label and the input itself is stretched invisibly across it - that
   keeps the whole panel clickable without any JS. */
.a3-apply__form .a3-apply-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 156px;
  padding: 24px;
  text-align: center;
  background: rgba(250, 250, 250, 0.5);
  border: 2px dashed #e4e4e7;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.a3-apply__form .a3-apply-upload:hover {
  border-color: #ff6900;
}

.a3-apply__form .a3-apply-upload svg {
  width: 32px;
  height: 32px;
  color: #71717a;
}

.a3-apply__form .a3-apply-upload-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: #18181b;
}

.a3-apply__form .a3-apply-upload-hint {
  font-size: 12px;
  line-height: 16px;
  color: #52525b;
}

.a3-apply__form .a3-apply-upload .wpcf7-form-control-wrap {
  position: absolute;
  inset: 0;
}

.a3-apply__form .a3-apply-upload input[type="file"] {
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Filled / drag states. careers-apply.js adds these; the panel is fully
   functional without them, they just confirm the file actually attached -
   the opacity:0 input above hides the browser's own filename text. */
.a3-apply__form .a3-apply-upload.is-dragging {
  border-color: #ff6900;
  background: rgba(255, 105, 0, 0.04);
}

.a3-apply__form .a3-apply-upload.is-filled {
  border-style: solid;
  border-color: #ff6900;
  background: rgba(255, 105, 0, 0.04);
}

.a3-apply__form .a3-apply-upload.is-filled svg {
  color: #ff6900;
}

/* Filenames are user-supplied and can be long enough to push the panel
   wider than the form column, so let them wrap mid-word. */
.a3-apply__form .a3-apply-upload-title {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* job/job-title travel in via CF7's default:get - never shown, only mailed. */
.a3-apply__form .a3-apply-hidden {
  display: none;
}

.a3-apply__form .a3-apply-submit {
  margin-top: 40px;
}

.a3-apply__form input[type="submit"] {
  width: 100%;
  height: 56px;
  background: #ff6900;
  border: none;
  border-radius: 0;
  box-shadow:
    0 10px 15px -3px rgba(255, 105, 0, 0.2),
    0 4px 6px -4px rgba(255, 105, 0, 0.2);
  font-family: var(--a3-font-base);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.a3-apply__form input[type="submit"]:hover {
  background: #e85e0f;
}

.a3-apply__form .wpcf7-not-valid-tip {
  font-size: 13px;
  color: #d63638;
  margin-top: 6px;
}

.a3-apply__form .wpcf7-response-output {
  margin: 24px 0 0;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
}

@media (max-width: 767px) {
  .a3-apply {
    padding: 32px 0 64px;
  }

  .a3-apply__card {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .a3-apply__heading {
    font-size: 28px;
    line-height: 34px;
  }

  .a3-apply__description {
    font-size: 16px;
    line-height: 26px;
  }

  .a3-apply__form .a3-apply-row {
    flex-direction: column;
    gap: 0;
  }
}
