/* ==========================================================================
   Partner waitlist modal (marketing). A native <dialog> styled to match the
   onboarding-style contact form: progress bar, clean fields, AU mobile prefix.
   Opened from any [data-waitlist-open] trigger by waitlist.js.
   ========================================================================== */

.wl-dialog {
  width: 100%;
  max-width: 560px;
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  max-height: calc(100dvh - 2rem);
}
.wl-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
}

/* Entry animation */
.wl-dialog[open] { animation: wl-pop 0.18s ease-out; }
@keyframes wl-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .wl-dialog[open] { animation: none; }
}

.wl-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.wl-close:hover { background: var(--surface-2); color: var(--fg); }

.wl-card {
  padding: 32px clamp(20px, 5vw, 40px) clamp(24px, 4vw, 36px);
  overflow-y: auto;
  max-height: calc(100dvh - 2rem - 4px);
}

.wl-head { margin-bottom: 22px; }
.wl-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0;
}
.wl-subtitle {
  font-size: 0.95rem;
  color: var(--fg-2);
  margin: 6px 0 0;
}

.wl-form { display: flex; flex-direction: column; gap: 16px; }

.wl-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 460px) {
  .wl-grid-2 { grid-template-columns: 1fr; }
}

.wl-field { display: flex; flex-direction: column; gap: 6px; }

.wl-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-2);
}
.wl-optional { color: var(--fg-3); font-weight: 400; }

.wl-input {
  width: 100%;
  padding: 11px 13px;
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wl-input::placeholder { color: var(--fg-3); }
.wl-input:focus {
  outline: none;
  border-color: var(--fg);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}
.wl-textarea { resize: vertical; min-height: 76px; line-height: 1.5; }

.wl-help { font-size: 0.78rem; color: var(--fg-3); margin: 0; }
.wl-error { font-size: 0.78rem; color: #dc2626; margin: 0; }

/* Mobile with fixed AU country code */
.wl-tel { display: flex; align-items: stretch; }
.wl-tel-prefix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-right: none;
  border-radius: 11px 0 0 11px;
  white-space: nowrap;
}
.wl-flag { font-size: 1.05rem; line-height: 1; }
.wl-tel-input { border-radius: 0 11px 11px 0; }

/* Pill buttons — scoped to the modal so it stays self-contained on app pages
   that don't load landing.css (lp-btn/lp-btn-* live there). On marketing pages
   landing.css also defines these; the visuals match, this just wins by scope. */
#waitlist-modal .lp-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 10px 0 22px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform .25s ease, background-color .2s ease, border-color .2s ease, box-shadow .25s ease;
}
#waitlist-modal .lp-btn .lp-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 999px;
  transition: transform .25s ease, background-color .2s ease;
}
#waitlist-modal .lp-btn:hover { transform: translateY(-2px); }
#waitlist-modal .lp-btn:hover .lp-arrow { transform: translate(2px, -2px); }
#waitlist-modal .lp-btn-primary { background: var(--primary); color: var(--primary-fg); box-shadow: 0 10px 30px -12px rgba(0,0,0,0.5); }
#waitlist-modal .lp-btn-primary:hover { background: var(--primary-hover); }
#waitlist-modal .lp-btn-primary .lp-arrow { background: rgba(255,255,255,0.16); color: #fff; }
#waitlist-modal .lp-btn-ghost { background: var(--lp-glass-strong, var(--surface)); color: var(--fg); border-color: var(--border); }
#waitlist-modal .lp-btn-ghost:hover { background: #fff; border-color: var(--border-strong); }
#waitlist-modal .lp-btn-ghost .lp-arrow { background: var(--surface-2); color: var(--fg); }

/* Submit */
.wl-submit { width: 100%; justify-content: center; margin-top: 4px; }
.wl-submit-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wl-spin 0.6s linear infinite;
}
@keyframes wl-spin { to { transform: rotate(360deg); } }

/* HTMX request in flight: swap label/arrow for a spinner, lock the button */
.wl-form.htmx-request .wl-submit-label,
.wl-form.htmx-request .lp-arrow { display: none; }
.wl-form.htmx-request .wl-submit-spinner { display: inline-block; }
.wl-form.htmx-request .wl-submit { pointer-events: none; opacity: 0.85; }

