/* =====================================================================
   PITANGA WEALTH — CAREERS PAGE STYLES
   Loaded after style.css / sections.css / inner-pages.css.

   Everything here is scoped to the careers page (body.careers-page) or
   uses the cr- prefix, so it cannot leak into the rest of the site.
   All colours, radii, shadows and easings are reused from the tokens
   already defined in style.css — no new design values are introduced.
   ===================================================================== */

/* ---------- HERO EXTRAS ---------- */

/* Small fact list under the hero actions */
.cr-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 26px;
  padding: 0;
  list-style: none;
}
.cr-hero-facts li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  font-weight: 600;
  color: #4f5a54;
  letter-spacing: .01em;
}
.cr-hero-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .52em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-green);
}

/* Hero art panel — live open-role counter + department breakdown */
.cr-board-body {
  position: relative;
  z-index: 1;
  padding: 26px 0 22px;
}
.cr-board-count {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(74px, 8vw, 104px);
  line-height: .82;
  letter-spacing: -.04em;
  color: #fff;
}
.cr-board-count span {
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.cr-board-copy {
  margin-top: 14px;
  max-width: 26ch;
  color: rgba(255, 255, 255, .72);
  font-size: 15px;
  line-height: 1.55;
}
.cr-board-depts {
  margin-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .16);
}
.cr-board-depts li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  font-size: 13.5px;
  color: rgba(255, 255, 255, .82);
}
.cr-board-depts b {
  font-family: var(--font-serif);
  font-style: normal;
  font-size: 19px;
  color: #a8e8b5;
  font-variant-numeric: tabular-nums;
}

/* ---------- ROLE FILTER TOOLBAR ---------- */

.cr-toolbar {
  margin-bottom: 26px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(150deg, #fff 40%, var(--sage-hover) 100%);
  box-shadow: 0 18px 44px rgba(8, 61, 45, .06);
}
.cr-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.cr-filter {
  /* 44px minimum height keeps every filter comfortably tappable */
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--deep-green);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .2s var(--ease);
}
.cr-filter:hover {
  background: var(--sage-hover);
  border-color: rgba(23, 138, 69, .4);
}
.cr-filter:active { transform: translateY(1px); }
.cr-filter.is-active {
  background: var(--deep-green);
  border-color: var(--deep-green);
  color: #fff;
}
.cr-filter:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 3px;
}

.cr-result-count {
  margin: 16px 2px 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #48524c;
}

/* ---------- ROLE LIST ---------- */

.cr-roles {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cr-role {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: #fff;
  box-shadow: 0 14px 36px rgba(8, 61, 45, .05);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.cr-role::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -70px;
  top: -70px;
  width: 190px;
  height: 190px;
  border: 2px solid rgba(23, 138, 69, .07);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(23, 138, 69, .022), 0 0 0 44px rgba(23, 138, 69, .016);
  pointer-events: none;
}
.cr-role:hover { border-color: rgba(23, 138, 69, .32); }
.cr-role.is-open {
  border-color: rgba(23, 138, 69, .45);
  box-shadow: 0 24px 54px rgba(8, 61, 45, .11);
}

.cr-role-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 24px 26px;
}

.cr-role-dept {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* Deep green rather than brand green: this is small text and needs 4.5:1 */
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--deep-green);
}
.cr-role-dept::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--brand-green);
  transform: rotate(45deg);
}

.cr-role-title {
  margin: 9px 0 0;
  font-size: clamp(19px, 2.1vw, 23px);
  line-height: 1.2;
  letter-spacing: -.025em;
  color: var(--deep-green);
}

.cr-role-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.cr-role-meta li {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--sage-hover);
  font-size: 12.5px;
  font-weight: 600;
  color: #4f5a54;
}

.cr-role-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.cr-role-apply { white-space: nowrap; }

.cr-role-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--deep-green);
  cursor: pointer;
  transition: color .2s var(--ease);
}
.cr-role-toggle:hover { color: var(--brand-green); }
.cr-role-toggle svg {
  transition: transform .3s var(--ease);
}
.cr-role-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.cr-role-toggle:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Expandable detail panel (height animated from js/careers.js) */
.cr-role-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s var(--ease);
}
.cr-role-panel-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 30px;
  padding: 4px 26px 26px;
  border-top: 1px solid var(--border);
  margin-top: 0;
  padding-top: 26px;
}
.cr-role-block h4 {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--deep-green);
}
.cr-role-block p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
}

