/* ==========================================================================
   SubjectRX — join.css
   Page-specific styles for join.html only.
   Global form base (field-input, field-label, consent-wrap etc.) comes
   from global.css. This file handles the join-page layout, tab system,
   step list, and custom country select component.
   ========================================================================== */


/* ─────────────────────────────────────────────────────────────────────────
   HERO — full-bleed image with right-aligned content
   Unique to join: uses a background image with directional overlay.
   ───────────────────────────────────────────────────────────────────────── */
.join-hero {
  padding-top: var(--nav-h, 52px);
  position: relative;
  min-height: 58vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--g-dark);
}

.join-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 20% 18%;
  opacity: 0.85;
}

/* Directional gradient: face left, text right */
.join-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(7, 30, 20, .12) 0%,
    rgba(7, 30, 20, .42) 40%,
    rgba(7, 30, 20, .80) 100%
  );
}

/* Subtle bottom depth */
.join-hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(to top, rgba(7, 30, 20, .48) 0%, transparent 100%);
}

.join-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 44px;
  display: flex;
  justify-content: flex-end;
}

.join-hero-content {
  max-width: 460px;
  text-align: right;
  padding: 72px 0;
}

.join-hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .35);
  display: block;
  margin-bottom: 18px;
}

.join-hero-rule {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, .2);
  margin-bottom: 22px;
}

.join-hero-h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(34px, 4.4vw, 54px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.04;
  letter-spacing: -.018em;
  color: var(--white);
  margin-bottom: 20px;
}

.join-hero-sub {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.72;
  color: rgba(255, 255, 255, .52);
  margin-left: auto;
}

@media (max-width: 860px) {
  .join-hero {
    min-height: 70vw;
    align-items: flex-end;
  }

  .join-hero-inner {
    padding: 0 22px;
    justify-content: flex-start;
  }

  .join-hero-content {
    text-align: left;
    max-width: 540px;
    padding: 44px 0;
  }

  .join-hero-overlay {
    background: linear-gradient(
      to top,
      rgba(7, 30, 20, .85) 0%,
      rgba(7, 30, 20, .4) 60%,
      rgba(7, 30, 20, .15) 100%
    );
  }

  .join-hero-sub {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .join-hero {
    min-height: 85vw;
  }

  .join-hero-h1 {
    font-size: clamp(28px, 8vw, 38px);
  }
}


/* ─────────────────────────────────────────────────────────────────────────
   TWO-COLUMN BODY — left narrative, right form panel
   ───────────────────────────────────────────────────────────────────────── */
.body-wrap {
  display: grid;
  grid-template-columns: 1fr 460px;
  align-items: stretch;
  border-top: 1px solid var(--bdr);
}

@media (max-width: 1024px) {
  .body-wrap {
    grid-template-columns: 1fr 380px;
  }
}

@media (max-width: 860px) {
  .body-wrap {
    grid-template-columns: 1fr;
  }

  .right-col {
    border-top: 1px solid var(--bdr);
  }
}


/* ─────────────────────────────────────────────────────────────────────────
   LEFT COLUMN — brand narrative and how-it-works steps
   ───────────────────────────────────────────────────────────────────────── */
.left-col {
  background: var(--cream);
  border-right: 1px solid var(--bdr);
  padding: 64px 64px 80px;
}

.section-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sage);
  display: block;
  margin-bottom: 28px;
}

.left-prose {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.78;
  color: var(--muted);
  margin-bottom: 20px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--bdr-lt);
}

.left-prose + .left-prose {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 40px;
}

.left-prose--redirect {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 32px;
  margin-bottom: 0;
}

.left-prose--redirect a {
  color: var(--g);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* How it works — step list */
.how-steps-heading {
  font-family: 'Inter', sans-serif;
  font-size: clamp(14px, 1.4vw, 17px);
  font-weight: 300;
  line-height: 1.28;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: 24px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--bdr-lt);
}

.step-item:first-child {
  border-top: 1px solid var(--bdr-lt);
}

.step-num {
  font-family: 'DM Mono', monospace;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--bdr);
  flex-shrink: 0;
  width: 28px;
  padding-top: 2px;
}

.step-icon {
  flex-shrink: 0;
  padding-top: 1px;
  margin-right: 14px;
}

