/**
 * Abtech Candidate Portal — front end.
 * Inherits the theme's custom properties, with matching fallbacks.
 */
.abtp {
  --p-brown: var(--brown, #46281A);
  --p-dark: var(--brown-dark, #2E1810);
  --p-light: var(--brown-light, #6B4226);
  --p-gold: var(--gold, #C9911A);
  --p-bright: var(--gold-bright, #E8B33A);
  --p-pale: var(--gold-pale, #F5E3BC);
  --p-mist: var(--mist, #E5E2DD);
  --p-surface: var(--surface, #FFFFFF);
  --p-alt: var(--surface-alt, #F7F2E9);
  --p-text: var(--text, #3A3A3A);
  --p-muted: var(--text-muted, #6E6E6E);
  --p-font: var(--font, "Inter", system-ui, sans-serif);
  font-family: var(--p-font);
  color: var(--p-text);
  max-width: 900px;
  margin-inline: auto;
}
.abtp-auth { max-width: 520px; }

/* Header */
.abtp-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.abtp-eyebrow {
  margin: 0 0 2px; font-size: .74rem; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase; color: var(--p-gold);
}
.abtp-header h2 { margin: 0; color: var(--p-brown); font-size: 1.6rem; }

/* Tabs */
.abtp-tabs {
  display: flex; gap: 4px; overflow-x: auto; margin-bottom: -1px;
  border-bottom: 1px solid var(--p-mist);
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.abtp-tabs::-webkit-scrollbar { display: none; }
.abtp-tab { scroll-snap-align: start; }
.abtp-tab {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  flex: 0 0 auto;              /* never shrink — overflow and scroll instead */
  padding: 12px 16px; text-decoration: none; font-size: .92rem; font-weight: 500;
  color: var(--p-muted); border-bottom: 2px solid transparent;
}
.abtp-tab:hover { color: var(--p-brown); }
.abtp-tab.is-active { color: var(--p-brown); font-weight: 600; border-bottom-color: var(--p-gold); }
.abtp-count {
  background: var(--p-pale); color: var(--p-brown);
  border-radius: 999px; padding: 1px 8px; font-size: .74rem; font-weight: 700;
}

/* Panel */
.abtp-panel {
  background: var(--p-surface); border: 1px solid var(--p-mist);
  border-radius: var(--r, 16px); padding: 30px;
}
.abtp-panel h3 { color: var(--p-brown); margin: 28px 0 14px; font-size: 1.1rem; }
.abtp-panel h3:first-child { margin-top: 0; }

/* Notices */
.abtp-notice { padding: 13px 16px; border-radius: 8px; margin-bottom: 20px; font-size: .93rem; }
.abtp-notice--success { background: #E8F5EE; border-left: 3px solid #2E7D52; color: #1E5637; }
.abtp-notice--error { background: #FBE9E7; border-left: 3px solid #B03A2E; color: #7C2A20; }

/* Completeness meter */
.abtp-meter { background: var(--p-alt); border-radius: 12px; padding: 22px 24px; margin-bottom: 26px; }
.abtp-meter-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.abtp-meter-head strong { color: var(--p-brown); }
.abtp-meter-head span { font-size: 1.5rem; font-weight: 700; color: var(--p-gold); }
.abtp-meter-bar { height: 8px; background: var(--p-mist); border-radius: 999px; overflow: hidden; }
.abtp-meter-bar span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(135deg, #E8B33A, #C9911A); transition: width .5s ease;
}
.abtp-meter-note { margin: 12px 0 0; font-size: .88rem; color: var(--p-muted); }

/* Next steps */
.abtp-steps { display: grid; gap: 10px; }
.abtp-step {
  display: block; padding: 16px 18px; text-decoration: none;
  border: 1px solid var(--p-mist); border-left: 3px solid var(--p-gold);
  border-radius: 10px; transition: background .15s ease;
}
.abtp-step:hover { background: var(--p-alt); }
.abtp-step strong { display: block; color: var(--p-brown); margin-bottom: 3px; font-size: .97rem; }
.abtp-step span { font-size: .87rem; color: var(--p-muted); }

/* Stats */
.abtp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 26px 0; }
@media (max-width: 560px) { .abtp-stats { grid-template-columns: 1fr; } }
.abtp-stat {
  text-align: center; padding: 20px 14px; text-decoration: none;
  border: 1px solid var(--p-mist); border-radius: 10px;
}
.abtp-stat:hover { border-color: var(--p-gold); }
.abtp-stat-num { display: block; font-size: 1.9rem; font-weight: 700; color: var(--p-brown); line-height: 1; }
.abtp-stat-label { display: block; margin-top: 5px; font-size: .84rem; color: var(--p-muted); }

/* Trust block */
.abtp-trust { background: var(--p-pale); border-radius: 10px; padding: 18px 20px; margin-top: 26px; }
.abtp-trust strong { display: block; color: var(--p-brown); margin-bottom: 5px; font-size: .95rem; }
.abtp-trust p { margin: 0; font-size: .87rem; color: var(--p-light); }

/* Application cards */
.abtp-app { border: 1px solid var(--p-mist); border-radius: 12px; padding: 22px 24px; margin-bottom: 16px; }
.abtp-app.is-closed { opacity: .72; }
.abtp-app h3 { margin: 0 0 4px; font-size: 1.05rem; }
.abtp-app h3 a { color: var(--p-brown); text-decoration: none; }
.abtp-app h3 a:hover { color: var(--p-gold); }
.abtp-app-meta { margin: 0; font-size: .82rem; color: var(--p-muted); }
.abtp-app-status { margin: 14px 0 0; font-size: .89rem; color: var(--p-muted); }
.abtp-app-closed { margin: 14px 0 0; font-size: .89rem; color: var(--p-muted); }

/* Progress track */
.abtp-track {
  display: flex; list-style: none; margin: 22px 0 0; padding: 0; gap: 0;
  overflow-x: auto;
}
.abtp-track-step { flex: 1; min-width: 84px; position: relative; text-align: center; padding-top: 20px; }
.abtp-track-step::before {
  content: ""; position: absolute; top: 6px; left: 0; right: 50%;
  height: 2px; background: var(--p-mist);
}
.abtp-track-step::after {
  content: ""; position: absolute; top: 6px; left: 50%; right: 0;
  height: 2px; background: var(--p-mist);
}
.abtp-track-step:first-child::before,
.abtp-track-step:last-child::after { display: none; }
.abtp-track-step.is-done::before, .abtp-track-step.is-done::after,
.abtp-track-step.is-current::before { background: var(--p-gold); }
.abtp-track-dot {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--p-surface); border: 2px solid var(--p-mist);
}
.abtp-track-step.is-done .abtp-track-dot { background: var(--p-gold); border-color: var(--p-gold); }
.abtp-track-step.is-current .abtp-track-dot {
  border-color: var(--p-gold); background: var(--p-gold);
  box-shadow: 0 0 0 4px rgba(201,145,26,.22);
}
.abtp-track-label { font-size: .76rem; color: var(--p-muted); display: block; padding: 0 4px; }
.abtp-track-step.is-current .abtp-track-label { color: var(--p-brown); font-weight: 600; }

/* Saved jobs */
.abtp-saved-job {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--p-mist); flex-wrap: wrap;
}
.abtp-saved-job:last-child { border-bottom: 0; }
.abtp-saved-job h3 { margin: 0 0 3px; font-size: 1rem; }
.abtp-saved-job h3 a { color: var(--p-brown); text-decoration: none; }

/* Forms */
.abtp-form { margin: 0; }
.abtp-fieldset { border: 0; padding: 0; margin: 0 0 26px; }
.abtp-fieldset legend {
  padding: 0; margin-bottom: 14px; font-size: .78rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--p-gold);
}
.abtp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 620px) { .abtp-grid { grid-template-columns: 1fr; } }
.abtp-field { grid-column: 1 / -1; display: flex; flex-direction: column; }
.abtp-field--half { grid-column: span 1; }
.abtp-field label { font-size: .85rem; font-weight: 600; color: var(--p-brown); margin-bottom: 6px; }
.abtp-field input, .abtp-field select, .abtp-field textarea {
  padding: 11px 13px; border: 1px solid var(--p-mist); border-radius: 8px;
  font-family: var(--p-font); font-size: .94rem; background: var(--p-surface);
  color: var(--p-text); width: 100%;
}
.abtp-field input:focus, .abtp-field select:focus, .abtp-field textarea:focus {
  outline: 2px solid var(--p-gold); outline-offset: 0; border-color: var(--p-gold);
}
.abtp-hint { margin: 5px 0 0; font-size: .79rem; color: var(--p-muted); }

.abtp-check { display: flex; gap: 9px; align-items: flex-start; font-size: .89rem; margin-bottom: 8px; }
.abtp-check input { width: auto; margin-top: 3px; accent-color: #C9911A; flex-shrink: 0; }
.abtp-consent { margin: 6px 0 18px; color: var(--p-muted); }
.abtp-checks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 16px;
}

/* Buttons */
.abtp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; cursor: pointer; border: 1.5px solid transparent;
  font-family: var(--p-font); font-size: .93rem; font-weight: 600; text-decoration: none;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.abtp-btn:hover { transform: translateY(-1px); }
.abtp-btn-primary { background: linear-gradient(135deg, #E8B33A 0%, #C9911A 45%, #A87512 100%); color: var(--p-dark); }
.abtp-btn-ghost { border-color: var(--p-mist); color: var(--p-light); background: transparent; }
.abtp-btn-ghost:hover { border-color: var(--p-brown); color: var(--p-brown); }
.abtp-btn-danger { background: transparent; border-color: #B03A2E; color: #B03A2E; }
.abtp-btn-danger:hover { background: #B03A2E; color: #fff; }
.abtp-btn-sm { padding: 7px 15px; font-size: .82rem; }
.abtp-btn-block { width: 100%; }

/* Documents */
.abtp-upload { padding-bottom: 24px; margin-bottom: 20px; border-bottom: 1px solid var(--p-mist); }
.abtp-docs { display: grid; gap: 10px; }
.abtp-doc {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 16px; border: 1px solid var(--p-mist); border-radius: 10px; flex-wrap: wrap;
}
.abtp-doc-info strong { display: block; color: var(--p-brown); font-size: .94rem; word-break: break-word; }
.abtp-doc-info span { font-size: .8rem; color: var(--p-muted); }
.abtp-doc-actions { display: flex; gap: 8px; align-items: center; }
.abtp-doc-actions form { margin: 0; }

/* Empty states */
.abtp-empty { text-align: center; padding: 40px 20px; }
.abtp-empty h3 { margin: 0 0 8px; }
.abtp-empty p { color: var(--p-muted); font-size: .92rem; max-width: 46ch; margin: 0 auto 20px; }

/* Auth extras */
.abtp-auth-lede { color: var(--p-muted); font-size: .93rem; margin-bottom: 20px; }
.abtp-auth-alt { margin: 20px 0 0; font-size: .89rem; color: var(--p-muted); text-align: center; }
.abtp-reset { margin-top: 20px; border-top: 1px solid var(--p-mist); padding-top: 16px; }
.abtp-reset summary { cursor: pointer; font-size: .88rem; color: var(--p-light); }
.abtp-reset .abtp-form { margin-top: 14px; }

/* Danger zone */
.abtp-danger-zone { margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--p-mist); }
.abtp-danger-zone h3 { color: #B03A2E; }
.abtp-danger-zone > p { font-size: .89rem; color: var(--p-muted); }

/* Save button (used on job pages too, hence not scoped under .abtp) */
.abtp-save-wrap { margin-top: 24px; }
.abtp-save-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--mist, #E5E2DD); background: transparent;
  font-family: var(--font, inherit); font-size: .88rem; font-weight: 600;
  color: var(--brown-light, #6B4226); transition: all .15s ease;
}
.abtp-save-btn:hover { border-color: var(--gold, #C9911A); color: var(--brown, #46281A); }
.abtp-save-btn svg { width: 16px; height: 16px; }
.abtp-save-btn.is-saved {
  background: var(--gold-pale, #F5E3BC); border-color: var(--gold, #C9911A); color: var(--brown, #46281A);
}
.abtp-save-btn.is-saved svg { fill: var(--gold, #C9911A); }
.abtp-save-btn[disabled] { opacity: .6; cursor: wait; }

/* ==========================================================================
   MOBILE
   ==========================================================================
   The portal was built at desktop width and given almost no small-screen
   attention. On a phone the tab strip compressed, the application cards ran
   their details together, and the forms sat in columns too narrow to use.
   -------------------------------------------------------------------------- */
@media (max-width: 780px) {

  /* --- Tabs: a scrolling strip with a hint that there is more ------------ */
  .abtp-tabs {
    position: relative;
    gap: 2px;
    margin-inline: -16px;
    padding-inline: 16px;
    /* Fade the right edge so it is obvious the strip continues. */
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
            mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
  }
  .abtp-tab {
    padding: 13px 13px;
    font-size: .88rem;
  }
  .abtp-count { padding: 1px 6px; font-size: .7rem; }

  /* --- Panel ------------------------------------------------------------- */
  .abtp-panel { padding: 20px 16px; border-radius: 14px; }
  .abtp-header h2 { font-size: 1.3rem; }

  /* --- Application cards -------------------------------------------------
     The header row, meta line and status were laid out horizontally, which is
     what produced the squashed look. Everything stacks, with the status set
     apart by a rule so it reads as a separate piece of information.          */
  .abtp-app {
    padding: 18px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
  }
  .abtp-app-head {
    display: block;
  }
  .abtp-app h3 { font-size: 1rem; line-height: 1.35; margin-bottom: 6px; }
  .abtp-app-meta {
    display: flex; flex-wrap: wrap; gap: 4px 10px;
    font-size: .79rem; line-height: 1.5;
  }
  .abtp-app-status,
  .abtp-app-closed {
    margin-top: 14px; padding-top: 12px;
    border-top: 1px solid var(--p-mist);
    font-size: .85rem;
  }
  .abtp-app .abtp-status,
  .abtp-app .abtp-pill {
    margin-top: 10px;
    align-self: flex-start;
  }
  .abtp-app .button,
  .abtp-app .btn {
    width: 100%; justify-content: center; margin-top: 12px;
  }

  /* --- Forms -------------------------------------------------------------- */
  .abtp-form .form-grid,
  .abtp-grid { grid-template-columns: 1fr; gap: 14px; }
  .abtp-form input,
  .abtp-form select,
  .abtp-form textarea {
    font-size: 16px;   /* stops iOS zooming the page on focus */
  }
  .abtp-form .btn,
  .abtp-form button[type="submit"] { width: 100%; justify-content: center; }

  /* --- Documents ---------------------------------------------------------- */
  .abtp-doc {
    display: block;
    padding: 14px 16px;
  }
  .abtp-doc-meta { margin-top: 6px; font-size: .78rem; }
  .abtp-doc-actions { margin-top: 12px; display: flex; gap: 8px; }
  .abtp-doc-actions a,
  .abtp-doc-actions button { flex: 1 1 auto; text-align: center; }

  /* --- Stats and completeness --------------------------------------------- */
  .abtp-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .abtp-stat { padding: 14px; }
  .abtp-stat-num { font-size: 1.5rem; }
}

@media (max-width: 420px) {
  .abtp-stats { grid-template-columns: 1fr; }
  .abtp-tab { padding: 12px 11px; font-size: .84rem; }
}