/* Success state */
.wl-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 12px 4px 8px;
}
.wl-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  margin-bottom: 4px;
}
.wl-success .wl-subtitle { max-width: 36ch; }

/* Centre the label: lp-btn reserves asymmetric right padding for an arrow icon
   this button doesn't have, which otherwise pushes "Done" off-centre. */
.wl-success-close {
  align-self: center;
  justify-content: center;
  padding: 0 32px;
  margin-top: 8px;
}

/* ── Standalone /waitlist/ page ─────────────────────────────────────────────
   The wl-* rules above dress the form itself and are shared with the partner
   modal. Everything below is the full page only, and every rule that re-dresses
   a shared wl-* class is scoped under .wl-page so the modal on the marketing
   pages is left exactly as it was. */

.wl-page {
  min-height: 100dvh;
  margin: 0;
  /* The brand blue (--accent, #0070f3) held right down to a pale wash: enough
     that the page reads as WealthStacker rather than neutral grey, still a clear
     step below the white card and inputs sitting on top of it. The radial puts
     the light behind the headline, where the eye lands first. */
  background:
    radial-gradient(115% 80% at 50% -12%, rgba(0, 112, 243, 0.16), rgba(0, 112, 243, 0) 62%),
    #e4eaf3;
  background-attachment: fixed;
  color: var(--lp-ink);
}

/* Vertical rules, fixed so they never repaint while the page scrolls, and inert
   so they cannot eat a click. */
.wl-guides {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.6) 0 1px,
    transparent 1px 172px
  );
  background-position: center;
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
}

/* Entrance cascade. landing.css's .lp-reveal needs GSAP via landing.js, which
   this page does not load, so the stagger is pure CSS: each element declares
   --i and the delay falls out of it. */
.wl-page .wl-rise {
  animation: wl-rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes wl-rise {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .wl-page .wl-rise { animation: none; }
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.wl-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 0;
}
.wl-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--lp-ink);
  text-decoration: none;
}
.wl-nav-signin {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #3b4557;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.wl-nav-signin:hover { background: rgba(255, 255, 255, 0.75); color: var(--lp-ink); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.wl-hero {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  /* dvh, not vh: vh jumps by the toolbar height on iOS Safari. */
  min-height: calc(100dvh - 132px);
  padding: 56px 20px 72px;
}
.wl-hero-inner {
  width: 100%;
  max-width: 680px;
  text-align: center;
}

/* Three tiles standing in for the parts of the product the headline names. Dark
   glass, hairline top highlight, no glow. */
.wl-tiles {
  display: flex;
  justify-content: center;
  gap: 11px;
  margin-bottom: clamp(28px, 5vw, 40px);
}
.wl-tile {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 17px;
  color: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 12px 24px -14px rgba(17, 17, 19, 0.6);
}
/* Blue-black rather than neutral charcoal, so the tiles belong to the wash
   behind them. Each carries its own tint: property, performance, access. */
