/* Shared chrome for the two signed-in pages: /join and /app.
   The landing page keeps its own styles — it is marketing, these are tools,
   and they have different jobs. */

:root {
  --paper: #FAFBF9;
  --surface: #FFFFFF;
  --ink: #0E1F18;
  --muted: #5A6B63;
  --line: #E1E7E2;
  --accent: #0B8043;
  --accent-soft: #E7F4EC;
  --on-accent: #FFFFFF;
  --bridge: #075E39;
  --bridge-soft: #E3F1E8;
  --danger: #B3341F;
  --danger-soft: #FBEBE8;
  --warn: #8A5A00;
  --warn-soft: #FDF3DE;
  --shadow: 0 1px 2px rgba(16,30,43,.04), 0 8px 24px rgba(16,30,43,.06);
  --radius: 14px;

  /* WhatsApp's own colours, for the chat surfaces only. */
  --wa-chat: #EFE7DE;
  --wa-in: #FFFFFF;
  --wa-out: #D9FDD3;
  --wa-ink: #101B14;
  --wa-muted: #667781;
  --wa-bar: #F0F2F5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0A1410;
    --surface: #111E18;
    --ink: #E9F1EC;
    --muted: #93A79D;
    --line: #21332B;
    --accent: #35D07E;
    --accent-soft: #0E2A1C;
    --on-accent: #06251A;
    --bridge: #52D6A0;
    --bridge-soft: #0C2A21;
    --danger: #FF7A66;
    --danger-soft: #2C1512;
    --warn: #E8C06A;
    --warn-soft: #2A2110;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);

    --wa-chat: #0B141A;
    --wa-in: #202C33;
    --wa-out: #005C4B;
    --wa-ink: #E9EDEF;
    --wa-muted: #8696A0;
    --wa-bar: #202C33;
  }
}

* { box-sizing: border-box; }

html { scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; font-weight: 640; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: .95rem; }
p { margin: 0; }
a { color: inherit; }

.bar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.logo { font-weight: 660; text-decoration: none; letter-spacing: -.02em; }
.bar .lang { margin-left: auto; }
.bar .who { margin-left: auto; font-size: .88rem; color: var(--muted); }
.bar .who + .lang { margin-left: 0; }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button {
  border: 0; background: none; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 600;
  color: var(--muted); padding: 4px 11px; border-radius: 999px;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* The account menu (/app): language, billing and signing out, out of the way. */
.menu { position: relative; margin-left: auto; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 7px 12px; font: inherit; font-size: .9rem; cursor: pointer;
}
.menu-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.menu-btn #who:empty { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  min-width: 220px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(16,30,43,.14);
  display: flex; flex-direction: column; gap: 4px;
}
.menu-panel[hidden] { display: none; }
.menu-panel .lang { margin: 0 0 6px; align-self: flex-start; }
.menu-item {
  text-align: left; border: 0; background: none; font: inherit; font-size: .92rem;
  color: var(--ink); padding: 9px 10px; border-radius: 8px; cursor: pointer;
}
.menu-item:hover { background: var(--bridge-soft); }
.menu-item[hidden] { display: none; }

.sheet { max-width: 620px; margin: 0 auto; padding: clamp(28px, 6vw, 56px) 22px 80px; }
.wide-sheet { max-width: 860px; }

.eyebrow {
  font-size: .76rem; font-weight: 660; letter-spacing: .1em;
  text-transform: uppercase; color: var(--bridge); margin-bottom: 10px;
}
.lede { color: var(--muted); margin-top: 14px; }

.field { display: block; margin-top: 22px; border: 0; padding: 0; }
.field > span, .field legend { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 7px; padding: 0; }
.field small { display: block; color: var(--muted); font-size: .82rem; margin-top: 7px; }

input, select {
  width: 100%; font: inherit; font-size: .97rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); opacity: .75; }
input:focus, select:focus {
  outline: none; border-color: var(--bridge);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bridge) 16%, transparent);
}

