/*
 * The /join/ signup page and the /welcome/ page after it (landing/assets/js/signup.js).
 * Builds on brand.css, and on landing.css for the header and footer.
 *
 * /join/: the pitch on the left (big Anton headline, offer cards), the form in a white card on the right.
 * On phones: headline, then the form, then the offer cards.
 */

/* The header floats over the page, so leave room for it. */
.join { position: relative; overflow: hidden; padding: calc(max(14px, env(safe-area-inset-top)) + 104px) 0 clamp(64px, 9vw, 120px); }
.join__glow { left: -30vmax; top: -40vmax; }
.join__grid {
  position: relative; z-index: 1;
  display: grid; gap: 32px;
  grid-template-columns: minmax(0, 1fr); /* lets the column shrink to the phone's width */
  grid-template-areas: 'intro' 'form' 'offers';
}
.join__intro { grid-area: intro; display: grid; gap: 22px; align-content: start; }
.join__card { grid-area: form; }
.join__offers { grid-area: offers; display: flex; flex-wrap: wrap; gap: 16px; align-content: start; }

@media (min-width: 960px) {
  .join__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    grid-template-areas: 'intro form' 'offers form';
    grid-template-rows: auto 1fr;
    column-gap: clamp(48px, 6vw, 96px); row-gap: 40px;
    align-items: start;
  }
  .join__intro { padding-top: 12px; }
}

/* Left: the pitch */
.join__title {
  margin: 0;
  font-family: 'Anton', Impact, sans-serif; font-weight: 400;
  font-size: clamp(48px, 7.4vw, 84px); line-height: 0.98;
  text-transform: uppercase; letter-spacing: 0.005em;
  text-wrap: balance;
}
.join__lead { margin: 0; font-size: 18px; line-height: 1.6; color: #D9D6DE; max-width: 520px; text-wrap: pretty; }

.offer-card {
  flex: 1 1 220px;
  display: flex; flex-direction: column; gap: 10px;
  padding: 24px; border-radius: 16px;
  border: 1px solid #2E2A36; background: #201D27;
}
.offer-card__price { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.offer-card__amount { font-family: 'Anton', Impact, sans-serif; font-size: 52px; line-height: 1; }
.offer-card__per { font-size: 15px; color: #B9B5C0; }
.offer-card__title { margin: 0; font-size: 16px; font-weight: 600; }
.offer-card__text { margin: 0; font-size: 14px; color: #B9B5C0; line-height: 1.55; }

/* Right: the white card with the form. Everything inside is dark-on-light. */
.join__card {
  --c-ink: #141019; --c-ink-2: #4A4553; --c-ink-3: #6E6878;
  --c-field: #F5F3F8; --c-line: #DCD7E3; --c-focus: var(--accent);
  --c-error: #C2185B;
  background: #fff; color: var(--c-ink);
  border-radius: 28px;
  box-shadow: 0 40px 120px -40px rgba(153, 0, 204, 0.55), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
  color-scheme: light;
}
.join__card-inner { padding: clamp(22px, 4vw, 40px); display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }

/* Form */
.signup__form { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.signup__field { display: grid; gap: 6px; }
.signup__field label { font-size: 13.5px; font-weight: 600; color: var(--c-ink-2); }
.signup__field small { font-size: 12.5px; color: var(--c-ink-3); }
.signup__field input, .signup__card {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 0;
  background: var(--c-field); color: var(--c-ink); font: inherit; font-size: 16px; /* 16px stops iOS zooming in */
  box-shadow: inset 0 0 0 1px var(--c-line); transition: box-shadow 0.3s var(--ease-out), background-color 0.3s var(--ease-out);
}
.signup__card { padding: 15px 14px; min-height: 50px; }
.signup__field input:focus, .signup__card.StripeElement--focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px var(--c-focus); }
.signup__field [aria-invalid='true'], .signup__card.StripeElement--invalid { box-shadow: inset 0 0 0 2px var(--c-error); }
/* Until Stripe's card form is in the box, say so: an empty box looks like a field you can type in. */
.signup__card.is-loading::before, .signup__card.is-failed::before { display: block; font-size: 15px; line-height: 20px; color: var(--c-ink-3); }
.signup__card.is-loading::before { content: 'Loading secure card form…'; }
.signup__card.is-failed::before { content: 'Card form unavailable'; color: var(--c-error); }
.signup__card.is-failed { box-shadow: inset 0 0 0 1px var(--c-error); }
.signup__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.signup__status { min-height: 1.4em; font-size: 14.5px; color: var(--c-ink-2); }
.signup__status.is-error { color: var(--c-error); }
.signup__status a { color: var(--c-ink); text-decoration: underline; }
.signup__form .btn[disabled] { opacity: 0.65; pointer-events: none; }
/* On phones the full-size button is wider than the card: same button, a notch smaller. */
@media (max-width: 480px) {
  .signup__form .btn--lg { --h: 58px; --icon: 42px; font-size: 15.5px; padding-left: 20px; gap: 8px; }
}
.signup__fine { font-size: 12.5px; line-height: 1.55; color: var(--c-ink-3); }
.signup__fine a, .join__card .signup__alt a { color: var(--c-ink-2); text-decoration: underline; text-underline-offset: 2px; }
.signup__alt { font-size: 13.5px; color: var(--c-ink-3); text-align: center; }
/* "Already a member? Sign in" in the white card: big enough to find at a glance. */
.join__card .signup__alt { font-size: 16px; font-weight: 600; color: var(--c-ink-2); }
.join__card .signup__alt a { font-weight: 700; color: var(--accent); text-decoration-thickness: 2px; }

/* /welcome/ (dark page, no white card) */
.welcome__inner { position: relative; z-index: 1; display: grid; gap: 22px; justify-items: start; padding-block: clamp(24px, 6vw, 80px); }
.welcome__lead strong { color: var(--ink); }
.welcome__lead a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.welcome__badges { margin-top: 10px; }
.welcome__badges img { height: 48px; }
.welcome__alt { text-align: left; color: var(--ink-3); }
.welcome__alt a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }

/* The countdown to go.plotsy.tv (computers only). */
.welcome__go {
  display: grid; gap: 6px; justify-items: start; margin-top: 6px;
  padding: 28px 32px; border-radius: 20px; border: 1px solid #2E2A36; background: #201D27;
}
.welcome__go[hidden] { display: none; }
.welcome__go-label { margin: 0; font-size: 16px; color: #D9D6DE; }
.welcome__count {
  margin: 0; font-family: 'Anton', Impact, sans-serif; font-size: clamp(120px, 14vw, 200px); line-height: 0.95;
  color: var(--accent); font-variant-numeric: tabular-nums; min-width: 1.2ch;
}
.welcome__go.is-stopped .welcome__count { display: none; }
.welcome__go-note { margin: 0 0 12px; font-size: 15px; color: #B9B5C0; }
.welcome__go-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.welcome__stay {
  border: 0; background: none; padding: 6px 0; font: inherit; font-size: 15px; color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.welcome__stay:hover { color: var(--ink); }