.wl-tile-1 { background: linear-gradient(160deg, #21304a, #101725); color: #cfe0fa; }
.wl-tile-2 { background: linear-gradient(160deg, #16283f, #0d1420); color: #a9d8c6; }
.wl-tile-3 { background: linear-gradient(160deg, #1d2a44, #0f1521); color: #e0cfa6; }

/* The one display serif in the product. Roman for the sentence, italic at a
   lighter weight for the two accent words, which is where the contrast comes
   from — not from size or colour. */
.wl-display {
  margin: 0;
  font-family: 'Playfair Display', 'Times New Roman', Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 7.4vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: -0.018em;
  color: #17171a;
}
.wl-display em {
  font-style: italic;
  font-weight: 500;
}

.wl-lede {
  max-width: 46ch;
  margin: 20px auto 0;
  font-size: 0.96rem;
  line-height: 1.6;
  color: #4c5666;
}

/* ── The card ────────────────────────────────────────────────────────────── */
/* A translucent tray, not a panel: it holds the white inputs a step above the
   page without drawing a border of its own. */
.wl-hero-card {
  max-width: 424px;
  margin: clamp(32px, 5vw, 44px) auto 0;
  padding: 15px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 2px rgba(24, 24, 27, 0.03),
    0 34px 64px -34px rgba(24, 24, 27, 0.32);
}

.wl-page .wl-hero-form { gap: 11px; }

/* Visually hidden but still announced, and still a click target for its input. */
.wl-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wl-page .wl-input {
  height: 52px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: #fff;
  font-size: 0.95rem;
  color: var(--lp-ink);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.05);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.wl-page .wl-input::placeholder { color: #8b96a6; }
.wl-page .wl-input:hover { box-shadow: 0 1px 3px rgba(24, 24, 27, 0.1); }
.wl-page .wl-input:focus {
  outline: none;
  border-color: rgba(24, 24, 27, 0.85);
  box-shadow: 0 0 0 4px rgba(24, 24, 27, 0.07);
}
.wl-page .wl-input[aria-invalid="true"] { border-color: rgba(220, 38, 38, 0.55); }
.wl-page .wl-input[aria-invalid="true"]:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}
.wl-page .wl-error { padding-left: 4px; }

/* Ink pill. The gradient is a two-stop tonal shift, dark to darker, so the face
   reads as a slightly convex surface rather than flat fill. */
.wl-page .wl-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  margin-top: 3px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(180deg, #3a3a3e, #131315 62%, #1c1c1f);
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #fff;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 22px -12px rgba(17, 17, 19, 0.7);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, filter 0.2s ease;
}
.wl-page .wl-submit:hover { filter: brightness(1.12); }
.wl-page .wl-submit:active { transform: scale(0.985); }
.wl-page .wl-submit:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 4px rgba(24, 24, 27, 0.18);
}
@media (prefers-reduced-motion: reduce) {
  .wl-page .wl-submit:active { transform: none; }
}

.wl-fineprint {
  margin: 12px 0 2px;
  font-size: 0.74rem;
  line-height: 1.5;
  color: #8b96a6;
  text-align: center;
}

.wl-page-signin {
  margin: 22px 0 0;
  font-size: 0.83rem;
  color: #64707f;
}
.wl-page-signin a {
  color: #3b4557;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wl-page-signin a:hover { color: var(--lp-ink); }

/* ── Success swap ────────────────────────────────────────────────────────── */
/* Scoped so the modal's version is untouched; the mark gets a hairline ring
   instead of reading as a flat green blob. */
.wl-page .wl-success {
  padding: 26px 18px 22px;
  animation: wl-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.wl-page .wl-success-icon {
  width: 58px;
  height: 58px;
  background: rgba(16, 185, 129, 0.1);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.24);
  color: #047857;
}
.wl-page .wl-title { font-size: 1.35rem; letter-spacing: -0.022em; }
.wl-page .wl-subtitle { font-size: 0.93rem; color: #4c5666; }

/* Small-caps confirmation line above the title: it says the submit landed, while
   the title says what that means. */
.wl-success-kicker {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #64707f;
}

/* Break, never overflow: a long address in a 424px card would otherwise widen
   the tray or run under its edge. */
.wl-success-email {
  font-weight: 600;
  color: var(--lp-ink);
  overflow-wrap: anywhere;
}

/* What happens next, set back from the confirmation itself. */
.wl-success-next {
  max-width: 34ch;
  margin: 2px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(24, 24, 27, 0.09);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #64707f;
}
.wl-page .wl-success-close {
  display: inline-flex;
  align-items: center;
  align-self: center;
  height: 42px;
  margin-top: 16px;
  padding: 0 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.86rem;
  font-weight: 500;
  color: #3b4557;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(24, 24, 27, 0.08);
}
.wl-page .wl-success-close:hover { background: #fff; color: var(--lp-ink); }
@media (prefers-reduced-motion: reduce) {
  .wl-page .wl-success { animation: none; }
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.wl-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 26px;
  font-size: 0.78rem;
  color: #8b96a6;
}
.wl-foot-links { display: flex; gap: 18px; }
.wl-foot a { color: #64707f; text-decoration: none; }
.wl-foot a:hover { color: var(--lp-ink); }
