/* Join Me100 page (join.html). Builds on assets/checkout/checkout.css.
   Mobile: the "Already joined" card marquee with the sign-in sheet pinned
   to the bottom, collapsing to a plain parchment layout (body.jn-compact)
   once the visitor starts typing. Desktop splits marquee and form into
   two columns. */

.jn-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── "Already joined" marquee (same cards as preventive-health.html) ── */
.ldr-section {
  /* Soak up spare height so the sign-in sheet sits on the bottom edge. */
  flex: 1;
  min-width: 0;
  /* viewport-fit=cover draws under the iOS status bar; keep the heading clear of it. */
  padding: calc(10px + env(safe-area-inset-top, 0px)) 0 56px;
}
.ldr-section .wrap { padding: 0 16px; text-align: center; }
.ldr-section {
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--faint);
}

.eyebrow {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}


.ldr-section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: 'wght' 400, 'wdth' 100, 'CNTR' 10;
  font-size: 18px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.ldr-viewport { overflow: hidden; margin-top: 14px; padding: 6px 0; }
.ldr-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  width: max-content;
  animation: ldr-marquee 110s linear infinite;
}
@keyframes ldr-marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ldr-row { animation: none; } }

/* Card styling mirrors preventive-health.html. The card resets the type it
   would otherwise inherit from this page so it renders the same there and here. */
.ldr-card {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  width: 300px;
  aspect-ratio: 253.6 / 354.44;
  padding: 24px;
  overflow: hidden;
  border-radius: 20px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: normal;
  color: #fff;
  background: var(--ink) url('../card-bg.png') center / cover;
}
.ldr-card-top { display: flex; align-items: center; justify-content: space-between; }
.ldr-card-logo { height: 15px; width: auto; }
.ldr-card-domain {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  text-transform: lowercase;
  white-space: nowrap;
}
.ldr-card-avatar-wrap { display: flex; justify-content: center; margin: 28px 0 16px; }
.ldr-card-avatar {
  width: 92px;
  height: 92px;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}
.ldr-card-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ldr-card-name,
.ldr-card-profession,
.ldr-card-quote { font-family: 'Cormorant Garamond', serif; text-align: center; }
.ldr-card-name { font-weight: 500; font-size: 22px; line-height: 1.2; color: var(--parchment); }
.ldr-card-profession { margin-top: 4px; font-size: 16.5px; line-height: 1.35; color: #FF7600; }
.ldr-card-joined-badge {
  margin-top: auto;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  background: rgba(214, 99, 0, 0.07);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}
.ldr-card-divider { height: 1px; margin-top: 14px; background: rgba(255, 255, 255, 0.16); }
.ldr-card-quote {
  padding-top: 14px;
  font-style: italic;
  font-size: 16px;
  line-height: 1.25;
  color: var(--parchment);
}
/* Mobile: preventive-health's 225px card, scaled down as a whole when the
   screen is too short to show it above the sign-in sheet. --u is one design
   pixel: the card's height (314.5) shares what the heading and sheet leave. */
@media (max-width: 600px) {
  .ldr-viewport {
    --u: clamp(0.6px, (100dvh - 418px - env(safe-area-inset-bottom, 0px)) / 314.5, 1px);
  }
  .ldr-row { gap: calc(20 * var(--u)); }
  .ldr-card {
    width: calc(225 * var(--u));
    padding: calc(18 * var(--u));
    border-radius: calc(20 * var(--u));
  }
  .ldr-card-logo { height: calc(13 * var(--u)); }
  .ldr-card-domain {
    padding: calc(4 * var(--u)) calc(9 * var(--u));
    border-radius: calc(6 * var(--u));
    font-size: calc(11 * var(--u));
  }
  .ldr-card-avatar-wrap { margin: calc(18 * var(--u)) 0 calc(12 * var(--u)); }
  .ldr-card-avatar { width: calc(66 * var(--u)); height: calc(66 * var(--u)); }
  .ldr-card-name { font-size: calc(18 * var(--u)); }
  .ldr-card-profession { margin-top: calc(4 * var(--u)); font-size: calc(14 * var(--u)); }
  .ldr-card-joined-badge {
    margin-top: calc(10 * var(--u));
    padding: calc(8 * var(--u)) calc(10 * var(--u));
    border-radius: calc(10 * var(--u));
    font-size: calc(11 * var(--u));
  }
  .ldr-card-divider { margin-top: calc(14 * var(--u)); }
  .ldr-card-quote { padding-top: calc(12 * var(--u)); font-size: calc(13.5 * var(--u)); }
}

/* ── Sign-in sheet ── */
.jn-main {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: -16px;
  border-radius: 16px 16px 0 0;
  background: var(--parchment);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
}
.jn-bar { display: none; }
.jn-sheet { padding: 20px 16px max(8px, env(safe-area-inset-bottom, 0px)); }

.jn-step { display: flex; flex-direction: column; gap: 24px; }
.jn-step-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: -12px; }
.jn-step-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.jn-actions { display: flex; flex-direction: column; gap: 16px; }
.jn-otp-fields { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.jn-otp-fields .fl-field { align-self: stretch; }
.jn-otp-fields .fl-error { margin-top: -8px; }
.jn-otp-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.jn-phone-number { white-space: nowrap; }

/* ── Compact (mobile, once the visitor engages with the form) ── */
body.jn-compact .ldr-section { display: none; }
body.jn-compact .jn-main {
  position: static;
  flex: 1;
  margin-top: 0;
  border-radius: 0;
  box-shadow: none;
}
body.jn-compact .jn-bar { display: flex; padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
body.jn-compact .jn-sheet { padding: 12px 16px max(8px, env(safe-area-inset-bottom, 0px)); }
/* Continue sits right under the field so the keyboard never covers it. */
body.jn-compact .jn-actions,
body.jn-compact .jn-name-actions { margin-top: 16px; }

/* Keyboard open (join.js sets --jn-kb-vh to the height above it): fill that
   space and dock the step's buttons 8px over the keyboard. */
body.jn-kb-open .jn-page { min-height: var(--jn-kb-vh); }
body.jn-kb-open .jn-main,
body.jn-kb-open .jn-sheet,
body.jn-kb-open .jn-step { display: flex; flex: 1; flex-direction: column; }
body.jn-kb-open .jn-sheet { padding-bottom: 8px; }
body.jn-kb-open .jn-actions,
body.jn-kb-open .jn-otp-actions,
body.jn-kb-open .jn-name-actions { margin-top: auto; }

/* ── Desktop: marquee left, form right ── */
@media (min-width: 900px) {
  .jn-page { flex-direction: row; }

  .ldr-section,
  body.jn-compact .ldr-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 0 0 50%;
    min-height: 100vh;
    padding: 48px 0;
    border-right: 1px solid var(--rule);
  }
  .ldr-section .wrap { padding: 0 clamp(40px, 5vw, 72px); }
  .ldr-section h2 { font-size: 18px; }

  .jn-main,
  body.jn-compact .jn-main {
    position: static;
    display: flex;
    flex: 1;
    flex-direction: column;
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .jn-bar,
  body.jn-compact .jn-bar { display: flex; justify-content: flex-end; padding: 28px 40px; }
  .jn-bar .fl-logo { display: none; }
  .jn-sheet,
  body.jn-compact .jn-sheet { width: 100%; max-width: 440px; margin: auto; padding: 0 24px 96px; }
  body.jn-compact .jn-actions,
  body.jn-compact .jn-name-actions { margin-top: 0; }
}