/* The honeypot. Without this it renders as a visible "do not fill" box,
   which is exactly what it must not be. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.pair-row { display: flex; align-items: center; gap: 10px; }
.swap { color: var(--muted); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--on-accent); border: 0; border-radius: 10px;
  padding: 13px 22px; font: inherit; font-weight: 620; font-size: .97rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: filter .15s, transform .12s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.wide { width: 100%; margin-top: 28px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface); filter: none; }
.btn.small { padding: 9px 15px; font-size: .88rem; }

:is(a, button, input, select):focus-visible { outline: 2px solid var(--bridge); outline-offset: 2px; }

.status { margin-top: 14px; font-size: .92rem; font-weight: 560; min-height: 1.4em; color: var(--muted); }
.status[data-tone="error"] { color: var(--danger); }
.status[data-tone="ok"] { color: var(--bridge); }

.fine { color: var(--muted); font-size: .84rem; margin-top: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  margin-top: 18px;
}
.card > h2 { margin-bottom: 4px; }

.note { border-radius: var(--radius); padding: 18px 20px; margin-top: 24px; background: var(--bridge-soft); }
.note strong { display: block; margin-bottom: 6px; }
.note p { color: var(--muted); font-size: .92rem; }
.note[data-tone="warn"] { background: var(--warn-soft); }
.note[data-tone="warn"] strong { color: var(--warn); }
.note[data-tone="error"] { background: var(--danger-soft); }
.note[data-tone="error"] strong { color: var(--danger); }

.rows { display: grid; gap: 2px; margin-top: 16px; }
.row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .94rem;
}
.row:last-child { border-bottom: 0; }
.row dt { color: var(--muted); flex: none; min-width: 9.5em; margin: 0; }
.row dd { margin: 0; font-weight: 560; }

.meter { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 12px; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .5s ease; }
.meter[data-tone="over"] i { background: var(--warn); }
.meter[data-tone="hard_cap"] i { background: var(--danger); }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
@media (max-width: 620px) { .tiers { grid-template-columns: 1fr; } }
.tier {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; background: var(--surface); display: flex; flex-direction: column; gap: 4px;
}
.tier.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tier .price { font-size: 1.7rem; font-weight: 660; letter-spacing: -.03em; }
.tier .price span { font-size: .85rem; font-weight: 500; color: var(--muted); }
.tier small { color: var(--muted); font-size: .85rem; }
.tier .btn { margin-top: 12px; }
.tier .badge {
  font-size: .7rem; font-weight: 680; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); margin-top: 12px;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.skeleton { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---------------------------------------------------------------------------
   The phone, for pages that ask questions.
   A form that looks like the product it sells: /join collects its answers as a
   WhatsApp conversation rather than a stack of labelled inputs.
   --------------------------------------------------------------------------- */

/* /join: the copy sits beside the phone on a wide screen, so the whole thing
   fits without scrolling. Stacked it was taller than the viewport, which meant
   a scrollbar appeared on load and shunted the layout sideways — the jump. */
.join { max-width: 1040px; margin: 0 auto; padding: clamp(36px, 6vw, 64px) 22px 72px; }
.join-copy { max-width: 34em; }

@media (min-width: 1000px) {
  .join {
    display: grid;
    /* A fixed track for the phone, not `auto`. As `auto` the column sized to
       its own content, so the moment a message arrived carrying a long email
       address the column grew and crushed the copy beside it into one word per
       line. The frame's width is not the chat's business. */
    grid-template-columns: minmax(280px, 1fr) 340px;
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
    min-height: calc(100dvh - 63px);
    padding-block: 0 24px;
    /* The stage the phone is tilted on. Matches the landing page's
       `.dsite .device-stage`, so the same object appears on every page. */
    perspective: 1600px;
  }

  /* Only from here up. Below this width the phone IS the form — full width,
     keyboard open, thumb on the send button — and tilting the thing someone is
     typing into buys a nice photo at the cost of the actual interaction. */
  .join .phone {
    /* Both dimensions from one number, in the landing device's exact
       proportions (326 × 654).

       Sizing this by width is what made it look wrong: at 390 wide and 620 tall
       the frame was far squatter than a real handset, and rotating a squat box
       reads as squashed rather than as a phone at an angle. `aspect-ratio`
       alone didn't fix it either — a grid item stretches to its track, so the
       ratio lost the argument and the shape drifted with the viewport. Doing
       the arithmetic here takes the negotiation away: it shrinks in both
       dimensions on a short screen instead of going stubby. */
    --frame-h: min(654px, 76vh);
    height: var(--frame-h);
    width: calc(var(--frame-h) * 326 / 654);
    justify-self: center;
    margin: 0;
    transform: rotateY(8deg) rotateZ(-6deg);
    transform-style: preserve-3d;
  }

  /* Fill the frame it's now inside, rather than setting its own height. */
  .join .phone .screen { height: 100%; }
}

.phone {
  position: relative;
  width: min(390px, 100%);
  margin: 34px auto 0;
  padding: 12px;
  border-radius: 46px;
  background: linear-gradient(150deg, #4A5450 0%, #1B211E 42%, #333B37 100%);
  box-shadow:
    0 2px 3px rgba(0,0,0,.28),
    0 34px 60px -18px rgba(11,32,22,.45),
    inset 0 0 0 1px rgba(255,255,255,.10);
}
.phone::before {
  content: ""; position: absolute; z-index: 3;
  top: 25px; left: 50%; transform: translateX(-50%);
  width: 80px; height: 22px; border-radius: 999px; background: #050706;
}

.phone .screen {
  /* Without this a flex child refuses to shrink below its content, which is
     the other half of how a long address stretched the frame. */
  min-width: 0;
  height: min(620px, 72vh);
  border-radius: 34px;
  overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--wa-chat);
}

