/*
 * jobs.css - extra styles for the jobs page.
 * Loaded after styles.css; reuses its colours and existing classes
 * (.filters, .job-grid, .job, .pill, .notice, .form-card, .application-dialog ...).
 *
 * styles.css resets every element to margin:0 / border:0 / transparent
 * background, so form controls need their borders and padding put back here.
 */

/* ---------- Form controls ---------- */
.select-field,
.filters input,
.form-card input:not([type="checkbox"]),
.form-card textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--input);
  border-radius: 3px;
  background-color: #fff;
  color: var(--foreground);
}

.select-field {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23112b3c' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.select-field:focus-visible,
.filters input:focus-visible,
.form-card input:focus-visible,
.dialog-close:focus-visible,
.job-bottom button:focus-visible {
  outline: 3px solid #b78435;
  outline-offset: 2px;
}

.form-card input[type="file"] {
  padding: 9px 12px;
  cursor: pointer;
}

.form-card input[type="file"]::file-selector-button {
  margin-right: 14px;
  padding: 8px 14px;
  border: 0;
  border-radius: 3px;
  background: #102737;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.form-card label.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.form-card label.consent input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: #112b3c;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.form-status {
  min-height: 1.5em;
  margin: 16px 0 0;
  font-size: 14px;
}

.form-status.is-error {
  color: #a4262c;
  font-weight: 600;
}

.button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Job list ---------- */
.job h3 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.job-location {
  margin-bottom: 14px;
  color: var(--foreground);
  font-weight: 600;
}

.job-bottom button:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

#jobs-status {
  margin: 0 0 20px;
}

#jobs-status:empty {
  display: none;
}

.contact-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Dialog ---------- */
/* styles.css sets * { margin: 0 }, which would pin the dialog to the top-left. */
dialog.application-dialog {
  margin: auto;
  padding: 0;
  width: min(620px, calc(100vw - 32px));
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: var(--foreground);
  box-shadow: 0 30px 80px #0b1c2a66;
}

dialog.application-dialog::backdrop {
  background: #0b1c2acc;
}

body:has(dialog[open]) {
  overflow: hidden;
}

.dialog-inner {
  position: relative;
  padding: 40px 36px 28px;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 3px;
  background: transparent;
  font-size: 26px;
  line-height: 1;
}

.dialog-close:hover {
  background: #edf2f5;
}

.dialog-inner h2 {
  margin: 0 40px 10px 0;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
}

.dialog-meta {
  margin-bottom: 22px;
  font-weight: 600;
  color: var(--foreground);
}

.job-description {
  margin-bottom: 8px;
  color: #566773;
  white-space: pre-line;
}

.application-dialog .form-card {
  margin-top: 24px;
  padding: 24px 0 0;
  border-top: 1px solid #d7e0e6;
  background: transparent;
}

.application-dialog .form-card h3 {
  font-size: 22px;
}

#success-panel:focus {
  outline: none;
}

@media (max-width: 760px) {
  .dialog-inner {
    padding: 32px 20px 20px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}
