.ja-result-success::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 92px;
  background: linear-gradient(180deg, var(--biru-deep), var(--biru-royal));
  z-index: 90; /* sits behind .site-header (z-index: 100) */
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s ease;
}
@media (max-width: 640px) {
  .ja-result-success::before { height: 72px; }
}

.site-header.scrolled ~ main .ja-result-success::before {
  opacity: 0;
}

.ja-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: clamp(8px, 2vw, 28px); }
.ja-modal[hidden] { display: none; }
.ja-modal-scrim { position: absolute; inset: 0; background: rgba(6, 11, 23, 0.72); backdrop-filter: blur(2px); }

.ja-modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  height: 96vh;
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid rgba(245, 180, 0, 0.55);
  box-shadow: 0 0 0 1px rgba(245, 180, 0, 0.12), 0 0 46px 6px rgba(245, 180, 0, 0.28), var(--shadow);
  display: flex;
  flex-direction: column;
}

.ja-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--biru-boss);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px -6px rgba(6, 11, 23, 0.55);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.ja-modal-close:hover, .ja-modal-close:focus-visible { background: var(--line); transform: scale(1.06); }

.ja-modal-scroll {
  height: 100%;
  overflow-y: auto;
  padding: clamp(20px, 3.5vw, 40px);
}

@media (max-width: 640px) {
  .ja-modal { padding: 0; }
  .ja-modal-box { height: 100vh; border-radius: 0; }
  .ja-modal-scroll { padding: 60px 16px 24px; }
}

.ja-modal .ja-wrap { max-width: none; margin: 0; }

.ja-wrap {
  max-width: var(--container);
  margin: var(--section-y) auto 0;
}

.ja-head { margin-bottom: 1.2rem; }
.ja-title {
  font-family: var(--font-display);
  font-size: var(--h3);
  color: var(--text);
  margin: 0 0 0.35rem;
}
.ja-sub { color: var(--text-2); font-size: var(--fs-body); }

.ja-draft-banner {
  padding: 0.9em 1.1em;
  margin-bottom: 1.4rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 0.86rem;
  line-height: 1.5;
}

.ja-alert {
  padding: 1em 1.2em;
  margin-bottom: 1.4rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.55;
}
.ja-alert--warn { background: rgba(255, 193, 7, 0.12); border: 1px solid rgba(255, 193, 7, 0.4); color: var(--text); }
.ja-alert--error { background: rgba(220, 53, 69, 0.08); border: 1px solid rgba(220, 53, 69, 0.35); color: var(--text); }
.ja-alert ul { margin: 0.5em 0 0; padding-left: 1.2em; }
.ja-alert li { margin: 0.2em 0; }

.ja-section {
  /* <fieldset> defaults to min-width: min-content, so wide content (file
   * inputs, textareas, one-column grids) stretched the whole section past
   * the screen on phones and made the page scroll sideways. */
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 2vw, 1.8rem);
  margin-bottom: 1.6rem;
  background: var(--bg-3);
}
.ja-section legend {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  padding: 0 0.4em;
}

.ja-hint { color: var(--text-2); font-size: 0.86rem; margin: 0 0 1rem; }
.ja-hint--error { color: rgb(220, 53, 69); margin: 0.35rem 0 0; }

.ja-edu-heading {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--biru-boss);
  margin: 1.4rem 0 0.7rem;
}
.ja-edu-row + .ja-edu-row { margin-top: 0.4rem; }

