
/* ============ Validation (inline, no layout shift) ============ */
.apply-form label{
  position: relative;
  display: block;
  margin-bottom: 0;
  padding-top: 0;
  font-weight: 600;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.2;
  grid-column: span 12;
}

/* CHANGED: make error sit just above its field, tight to the top border */
.apply-form .error-message{
  position: static;                 /* was: absolute */
  display: block;
  text-align: right;                /* align to right edge of the field */
  margin: 4px 8px -6px 0;           /* small gap above field, negative bottom to keep it tight */
  font-size: 12px; font-weight: 600; color: #b91c1c;
  background: #fff; padding: 0 6px; white-space: nowrap; pointer-events: none;
}

.apply-form input.has-error,
.apply-form select.has-error,
.apply-form textarea.has-error{
  border-color: #ef4444 !important;
  background: #fff7f7;
}

.apply-form input.is-valid,
.apply-form select.is-valid,
.apply-form textarea.is-valid{
  border-color: #22c55e !important;
  background: #f8fff9;
}

/* ============ Job summary box ============ */
.job-summary{
  position: relative;
  background: #fff;
  border: 1px solid #e5e7eb;              /* slate-200 */
  border-radius: 14px;
  padding: 18px 20px 16px 24px;
  box-shadow: 0 6px 18px rgba(2,6,23,.06);
  margin: 0 auto 18px;
  max-width: 980px;
  color: #0f172a;
}
.job-summary::before{
  content: "";
  position: absolute;
  left: 8px; top: 8px; bottom: 8px;
  width: 6px;
  background: linear-gradient(180deg,darkblue);
  border-radius: 8px;
}
.job-summary .apply-title{
  font-size: 18px; font-weight: 800; margin: 0 0 6px 0;
}
.job-summary .meta{
  color: #475569;                           /* slate-600 */
  font-weight: 600;
  margin-bottom: 10px;
}
.summary-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 28px;
}
.summary-group .label{ font-weight: 800; margin-bottom: 4px; }
.summary-group .value{ color: #111827; font-weight: 600; }

@media (max-width: 680px){
  .summary-grid{ grid-template-columns: 1fr; }
}

/* ============ Apply form grid (two per row on desktop) ============ */
.apply-form{
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0,1fr));
  gap: 18px;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

@media (min-width: 720px){
  .apply-form label{ grid-column: span 6; }   /* two per row */
  .apply-form .span-12{ grid-column: span 12 !important; }
}

/* ============ Fields ============ */
.apply-form label > input,
.apply-form label > textarea,
.apply-form label > select{
  display: block; width: 100%; margin-top: 8px;
  background: #ffffff;
  border: 1.6px solid #c7d2fe;               /* indigo-200 */
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px; color: #0f172a; outline: none;
  box-shadow: inset 0 1px 0 rgba(15,23,42,.03);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.apply-form input[type="text"],
.apply-form input[type="email"],
.apply-form input[type="tel"],
.apply-form input[type="date"],
.apply-form input[type="number"]{
  height: 46px;
}

.apply-form textarea{
  min-height: 140px; resize: vertical;
}

/* File input */
.apply-form input[type="file"]{
  padding: 10px 12px; height: 46px;
}
.apply-form input[type="file"]::file-selector-button{
  margin-right: 12px; padding: 8px 12px;
  border: 1px solid #c7d2fe; border-radius: 10px;
  background: #eef2ff; font-weight: 600; cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.apply-form input[type="file"]::file-selector-button:hover{
  background: #e0e7ff; border-color: #a5b4fc;
}

/* Interactions */
.apply-form label > input:hover,
.apply-form label > textarea:hover,
.apply-form label > select:hover{
  border-color: #a5b4fc;
}
.apply-form label > input:focus,
.apply-form label > textarea:focus,
.apply-form label > select:focus{
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37,99,235,.17);
}
.apply-form ::placeholder{ color: #9aa5b1; opacity: 1; }

/* ============ Submit ============ */
.apply-actions{
  grid-column: span 12;
  display: flex; justify-content: flex-start; gap: 10px; flex-wrap: wrap;
}
.apply-form .apply{
  height: 48px; border: 0; border-radius: 12px; background: darkblue; color: #fff;
  font-weight: 700; letter-spacing: .2px; cursor: pointer;
  transition: transform .05s ease, box-shadow .18s ease, background .18s ease;
  box-shadow: 0 10px 24px rgba(15,93,60,.22); padding: 0 18px;
}
.apply-form .apply:hover{ background: red; box-shadow: 0 8px 18px rgba(11,74,48,.26); }
.apply-form .apply:active{ transform: translateY(1px); }

/* ============ Required asterisk (no HTML change) ============ */
.apply-form label:has(> input[required]),
.apply-form label:has(> textarea[required]),
.apply-form label:has(> select[required]){ position: relative; }

.apply-form label:has(> input[required])::after,
.apply-form label:has(> textarea[required])::after,
.apply-form label:has(> select[required])::after{
  content: " *";
  color: #ef4444; font-weight: 800;
}
