/* ============================================
   F & T HR INDIA - CAREERS PAGE
   Loaded only by /careers/. Every value here comes from the tokens in
   style.css, so the page inherits the site's type, colour and spacing
   rather than inventing a second design language.

   Built mobile-first: most candidates open this on a phone, so the
   single-column layout is the default and wider screens add columns.
   ============================================ */

/* Several blocks here are flex or grid, which beats the browser's own
   [hidden] rule and would leave "hidden" elements on screen. */
[hidden] { display: none !important; }

/* ---------- Hero ---------- */

/* The shared .page-hero is navy, where the brand blue label fails
   contrast. Gold is the accent that already works on this background. */
.careers-hero .section-label {
  color: var(--clr-tertiary);
  background: var(--clr-tertiary-glow);
  border-color: rgba(245, 158, 11, 0.3);
}

.careers-hero h1 { max-width: 16ch; }

.careers-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

/* ---------- Three-step strip ----------
   Deliberately compact. It sets the expectation ("this takes a minute")
   without pushing the actual jobs below the fold on a phone. */
.careers-steps {
  display: grid;
  gap: var(--sp-3);
  margin-top: clamp(2rem, 5vw, 2.75rem);
  padding-top: var(--sp-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.careers-step {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  line-height: 1.4;
}

.careers-step-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.22);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: var(--clr-white);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
}

@media (min-width: 720px) {
  .careers-steps { grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
}

/* ---------- Openings ---------- */
.openings {
  padding: var(--section-y) 0;
  background: var(--clr-neutral);
}

.openings-head { margin-bottom: var(--sp-6); }
.openings-head h2 { margin-bottom: var(--sp-2); }

.openings-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--clr-text-muted);
}

/* ---------- Search and location ---------- */
.jobs-toolbar {
  display: grid;
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
}

.jobs-filter-group { display: flex; flex-direction: column; gap: var(--sp-2); }

.jobs-filter-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clr-gray-700);
}

/* Light-surface twins of .form-input / .form-select, which are styled
   for the navy contact panel and would be white-on-white here. */
.jobs-input,
.jobs-select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--clr-gray-300);
  border-radius: var(--radius-sm);
  background: var(--clr-white);
  color: var(--clr-text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.jobs-input::placeholder { color: var(--clr-gray-400); }

.jobs-input:focus,
.jobs-select:focus {
  outline: none;
  border-color: var(--clr-secondary);
  box-shadow: 0 0 0 3px var(--clr-secondary-glow);
}

@media (min-width: 720px) {
  .jobs-toolbar { grid-template-columns: 2fr 1fr; gap: var(--sp-4); align-items: end; }
  /* Set by careers.js when every job shares one location. */
  .jobs-toolbar.is-single { grid-template-columns: 1fr; }
}

/* ---------- Department groups ---------- */
.jobs-dept + .jobs-dept { margin-top: var(--sp-10); }

.jobs-dept-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-5);
  border-bottom: 2px solid var(--clr-gray-200);
}

.jobs-dept-head h3 {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--clr-primary);
}

.jobs-dept-count {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-tertiary-dark);
}

/* ---------- Job cards ----------
   Full-width rows rather than a card grid: with a handful of roles per
   department a grid leaves half-empty rows, and a row scans top to
   bottom the way a job list is actually read. */
.job-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}

.job-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  background: var(--clr-white);
  border: 1px solid var(--clr-gray-200);
  border-radius: var(--radius-md);
  padding: var(--sp-6);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.job-card-body { display: flex; flex-direction: column; gap: var(--sp-3); }

@media (min-width: 720px) {
  .job-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-8);
  }
  .job-card-body { flex: 1; }
}

.job-card:hover {
  border-color: var(--clr-secondary);
  box-shadow: var(--shadow-md);
}

.job-title {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.4vw, 1.25rem);
  font-weight: 700;
  color: var(--clr-primary);
  line-height: 1.3;
}

.job-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.job-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--clr-gray-100);
  color: var(--clr-gray-700);
  font-size: 0.82rem;
  font-weight: 600;
}

.job-pill svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--clr-secondary); }