.ja-grid { display: grid; gap: 1rem; margin: 0.9rem 0; }
.ja-grid-2 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ja-grid-3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.ja-grid-4 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.ja-field { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.9rem 0; }
.ja-field > span {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.ja-field > span em { text-transform: none; font-style: normal; color: var(--text-3); font-weight: 400; }

.ja-field input[type="text"],
.ja-field input[type="email"],
.ja-field input[type="tel"],
.ja-field input[type="date"],
.ja-field input[type="number"],
.ja-field textarea,
.ja-field select {
  width: 100%;
  padding: 0.75em 0.9em;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  transition: border-color var(--dur-fast) var(--ease);
}
.ja-field textarea { resize: vertical; min-height: 5.5em; }
.ja-field input:focus, .ja-field textarea:focus, .ja-field select:focus {
  outline: none;
  border-color: var(--biru-boss);
}
.ja-field input[type="file"] { font-size: 0.85rem; color: var(--text-2); }
.ja-field small { color: var(--text-3); font-size: 0.78rem; }
.ja-field small.ja-file-lost { color: #dc3545; }

/* File preview thumbnail + lightbox (client-side only — previews the
   file just picked in the input, never uploaded/fetched). Drag/right-
   click protection comes free from image-protection.js's MutationObserver. */
.ja-file-preview {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin-top: 0.6em;
}
.ja-file-preview[hidden] { display: none; }
.ja-file-preview-thumb {
  position: relative;
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--bg);
}
.ja-file-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.ja-file-preview-name {
  font-size: 0.82rem;
  color: var(--text-2);
  word-break: break-all;
}
.ja-file-preview-doc {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 0.8em;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text-2);
}
.ja-file-preview-doc i { color: var(--biru-boss); }
.ja-file-preview-remove {
  flex: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text-2);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.ja-file-preview-remove:hover { border-color: #dc3545; color: #dc3545; }

.ja-preview-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.85);
}
.ja-preview-lightbox[hidden] { display: none; }
.ja-preview-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
}
.ja-preview-lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}
.ja-preview-lightbox-close:hover { background: rgba(255, 255, 255, 0.18); }

.ja-radio-row { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; padding-top: 0.2rem; }
.ja-radio-row label { display: inline-flex; align-items: center; gap: 0.45em; font-size: 0.92rem; color: var(--text); font-weight: 400; text-transform: none; letter-spacing: normal; }

.ja-check {
  display: flex; align-items: flex-start; gap: 0.6em;
  font-size: 0.92rem; color: var(--text); line-height: 1.5;
  margin: 0.9rem 0;
}
.ja-check input { margin-top: 0.25em; }

.ja-sim-row { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 0.5rem; }
.ja-sim-item { display: flex; flex-direction: column; gap: 0.4rem; }
.ja-sim-item label { display: inline-flex; align-items: center; gap: 0.5em; font-size: 0.9rem; color: var(--text); text-transform: none; }
.ja-sim-item input[type="text"] { padding: 0.6em 0.8em; font-size: 0.88rem; }

.ja-yn-block { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.ja-yn-block:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.ja-yn-note { display: none; }
.ja-yn-note.is-visible { display: flex; }

[data-ja-vehicle-detail] { display: none; }
[data-ja-vehicle-detail].is-visible { display: grid; }

[data-ja-ready] input[data-ja-ready-date-input] { display: none; margin-top: 0.4rem; }
[data-ja-ready] input[data-ja-ready-date-input].is-visible { display: block; }
[data-ja-ready] input[data-ja-ready-note-input] { display: none; margin-top: 0.4rem; }
[data-ja-ready] input[data-ja-ready-note-input].is-visible { display: block; }

/* Family relation -> gender lock (Father/Mother auto-set + disabled). */
select[data-ja-family-gender-locked] { opacity: 0.7; cursor: not-allowed; }

.ja-repeat-row {
  position: relative;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 1rem 1rem 2.6rem;
  margin-bottom: 1rem;
}
.ja-row-remove {
  position: absolute;
  right: 0.9rem;
  bottom: 0.8rem;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #dc3545;
  background: none;
  border: 0;
  cursor: pointer;
}
.ja-row-remove:hover { text-decoration: underline; }

.ja-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--biru-boss);
  background: none;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 0.6em 1.1em;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.ja-btn-add:hover { border-color: var(--biru-boss); }

.ja-submit {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 0.4rem;
}

/* Thank-you / result state (job-apply-result.php) */
.ja-thanks {
  max-width: var(--container-narrow);
  margin: var(--section-y) auto;
  text-align: center;
  padding: clamp(2rem, 4vw, 3.5rem) 1rem;
}
.ja-thanks-title {
  font-family: var(--font-display);
  font-size: var(--h2);
  color: var(--text);
  margin-bottom: 0.8rem;
}
.ja-thanks-body { color: var(--text-2); font-size: var(--fs-body); line-height: 1.6; max-width: 46ch; margin: 0 auto; }
.ja-thanks-contact { color: var(--text-2); font-size: 0.92rem; line-height: 1.6; max-width: 46ch; margin: 0.8rem auto 0; }
.ja-thanks-contact strong { color: var(--text); }
.ja-thanks-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 2rem; }

@media (max-width: 640px) {
  .ja-section { padding: 1.1rem; }
  .ja-grid { grid-template-columns: 1fr !important; }
}
