/* Waitlist plans page (waitlist.html, waitlist.js): plans.css, plus the
   join waitlist buttons. Sized in --p like the rest of the page. */

/* The button area sits at the bottom of the card, where the pill was. */
.wait { position: relative; margin-top: auto; }
.wait .pill-button { margin-top: 0; }

/* "join waitlist" opens into an email field of the same pill. */
.plans-page .wait__field,
.plans-page .wait__field:hover {
  width: 100%;
  min-width: 0;               /* the email box never widens its card */
  background: var(--white);
  cursor: text;
}
.wait__field[hidden], .wait__open[hidden] { display: none; }
.wait__field:focus-within { box-shadow: 0 0 0 calc(5 * var(--p)) var(--orange); }
.wait__field input {
  flex: 1;
  width: 0;                   /* its own default width would stretch the card */
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--black);
  font-family: 'Gambarino', serif;
  font-size: calc(28 * var(--p));
  letter-spacing: calc(-0.6 * var(--p));
  line-height: 1;
  -webkit-text-stroke: 0;
  outline: none;
}
.wait__field input::placeholder { color: var(--black); opacity: .45; }
.wait__send {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.wait__send:focus-visible { outline: calc(3 * var(--p)) solid var(--orange); outline-offset: calc(4 * var(--p)); border-radius: 4px; }
@media (min-width: 701px) {
  .wait__send:hover .pill-button__arrow { transform: translateX(calc(4 * var(--p))); }
}
.wait__form.is-busy .wait__send { opacity: .4; cursor: default; }

/* Joined: the pill turns green, then floods into joined.html (waitlist.js). */
.plans-page .wait__field.is-joined { background: var(--green); box-shadow: none; }
.plans-page .wait__field.is-joined > * { opacity: 0; transition: opacity 110ms ease; }
.flood--joined { background: var(--green); }

/* Coming back after joining: the pill is green and says so. */
.plans-page .wait__done,
.plans-page .wait__done:hover {
  width: 100%;
  background: var(--green);
  cursor: default;
}
.plans-page .plan--featured .wait__done { background: var(--white); }
.plans-page .wait__done:hover .pill-button__arrow { transform: none; }

/* What's happening, or what went wrong: a small bubble pointing at the pill.
   It takes its own room just above it (out of the space above the button),
   so it never covers the plan's features. */
.wait__note {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: calc(10 * var(--p)) 0 calc(14 * var(--p)) calc(18 * var(--p));
  padding: calc(9 * var(--p)) calc(16 * var(--p));
  border-radius: calc(16 * var(--p));
  background: var(--black);
  color: var(--white);
  font-family: 'Gambarino', serif;
  font-size: max(14px, calc(21 * var(--p)));
  letter-spacing: calc(-0.3 * var(--p));
  line-height: 1.2;
}
.wait__note::after {           /* the tail, pointing down at the pill */
  content: '';
  position: absolute;
  top: 100%;
  left: calc(22 * var(--p));
  border: calc(8 * var(--p)) solid transparent;
  border-top-color: inherit;
  border-bottom: 0;
}
.wait__note { border-color: var(--black); }
.wait__note:empty { display: none; }
.wait__note.is-error { background: var(--danger); border-color: var(--danger); }

@media (max-width: 700px) {
  .wait__field input { font-size: 16px; }   /* 16px or more stops iPhone zooming in */
}

/* "send me updates before launch": a tick box under the email field, shown
   while it's open. Off unless they tick it. */
.wait__updates {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--p));
  margin: calc(14 * var(--p)) 0 0 calc(18 * var(--p));
  font-family: 'Gambarino', serif;
  font-size: max(15px, calc(22 * var(--p)));
  letter-spacing: calc(-0.4 * var(--p));
  line-height: 1.15;
  cursor: pointer;
  user-select: none;
}
.wait__updates[hidden] { display: none; }
/* Under the tick box: what the email is for, with the privacy notice one tap away. */
.wait__privacy {
  margin: calc(10 * var(--p)) 0 0 calc(18 * var(--p));
  font-family: 'Gambarino', serif;
  font-size: max(13px, calc(18 * var(--p)));
  letter-spacing: calc(-0.3 * var(--p));
  line-height: 1.2;
  opacity: .75;
}
.wait__privacy[hidden] { display: none; }
.wait__privacy a { text-decoration: underline; text-underline-offset: .15em; }
.wait__privacy a:hover, .wait__privacy a:focus-visible { opacity: 1; background: var(--green); outline: none; }
.wait__updates input { position: absolute; opacity: 0; pointer-events: none; }
.wait__box {
  flex: none;
  position: relative;
  width: max(18px, calc(26 * var(--p)));
  height: max(18px, calc(26 * var(--p)));
  border: max(2px, calc(4 * var(--p))) solid var(--black);
  border-radius: calc(8 * var(--p));
  background: var(--white);
  transition: background-color 140ms ease;
}
.wait__box::after {            /* the tick */
  content: '';
  position: absolute;
  left: 30%;
  top: 10%;
  width: 30%;
  height: 55%;
  border: solid var(--white);
  border-width: 0 max(2px, calc(4 * var(--p))) max(2px, calc(4 * var(--p))) 0;
  transform: rotate(45deg) scale(0);
  transition: transform 160ms cubic-bezier(.3, 1.6, .5, 1);
}
.wait__updates input:checked + .wait__box { background: var(--black); }
.wait__updates input:checked + .wait__box::after { transform: rotate(45deg) scale(1); }
.wait__updates input:focus-visible + .wait__box { outline: max(2px, calc(3 * var(--p))) solid var(--orange); outline-offset: 2px; }
.plan--featured .wait__box { background: var(--green); }
.plan--featured .wait__updates input:checked + .wait__box { background: var(--black); }