.cr-ticks {
  margin: 0;
  padding: 0;
  list-style: none;
}
.cr-ticks li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 9px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}
.cr-ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .38em;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid rgba(23, 138, 69, .45);
  background:
    linear-gradient(transparent, transparent) padding-box,
    var(--sage-hover);
}
.cr-ticks li::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: .62em;
  width: 5px;
  height: 8px;
  border: solid var(--brand-green);
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(42deg);
}

.cr-role-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 13px 17px;
  border-left: 3px solid var(--brand-green);
  border-radius: 0 10px 10px 0;
  background: var(--sage-hover);
  font-size: 14px;
  color: #45504a;
}
.cr-role-note-block {
  margin-top: 30px;
  font-size: 14.5px;
  line-height: 1.65;
}
.cr-role-note a { color: var(--deep-green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.cr-role-note strong { color: var(--deep-green); }

.cr-role-applyrow {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding-top: 4px;
}
.cr-role-applyhint {
  font-size: 13px;
  color: #5a625d;
}

/* Empty state */
.cr-empty {
  margin-top: 20px;
  padding: 44px 30px;
  text-align: center;
  border: 1px dashed rgba(23, 138, 69, .4);
  border-radius: var(--r-card);
  background: #fff;
}
.cr-empty h3 { color: var(--deep-green); font-size: 21px; }
.cr-empty p { margin-top: 10px; color: var(--muted); }
.cr-empty a { color: var(--deep-green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- HIRING PROCESS STEPS ---------- */

.cr-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: cr-step;
}
.cr-step {
  position: relative;
  padding: 28px 24px 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(150deg, #fff 45%, var(--sage-hover) 100%);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.cr-step:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(8, 61, 45, .1);
}
/* Connector line between steps */
.cr-step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -14px;
  top: 46px;
  width: 12px;
  height: 1px;
  background: rgba(23, 138, 69, .35);
}
.cr-step-num {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--deep-green);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1;
}
.cr-step h3 {
  margin: 18px 0 9px;
  font-size: 18px;
  color: var(--deep-green);
}
.cr-step p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.68;
}
.cr-step a { color: var(--deep-green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- APPLY / DROP YOUR CV ---------- */

.cr-apply-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  gap: clamp(38px, 6vw, 76px);
  align-items: start;
}
.cr-apply-copy h2 {
  margin: 16px 0 0;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.04;
  letter-spacing: -.035em;
  color: var(--deep-green);
}
.cr-apply-copy h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}
.cr-apply-lead {
  margin-top: 20px;
  max-width: 56ch;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.72;
  color: var(--muted);
}
.cr-subhead {
  margin: 34px 0 14px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--deep-green);
}
.cr-checklist {
  margin: 0;
  padding: 0;
  list-style: none;
}
.cr-checklist li {
  position: relative;
  padding: 11px 0 11px 34px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  line-height: 1.6;
  color: #45504a;
}
.cr-checklist li:last-child { border-bottom: 0; }
.cr-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--sage-hover);
  border: 1.5px solid rgba(23, 138, 69, .4);
}
.cr-checklist li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 17.5px;
  width: 6px;
  height: 10px;
  border: solid var(--brand-green);
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

/* Right-hand application card */
.cr-apply-card {
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--border);
  border-radius: 26px;
  background: linear-gradient(155deg, #fff 40%, var(--sage-hover) 100%);
  box-shadow: 0 28px 66px rgba(8, 61, 45, .11);
}
.cr-dropzone {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 34px 22px;
  text-align: center;
  border: 2px dashed rgba(23, 138, 69, .38);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease),
              transform .25s var(--ease);
}
.cr-dropzone:hover,
.cr-dropzone:focus-visible {
  background: #fff;
  border-color: var(--brand-green);
}
.cr-dropzone:focus-visible {
  outline: 2px solid var(--deep-green);
  outline-offset: 3px;
}
.cr-dropzone.is-over {
  background: var(--sage-hover);
  border-color: var(--deep-green);
  transform: scale(1.012);
}
.cr-dropzone.has-file {
  border-style: solid;
  border-color: rgba(23, 138, 69, .6);
  background: var(--sage-hover);
}
/* Flagged by careers.js when the CV is missing or the wrong file type */
.cr-dropzone.is-invalid {
  border-color: #C0392B;
  background: #FDF3F2;
}
.cr-dropzone.is-invalid .cr-drop-title { color: #B4341F; }
.cr-drop-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--deep-green);
  color: #fff;
}
.cr-drop-title {
  font-size: 17px;
  color: var(--deep-green);
  word-break: break-word;
}
.cr-drop-sub {
  max-width: 34ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: #5a625d;
}