.wa-head {
  flex: none;
  display: flex; align-items: center; gap: 11px;
  padding: 42px 14px 10px;
  background: var(--wa-in);
  border-bottom: 1px solid color-mix(in srgb, var(--wa-ink) 8%, transparent);
}
/* The logo on its own — no badge behind it. */
.wa-head .dot { flex: none; font-size: 1.7rem; line-height: 1; }
.wa-head strong { display: block; font-size: .93rem; color: var(--wa-ink); }
.wa-head span { font-size: .74rem; color: var(--wa-muted); }

.chat {
  flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 12px 16px;
  display: flex; flex-direction: column; gap: 7px;
  scroll-behavior: smooth;
  background-image:
    radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--wa-ink) 3%, transparent) 1px, transparent 1px),
    radial-gradient(circle at 70% 70%, color-mix(in srgb, var(--wa-ink) 3%, transparent) 1px, transparent 1px);
  background-size: 42px 42px, 58px 58px;
}

.msg {
  max-width: 85%;
  /* An email address or a phone number has nowhere to break, and would
     otherwise set the width of everything around it. */
  overflow-wrap: anywhere;
  padding: 7px 10px 6px;
  border-radius: 9px;
  font-size: .92rem; line-height: 1.45;
  color: var(--wa-ink);
  box-shadow: 0 1px .5px rgba(11,20,26,.13);
  animation: pop-in .32s cubic-bezier(.2,.7,.3,1) backwards;
}
.msg.in  { align-self: flex-start; background: var(--wa-in); border-top-left-radius: 2px; }
.msg.out { align-self: flex-end;   background: var(--wa-out); border-top-right-radius: 2px; }
.msg .time { float: right; margin: 5px 0 -2px 8px; font-size: .64rem; color: var(--wa-muted); }
.msg.out .time::after { content: " ✓✓"; color: #53BDEB; }
.msg small { display: block; margin-top: 4px; font-size: .76rem; color: var(--wa-muted); }

@keyframes pop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .msg { animation: none; } .chat { scroll-behavior: auto; } }

/* Someone is typing, so a reply that takes a moment doesn't read as a hang. */
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 11px 13px; background: var(--wa-in); border-radius: 9px; border-top-left-radius: 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--wa-muted); animation: blink 1.3s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.composer {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px;
  background: var(--wa-bar);
  border-top: 1px solid color-mix(in srgb, var(--wa-ink) 8%, transparent);
}
/* `display: flex` above would otherwise beat the [hidden] attribute. */
.composer[hidden] { display: none; }
.composer :is(input, select) {
  flex: 1; min-width: 0; width: auto;
  font: inherit; font-size: .92rem; color: var(--wa-ink);
  background: var(--wa-in); border: 1px solid transparent;
  border-radius: 999px; padding: 10px 15px; box-shadow: none;
}
.composer :is(input, select):focus { outline: none; border-color: var(--accent); box-shadow: none; }
.composer input::placeholder { color: var(--wa-muted); }

.send {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
  transition: filter .15s, transform .1s;
}
.send:hover { filter: brightness(1.08); }
.send:active { transform: scale(.94); }
.send:disabled { opacity: .55; cursor: progress; }
.send svg { width: 18px; height: 18px; fill: currentColor; }

/* The pricing block under the /business signup. The grid page above it is
   viewport-height, so this sits below the fold deliberately — someone who
   came to sign up is not made to scroll past a price list first. */
.biz-pricing { padding-top: 8px; border-top: 1px solid var(--line); margin-top: 24px; max-width: 1040px; }
.biz-pricing h2 { margin-top: 6px; }
.biz-pricing .tiers { margin-top: 22px; }
.biz-pricing .tier h3 { font-size: 1rem; }
.biz-pricing .fine { margin-top: 18px; }
.biz-pricing .fine a { color: var(--bridge); }

/* The "coming next" block on /business. Visually quieter than the pricing
   above it, because it is a promise rather than an offer. */
.biz-next { max-width: 1040px; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 28px; }
.biz-next h2 { margin-top: 6px; }
.biz-next .lede { max-width: 46em; }

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
@media (max-width: 760px) { .cards-3 { grid-template-columns: 1fr; } }

.soon-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.soon-card h3 { margin: 10px 0 6px; font-size: 1rem; }
.soon-card p { color: var(--muted); font-size: .9rem; }

/* Says "not yet" on every card, so no one reads this as something they're buying. */
.soon {
  display: inline-block;
  font-size: .68rem; font-weight: 680; letter-spacing: .06em; text-transform: uppercase;
  color: var(--warn); background: var(--warn-soft);
  padding: 3px 9px; border-radius: 999px;
}
