/* The existing waitlist layout, restyled with the app onboarding's palette, type, controls and motion. */
.onboarding-style {
  --signal: #185bcb;
  --interaction: #2563d4;
  --canvas-deep: #154999;
  --porcelain: #f8f7f4;
  --charcoal: #2f312f;
  --blue: var(--signal);
  --muted: #676a66;
  --rounded: ui-rounded, 'SF Pro Rounded', Nunito, 'M PLUS Rounded 1c', system-ui, -apple-system, sans-serif;
  color: var(--charcoal);
  background: var(--porcelain);
}
.onboarding-style ::selection { color: var(--canvas-deep); background: #dce6f7; }
.onboarding-style :where(a, button):focus-visible { outline-color: var(--signal); }
.onboarding-style a:hover { color: var(--signal); }
/* The header's one action, in the button's blue. */
.onboarding-style .nav-link { color: var(--signal); font-weight: 600; }
.onboarding-style .nav-link:hover { color: var(--interaction); }

/* SF Pro Rounded titles, as in every onboarding step. Browsers without it get Nunito, and M PLUS Rounded 1c for Greek. */
.onboarding-style h1 {
  font-family: var(--rounded);
  font-weight: 700;
  font-size: 66px;
  line-height: 1.04;
  letter-spacing: -.02em;
  color: var(--charcoal);
}
.onboarding-style .marked { font-family: var(--rounded); font-weight: 900; letter-spacing: -.04em; color: var(--signal); }
/* The promise leads: the second line is larger and heavier than the first. It's wider than the
   hero column on desktop, so its box reaches past the title on both sides to stay centred. */
.onboarding-style h1 .headline-row + .headline-row { margin-inline: -1em; font-size: 1.3em; font-weight: 900; letter-spacing: -.04em; }
.onboarding-style .pen-stroke { stroke: var(--signal); }

/* Controls use the onboarding's 16pt rounded rectangle instead of a pill. */
.onboarding-style .form-controls input {
  border-radius: 16px;
  /* 3:1 against Porcelain, so the field's edge reads without its fill. */
  border-color: #2f312f8c;
  background: #fff;
  color: var(--charcoal);
  caret-color: var(--signal);
}
.onboarding-style .form-controls input:hover { border-color: #2f312f4d; }
.onboarding-style .form-controls input:focus { border-color: var(--signal); outline-color: #185bcb2b; }
/* Grows to fit a longer translated label rather than wrapping it. */
.onboarding-style .join-control { width: auto; min-width: 160px; }
.onboarding-style .join-control button {
  white-space: nowrap;
  border-radius: 16px;
  background: var(--signal);
  font-weight: 600;
}
.onboarding-style .join-control button:active:not(:disabled) { background: var(--canvas-deep); }
.onboarding-style .invitation { color: var(--signal); }
.onboarding-style .form-note { max-width: calc(100% - 170px); }
@media (hover: hover) {
  .onboarding-style .join-control button:hover:not(:disabled) { background: var(--interaction); }
}


/* The footer closes on the onboarding canvas: deep blue with a darker arc across the top. */
.onboarding-style .brand-footer {
  background:
    radial-gradient(ellipse 110% 85% at 50% 0%, #113c7d 0%, #113c7d 45%, #113c7d00 80%),
    var(--canvas-deep);
}
.onboarding-style .footer-art img { filter: brightness(0) invert(1); opacity: .08; }
.onboarding-style .footer-meta { color: #ffffffc7; }
.onboarding-style .legal-links a:hover { color: #fff; }
.onboarding-style .brand-footer :where(a):focus-visible { outline-color: #ffffff99; }

@media (min-width: 1001px) and (max-width: 1100px) {
  .onboarding-style h1 { font-size: 58px; }
}
@media (max-width: 1000px) {
  /* The larger second line is about 10.1 times the title size wide; this keeps it on one row. */
  .onboarding-style h1 { font-size: min(62px, (100vw - 48px) / 10.3); letter-spacing: -.02em; }
  .onboarding-style .header nav { font-size: 13px; }
  .onboarding-style .availability { font-size: 12px; }
  .onboarding-style .waitlist { max-width: 420px; }
  .onboarding-style .join-control { width: auto; }
  .onboarding-style .join-control button { height: 54px; padding-inline: 18px; font-size: 15px; white-space: nowrap; }
  /* iPhone Safari zooms into any field under 16px; keep the page steady on focus. */
  .onboarding-style .form-controls input { height: 54px; font-size: 16px; }
  .onboarding-style .form-note { max-width: calc(100% - 150px); }
}
/* On the narrowest phones the field gets the full width so the placeholder is not cut off. */
@media (max-width: 374px) {
  .onboarding-style .form-controls { flex-direction: column; gap: 10px; }
  .onboarding-style .join-control { width: 100%; }
}

/* The onboarding's short rise and fade replaces the blurred 3D fold. */
@media (prefers-reduced-motion: no-preference) {
  .onboarding-style :is(.header, .headline-row, .intro, .waitlist, .footer-meta) {
    animation: rise-in 420ms cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: var(--entrance-delay, 0ms);
  }
  .onboarding-style .headline-row:first-child { --entrance-delay: 60ms; }
  .onboarding-style .headline-row + .headline-row { --entrance-delay: 120ms; }
  .onboarding-style .waitlist { --entrance-delay: 200ms; }
  .onboarding-style .footer-meta { --entrance-delay: 280ms; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* States that read without motion: attention in Coral, a joined form in Signal Blue. */
.onboarding-style .form-controls { position: relative; }
.onboarding-style .form-controls input:focus { outline: 3px solid #185bcb47; outline-offset: 1px; }
.onboarding-style .form-controls input[aria-invalid="true"] { border-color: #a94f46; }
.onboarding-style .form-controls input[aria-invalid="true"]:focus { outline-color: #a94f4640; }
/* The field's faint edge would otherwise override the stronger one in styles.css. */
@media (prefers-contrast: more) { .onboarding-style .form-controls input { border-color: #777; } }
.onboarding-style .form-note { font-size: 13px; }
.onboarding-style .waitlist.is-error .form-note { color: #a94f46; }
@media (max-width: 1000px) { .onboarding-style .form-note { font-size: 12px; } }
.onboarding-style .join-control button { position: relative; overflow: hidden; isolation: isolate; }
.onboarding-style .join-control button:disabled { cursor: default; }
.onboarding-style .waitlist.is-joined .join-control button::before {
  content: '';
  display: inline-block;
  width: .9em;
  height: .45em;
  margin: 0 .5em .2em 0;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  border-radius: 1px;
  transform: rotate(-45deg);
  vertical-align: middle;
}
.onboarding-style .waitlist.is-joined .join-control button { background: var(--signal); }
/* The toast shows success first. The note keeps its space and appears once the toast
   leaves, so the page never jumps and the confirmation stays on the page afterwards. */
.onboarding-style .waitlist.is-joined .form-note { color: var(--signal); transition: opacity 360ms ease-out; }
.onboarding-style .waitlist.is-joined.toast-open .form-note { opacity: 0; transition-duration: 120ms; }

/* The pets are touchable: a hop and a heart, nothing more. */
.onboarding-style .mascot { pointer-events: auto; transform-origin: 50% 100%; -webkit-user-drag: none; -webkit-touch-callout: none; }
.burst-heart { position: absolute; z-index: 3; width: 22px; height: 22px; opacity: 0; pointer-events: none; }
.burst-heart path { fill: var(--signal); }
.pulse-ring { position: absolute; z-index: 1; border: 2px solid; border-radius: 16px; opacity: 0; pointer-events: none; }

.onboarding-style .join-control button { transition: background-color 200ms, transform 260ms cubic-bezier(.34, 1.56, .64, 1); }
.onboarding-style .join-control button:active:not(:disabled) { transform: scale(.98); transition-duration: 90ms; }

@media (prefers-reduced-motion: no-preference) {

  /* Hero: the pets settle in after the headline. */
  .onboarding-style .mascot { animation: mascot-in 640ms cubic-bezier(.2, .7, .2, 1) both; }
  .onboarding-style .mascot--dog { animation-delay: 260ms; }
  .onboarding-style .mascot--cat { animation-delay: 360ms; }
  .onboarding-style .scene-edge { animation: fade-in 900ms ease-out 120ms both; }
  .onboarding-style .invitation path { stroke-dasharray: 1; animation: ink 650ms cubic-bezier(.2, .7, .2, 1) 1250ms both; }
  .onboarding-style .invitation span { animation: fade-in 400ms ease-out 1650ms both; }
  /* A light sweep while joining. It runs only as long as the request, on the compositor. */
  .onboarding-style .waitlist[aria-busy="true"] .join-control button::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(100deg, #ffffff00 30%, #ffffff38 50%, #ffffff00 70%);
    animation: pending-sheen 1100ms cubic-bezier(.45, .05, .55, .95) infinite;
  }
  .onboarding-style .waitlist.is-joined .join-control button::before { animation: tick-in 360ms cubic-bezier(.2, .7, .2, 1) 120ms both; }

  .motion-ready .onboarding-style .footer-art { opacity: 0; translate: 0 14px; transition: opacity 700ms ease-out, translate 900ms cubic-bezier(.2, .7, .2, 1); }
  /* The footer reveals the wordmark, so it rises with the links. */
  .motion-ready .onboarding-style .brand-footer.is-shown .footer-art { opacity: 1; translate: 0 0; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes mascot-in {
  from { opacity: 0; translate: 0 10px; scale: .98; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}
@keyframes pending-sheen {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
@keyframes tick-in {
  from { opacity: 0; transform: rotate(-45deg) scale(.6); }
  to { opacity: 1; transform: rotate(-45deg) scale(1); }
}

/* The butterfly and its trail share one drawing, so it can fly the trail it leaves. */
.onboarding-style .butterfly-flight { position: absolute; left: 0; top: 0; width: 400%; height: auto; overflow: visible; pointer-events: none; }
.onboarding-style .butterfly-path { stroke: var(--signal); stroke-width: 1.7; stroke-dasharray: 7 8; stroke-linecap: round; }
.onboarding-style .butterfly-trail-mask { fill: none; stroke: #fff; stroke-width: 8; stroke-linecap: round; }
.onboarding-style .butterfly-body image { pointer-events: auto; }
/* Hidden from the first paint until the flight starts, so it never shows at rest beforehand. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .onboarding-style .butterfly-flight:not(.has-taken-off) :is(.butterfly-body, .butterfly-path) { visibility: hidden; }
}
@media (max-width: 1000px) {
  .onboarding-style .butterfly-flight { width: 340%; left: -4px; }
  .onboarding-style .butterfly-path { stroke-width: 2.6; stroke-dasharray: 9 10; }
}
/* Tablets put the butterfly left of the pets, under the form, so its trail stops at the
   drawing's edge instead of running through "save me a spot". */
@media (min-width: 601px) and (max-width: 1000px) {
  .onboarding-style .butterfly-flight { clip-path: inset(-40px 0 -40px -40px); }
}

/* Success toast: Signal Blue, drops in from the top like a system notification. */
.join-toast {
  position: fixed;
  z-index: 20;
  top: calc(14px + var(--safe-top));
  left: 0;
  right: 0;
  width: min(400px, calc(100% - 24px));
  margin-inline: auto;
  filter: drop-shadow(0 16px 30px #0c2f7a3d) drop-shadow(0 3px 8px #0c2f7a2e);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.join-toast__surface {
  position: relative;
  overflow: hidden;
  padding: 14px 14px 16px 16px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(180deg, #2a6bd8 0%, #185bcb 55%, #1653bd 100%);
  box-shadow: inset 0 0 0 1px #ffffff24, inset 0 1px 0 #ffffff33;
}
.join-toast__row { display: flex; align-items: center; gap: 12px; }
.join-toast__icon { flex: none; width: 34px; height: 34px; }
.join-toast__icon circle { fill: #fff; }
.join-toast__icon path { fill: none; stroke: var(--signal); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.join-toast__text { flex: 1; min-width: 0; }
.join-toast__title { font-family: var(--rounded); font-size: 16px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.join-toast__message { margin-top: 1px; font-size: 13px; line-height: 1.4; color: #ffffffd1; }
.join-toast__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #ffffff24;
  cursor: pointer;
  transition: background-color 160ms, scale 200ms cubic-bezier(.34, 1.56, .64, 1);
}
.join-toast__close { position: relative; }
.join-toast__close::after { content: ''; position: absolute; inset: -7px; }
.join-toast__close svg { width: 12px; height: 12px; }
.join-toast__close path { stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.join-toast__close:hover { background: #ffffff3d; }
.join-toast__close:active { scale: .9; }
.join-toast__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.join-toast__timer { position: absolute; left: 16px; right: 16px; bottom: 6px; height: 2px; border-radius: 1px; background: #ffffff4d; transform-origin: 0 50%; }
@media (max-width: 600px) {
  .join-toast__title { font-size: 15px; }
}