/* ---------- APPLICATION FORM ---------- */
/* Server-side failure notice (handler returned an error) */
.cr-form-error {
  margin-bottom: 20px;
  padding: 13px 16px;
  border: 1px solid rgba(192, 57, 43, .35);
  border-left: 3px solid #C0392B;
  border-radius: var(--r-sm);
  background: #FDF3F2;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  color: #8E2A20;
}

.cr-form-intro {
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 1.55;
  color: #5a625d;
}
.cr-req { color: #B4341F; font-weight: 700; }

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

.cr-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--deep-green);
}
.cr-input {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border: 1px solid rgba(8, 61, 45, .18);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--text-dark);
  font: inherit;
  font-size: 15px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.cr-input::placeholder { color: #9AA29C; }
.cr-input:hover { border-color: rgba(23, 138, 69, .45); }
.cr-input:focus {
  outline: none;
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(23, 138, 69, .16);
}
.cr-input:focus-visible { outline: 2px solid var(--deep-green); outline-offset: 2px; }
.cr-input.is-invalid {
  border-color: #C0392B;
  background: #FDF3F2;
}
.cr-textarea { min-height: 96px; resize: vertical; }

.cr-select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23083D2D' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  cursor: pointer;
}

.cr-error {
  margin: 7px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: #B4341F;
}
.cr-error::before { content: "! "; font-weight: 800; }

/* Honeypot: off-screen but not display:none, so bots still fill it */
.cr-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cr-form-submit { width: 100%; justify-content: center; margin-top: 6px; }
.cr-form-submit .arrow { transition: transform .3s var(--ease); }
.cr-form-submit:hover .arrow { transform: translateX(4px); }
.cr-form-submit:disabled { opacity: .6; cursor: not-allowed; }

.cr-form-note {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #5a625d;
}

/* ---------- THANK-YOU STATE ---------- */
.cr-success { text-align: center; padding: 8px 0 4px; }
.cr-success-icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--soft-sage);
  color: var(--brand-green);
}
.cr-success-title {
  font-size: clamp(21px, 2.4vw, 26px);
  letter-spacing: -.025em;
  color: var(--deep-green);
}
.cr-success-lead {
  margin-top: 12px;
  font-size: 15.5px;
  line-height: 1.62;
  color: #455049;
}
.cr-success-lead strong { color: var(--deep-green); }
.cr-success-list {
  margin: 22px 0 0;
  padding: 20px 22px;
  list-style: none;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .72);
}
.cr-success-list li {
  position: relative;
  padding-left: 24px;
  font-size: 14px;
  line-height: 1.55;
  color: #4a544d;
}
.cr-success-list li + li { margin-top: 10px; }
.cr-success-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-green);
}
.cr-success-role {
  margin-top: 18px;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--soft-sage);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--deep-green);
}
.cr-success .btn { margin-top: 24px; }

/* ---------- CLOSING CTA BUTTON ---------- */
/* The mini-cta sits on a deep-green gradient, so the button is inverted
   to stay visible (a .btn-primary would blend into the background). */
.cr-cta-mail {
  background: #fff;
  color: var(--deep-green);
  border-color: #fff;
}
.cr-cta-mail:hover {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .7);
}

/* ---------- ANCHOR OFFSET FOR THE FIXED HEADER ---------- */
#open-roles, #apply { scroll-margin-top: 100px; }

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1080px) {
  .cr-role-panel-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cr-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cr-step:not(:last-child)::after { display: none; }
}

@media (max-width: 900px) {
  .cr-apply-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .cr-role-head {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 22px 20px;
  }
  .cr-role-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .cr-role-panel-inner {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 22px 20px 24px;
  }
}

@media (max-width: 620px) {
  .cr-toolbar { padding: 18px; }
  .cr-filters { gap: 8px; }
  .cr-filter { flex: 1 1 auto; text-align: center; }
  .cr-steps { grid-template-columns: 1fr; }
  .cr-board-count { font-size: 72px; }
  .cr-field-row { grid-template-columns: 1fr; }
  .cr-success-list { padding: 16px 18px; }
}

@media (max-width: 420px) {
  .cr-role-actions { flex-direction: column-reverse; align-items: stretch; }
  .cr-role-actions .cr-role-apply { width: 100%; justify-content: center; }
  .cr-role-toggle { justify-content: center; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .cr-role-panel { transition: none; }
  .cr-step:hover,
  .cr-dropzone.is-over { transform: none; }
  .cr-role-toggle[aria-expanded="true"] svg { transition: none; }
}