.job-desc {
  color: var(--clr-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Full width and 52px tall on a phone: the primary action of the page,
   sized for a thumb. */
.job-apply-btn {
  width: 100%;
  justify-content: center;
  min-height: 52px;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

@media (min-width: 720px) {
  .job-apply-btn { width: auto; min-width: 170px; flex-shrink: 0; }
}

.job-apply-btn.is-applied {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  box-shadow: none;
  cursor: default;
  transform: none;
}

/* ---------- Empty state ---------- */
.jobs-empty {
  text-align: center;
  padding: clamp(2rem, 6vw, 3rem) var(--sp-5);
  background: var(--clr-white);
  border: 1px dashed var(--clr-gray-300);
  border-radius: var(--radius-md);
}

.jobs-empty p {
  color: var(--clr-text-muted);
  max-width: 48ch;
  margin: 0 auto var(--sp-5);
}

/* ---------- Help panel ---------- */
.careers-help {
  margin-top: var(--sp-10);
  background: var(--clr-primary);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--clr-white);
  display: grid;
  gap: var(--sp-5);
}

.careers-help h3 { color: var(--clr-white); margin-bottom: var(--sp-2); }
.careers-help p { color: rgba(255, 255, 255, 0.7); font-size: 0.95rem; max-width: 52ch; }

.careers-help-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.careers-help-actions .btn { min-height: 48px; }

@media (min-width: 860px) {
  .careers-help { grid-template-columns: 1.4fr auto; align-items: center; }
}

/* ============================================
   APPLICATION MODAL
   Reuses .service-modal-backdrop / .service-modal-card from style.css,
   so it opens, scrolls and closes exactly like the service dialog.
   ============================================ */

.apply-modal .service-modal-card { max-width: 520px; }

.apply-modal-title {
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  color: var(--clr-white);
  margin-bottom: var(--sp-1);
  padding-right: var(--sp-10);
}

.apply-modal-meta {
  font-size: 0.85rem;
  color: var(--clr-tertiary);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}

.apply-modal-lede {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--sp-6);
}

.apply-form { display: grid; gap: var(--sp-5); }

/* Wrapper so the whole ID proof question can be removed in one go when
   it is switched off, without collapsing the form's rhythm when it is on. */
.apply-id-block { display: grid; gap: var(--sp-5); }

.apply-required { color: var(--clr-tertiary); }

/* Hint text sits under the label, before the field it explains. */
.form-hint {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
  margin-top: -2px;
}

/* Errors carry an icon and their own text, so they never read as
   "the red one" - the colour is the last of three signals. */
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fca5a5;
  line-height: 1.4;
}

.field-error::before {
  content: '!';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--clr-danger);
  color: var(--clr-white);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: var(--clr-danger);
  background: rgba(239, 68, 68, 0.08);
}

.apply-consent {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
}

.apply-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fecaca;
  font-size: 0.9rem;
  line-height: 1.6;
}

.apply-alert:focus { outline: 2px solid var(--clr-danger); outline-offset: 2px; }

.apply-submit-btn { min-height: 54px; font-size: 1rem; }
.apply-submit-btn:disabled { opacity: 0.7; cursor: progress; transform: none; }

/* The honeypot: off-screen for pointers, untabbable and hidden from
   assistive tech, so only a form-filling bot ever completes it. */
.apply-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Success panel ---------- */
.apply-success { text-align: center; padding: var(--sp-4) 0; }

.apply-success-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto var(--sp-5);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: var(--clr-success);
}

.apply-success-icon svg { width: 34px; height: 34px; }

.apply-success h3 {
  color: var(--clr-white);
  font-size: 1.3rem;
  margin-bottom: var(--sp-3);
}

.apply-success p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 40ch;
  margin: 0 auto var(--sp-6);
}

/* ---------- noscript fallback ---------- */
.careers-noscript {
  padding: var(--sp-6);
  border-radius: var(--radius-md);
  background: var(--clr-tertiary-glow);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--clr-gray-800);
}

/* No font-size under 16px on a phone, or iOS zooms the page on focus
   and never zooms back out. */
@media (max-width: 860px) {
  .jobs-input, .jobs-select { font-size: 16px; }
}

/* Small phone: every call to action gets the full width, matching how
   the home page hero behaves at this size. */
@media (max-width: 600px) {
  .careers-hero-actions,
  .careers-help-actions { flex-direction: column; align-items: stretch; }
  .careers-hero-actions .btn,
  .careers-help-actions .btn { width: 100%; justify-content: center; }
}