.step-icon svg {
  display: block;
  stroke: var(--g);
  fill: none;
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.step-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}

.step-body-text {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 300;
  color: var(--sage);
  line-height: 1.68;
}

@media (max-width: 1024px) {
  .left-col {
    padding: 52px 44px 64px;
  }
}

@media (max-width: 860px) {
  .left-col {
    border-right: none;
    padding: 44px 22px 52px;
  }
}


/* ─────────────────────────────────────────────────────────────────────────
   RIGHT COLUMN — tab-switched forms
   ───────────────────────────────────────────────────────────────────────── */
.right-col {
  background: var(--white);
  display: flex;
  flex-direction: column;
}

/* Tab navigation — converted to accessible button pattern in join.js */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--bdr-lt);
  flex-shrink: 0;
  role: tablist; /* set in HTML — noted here for clarity */
}

.tab-btn {
  padding: 16px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  color: #9AAFA7;
  text-align: center;
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  transition: color .15s, border-color .15s;
  user-select: none;
  width: 100%;
}

.tab-btn:first-child {
  border-right: 1px solid var(--bdr-lt);
}

.tab-btn[aria-selected="true"] {
  color: var(--g);
  border-bottom-color: var(--g);
}

.tab-btn:hover:not([aria-selected="true"]) {
  color: var(--ink);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

/* Form panels */
.form-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  opacity: 0;
  transition: opacity .22s ease;
}

.form-panel[aria-hidden="false"] {
  display: flex;
  opacity: 1;
}

.form-wrap {
  padding: 32px 36px 40px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.form-intro {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--bdr-lt);
}

/* Join form field labels — uppercase variant */
.form-wrap .field-label {
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sage);
}

/* Form footer — submit + note */
.form-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--bdr-lt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-note {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  color: #A0A89E;
  line-height: 1.5;
}

/* Join consent — slightly tighter than global due to form density */
.join-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.join-consent input[type="checkbox"] {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--g);
}

.join-consent-text {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--sage);
  line-height: 1.6;
}

.join-consent-text a {
  color: var(--g);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 1024px) {
  .form-wrap {
    padding: 28px 28px 36px;
  }
}

@media (max-width: 860px) {
  .form-wrap {
    padding: 24px 22px 32px;
  }

  .btn-submit {
    width: 100%;
    justify-content: center;
  }

  .form-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ─────────────────────────────────────────────────────────────────────────
   CUSTOM COUNTRY SELECT COMPONENT
   Searchable listbox. ARIA implemented in join.js.
   ───────────────────────────────────────────────────────────────────────── */
.cs-wrap {
  position: relative;
}

.cs-trigger {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--bdr);
  border-radius: 3px;
  padding: 10px 36px 10px 13px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  outline: none;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}

.cs-trigger:focus,
.cs-trigger.open {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(46, 106, 87, .09);
}

.cs-trigger.placeholder {
  color: #C0B8B0;
  font-style: italic;
}

.cs-trigger.has-error {
  border-color: var(--err);
  background: var(--err-bg);
}

.cs-chevron {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.cs-chevron svg {
  display: block;
  stroke: var(--sage);
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s;
}

.cs-trigger.open + .cs-chevron svg {
  transform: rotate(180deg);
}

.cs-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--white);
  border: 1px solid var(--bdr);
  border-radius: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
  display: none;
  flex-direction: column;
  max-height: 260px;
}

.cs-panel.open {
  display: flex;
}

.cs-search-wrap {
  padding: 10px 12px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--bdr-lt);
}

.cs-search {
  width: 100%;
  background: var(--cream);
  border: 1px solid var(--bdr);
  border-radius: 3px;
  padding: 7px 11px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.cs-search:focus {
  border-color: var(--focus);
}

.cs-search::placeholder {
  color: #B8B0A6;
  font-style: italic;
}

.cs-list {
  overflow-y: auto;
  flex: 1;
}

.cs-opt {
  padding: 9px 13px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  transition: background .12s;
}

.cs-opt:hover,
.cs-opt[aria-selected="true"] {
  background: var(--cream);
}

.cs-opt.selected {
  color: var(--g);
  font-weight: 500;
}

.cs-empty {
  padding: 12px 13px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--sage);
  display: none;
}

.cs-empty.visible {
  display: block;
}


/* Reduced motion is handled globally in global.css */
