/* Tokens measured from mple.ai: Inter, near-black text, #4E0DA3 -> #974DF8
   gradient pill buttons with a violet glow, white surfaces on a lavender wash. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #020101;
  --ink-2: #4a4558;
  --primary: #4e0da3;
  --violet: #974df8;
  --lilac: #c4a6f0;
  --wash: #f3ebff;
  --line: #e7ddf7;
  --surface: #fff;
  --ok: #0e7a43;
  --ok-bg: #e4f6ec;
  --err: #b3261e;
  --wa-bg: #efe7dd;
  --wa-link: #0a66c2;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --lift-1: 0 1px 2px rgba(78, 13, 163, 0.06), 0 8px 24px rgba(78, 13, 163, 0.08);
  --lift-2: 0 2px 4px rgba(78, 13, 163, 0.06), 0 24px 60px rgba(78, 13, 163, 0.16);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
/* Lavender wash with the site's faint grid, fading out down the page. */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: min(720px, 100dvh);
  z-index: -1;
  background:
    linear-gradient(rgba(78, 13, 163, 0.05) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(78, 13, 163, 0.05) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(180deg, #efe4ff 0%, #f8f3ff 55%, #fff 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
  mask-image: linear-gradient(180deg, #000 55%, transparent);
}
h1, h2, p, ol, figure { margin: 0; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

.logo { display: block; height: 34px; width: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; padding: 12px 28px;
  border: 2px solid var(--violet); border-radius: 999px;
  background: linear-gradient(180deg, var(--primary) 20%, var(--violet) 100%);
  box-shadow: 0 3px 10px 2px rgba(151, 77, 248, 0.36);
  color: #fff; font: inherit; font-size: 17px; font-weight: 600; text-decoration: none;
  cursor: pointer; touch-action: manipulation;
  transition: filter 0.18s ease-out, box-shadow 0.18s ease-out, transform 0.12s ease-out;
}
.btn:hover { filter: brightness(1.08); box-shadow: 0 5px 16px 3px rgba(151, 77, 248, 0.42); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.6; cursor: progress; box-shadow: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn .spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.btn[disabled] .spin { display: block; }
.btn.quiet { background: var(--surface); color: var(--primary); border-color: var(--line); box-shadow: none; }
.btn.quiet:hover { border-color: var(--lilac); filter: none; }
.link { background: none; border: 0; padding: 12px 4px; min-height: 44px; font: inherit; font-size: 15px; font-weight: 600; color: var(--primary); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link:hover { text-decoration: underline; }
.link[disabled] { color: var(--ink-2); cursor: default; text-decoration: none; font-weight: 500; }
.link svg { width: 18px; height: 18px; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 8px; }
.btn:focus-visible { border-radius: 999px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Capture flow ---------- */
.flow { max-width: 472px; margin: 0 auto; padding: 20px 16px 40px; }
.flow-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 20px; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--lift-2); padding: 28px; }

.progress { margin-bottom: 28px; }
.progress-text { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); margin-bottom: 10px; }
.progress-text b { color: var(--ink); font-weight: 600; }
.progress-track { height: 6px; border-radius: 99px; background: var(--wash); overflow: hidden; }
.progress-bar { height: 100%; width: 25%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--violet)); transition: width 0.35s ease-out; }

.view { animation: enter 0.24s ease-out; }
.view > h1 + p { margin-top: 10px; color: var(--ink-2); }
.view.center { text-align: center; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

.field { margin-top: 20px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.control { position: relative; }
.control > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ink-2); pointer-events: none; }
.control .cc { position: absolute; left: 46px; top: 50%; transform: translateY(-50%); font-weight: 600; pointer-events: none; }
input {
  width: 100%; min-height: 54px; padding: 12px 16px 12px 46px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  font: inherit; color: var(--ink); background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: #8b849b; }
input:hover { border-color: var(--lilac); }
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(151, 77, 248, 0.18); }
input.phone { padding-left: 84px; }
input.code { padding: 12px; text-align: center; font-size: 28px; font-weight: 700; letter-spacing: 0.42em; text-indent: 0.42em; font-variant-numeric: tabular-nums; min-height: 68px; }
input[aria-invalid='true'] { border-color: var(--err); }
.msg { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; font-size: 14px; color: var(--err); font-weight: 500; }
.msg:empty { display: none; }
.msg::before { content: ''; flex: none; width: 16px; height: 16px; margin-top: 2px; background: currentColor; -webkit-mask: var(--alert) center / contain no-repeat; mask: var(--alert) center / contain no-repeat; }
:root { --alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5M12 16.5v.5'/%3E%3C/svg%3E"); }
.form-msg { margin-top: 16px; }
.actions { margin-top: 28px; }
.fine { margin-top: 14px; text-align: center; font-size: 13px; color: var(--ink-2); }
.row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

.proto { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--wash); font-size: 14px; color: var(--ink-2); }
.proto b { color: var(--ink); letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }

.glyph { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 24px; display: grid; place-items: center; background: var(--wash); color: var(--primary); }
.glyph svg { width: 34px; height: 34px; }
.glyph.ok { background: var(--ok-bg); color: var(--ok); }

/* WhatsApp message preview (shared by flow and poster) */
.wa { background: var(--wa-bg); border-radius: var(--r-md); padding: 14px; text-align: left; margin-top: 24px; }
.wa-from { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.wa-from img { height: 18px; }
.wa-bubble { background: #fff; border-radius: 4px 14px 0 0; padding: 12px 14px; font-size: 15px; line-height: 1.45; white-space: pre-line; }
.wa-bubble.solo { border-radius: 4px 14px 14px 14px; }
.wa-cta { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; background: #fff; border-top: 1px solid #ececec; border-radius: 0 0 14px 14px; color: var(--wa-link); font-weight: 600; font-size: 15px; text-decoration: none; }
a.wa-cta:hover { background: #f6fbff; }
.wa-cta svg { width: 18px; height: 18px; }
.wa-doc { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 4px 14px 0 0; padding: 12px; text-decoration: none; color: var(--ink); border-bottom: 1px solid #ececec; }
.wa-doc .pdf { flex: none; width: 40px; height: 48px; border-radius: 8px; background: #fde8e6; color: #b3261e; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.wa-doc b { display: block; font-size: 15px; font-weight: 600; }
.wa-doc span { font-size: 13px; color: var(--ink-2); }
.wa-doc + .wa-bubble { border-radius: 0 0 14px 14px; }

/* Call in progress */
.ring { position: relative; width: 88px; height: 88px; margin: 8px auto 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, var(--primary) 20%, var(--violet)); }
.ring svg { width: 36px; height: 36px; position: relative; }
.ring::before, .ring::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--violet); animation: pulse 2s ease-out infinite; }
.ring::after { animation-delay: 1s; }
@keyframes pulse { from { opacity: 0.7; } to { transform: scale(1.9); opacity: 0; } }

/* ---------- QR poster: copy + steps on the left, QR on the right ---------- */
.poster { max-width: 1240px; min-height: 100dvh; margin: 0 auto; padding: 28px 32px 48px; display: flex; flex-direction: column; }
.poster > .logo { align-self: flex-start; }
.poster-grid { flex: 1; display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 48px; align-items: center; padding: 32px 0; }
.poster-copy h1 { font-size: clamp(34px, 3.9vw, 54px); line-height: 1.08; letter-spacing: -0.03em; }
.poster-copy > p { margin-top: 20px; max-width: 32em; font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); }

/* "persona": brand gradient that keeps sweeping, with an underline drawn in on load. */
.word {
  position: relative; display: inline-block; padding-bottom: 0.06em;
  background: linear-gradient(90deg, var(--primary), var(--violet), var(--primary), var(--violet)) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 5s linear infinite, word-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.word::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -0.02em; height: 0.09em; border-radius: 99px;
  background: linear-gradient(90deg, var(--violet), var(--lilac));
  transform-origin: left; animation: draw 0.7s 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes sheen { to { background-position: -150% 0; } }
@keyframes word-in { from { opacity: 0; transform: translateY(0.25em); } }
@keyframes draw { from { transform: scaleX(0); } }

/* Steps: a vertical timeline. Items rise in one after another, then the
   highlight walks 1 -> 4 on a loop so the order reads at a glance. */
.steps { --cycle: 8s; list-style: none; padding: 0; margin: 40px 0 0; max-width: 460px; counter-reset: s; }
.steps li {
  counter-increment: s; position: relative; padding: 6px 0 26px 64px; min-height: 70px;
  font-size: 18px; font-weight: 600;
  animation: rise 0.5s ease-out both; animation-delay: calc(var(--i) * 110ms + 250ms);
}
.steps li:last-child { padding-bottom: 0; min-height: 44px; }
.steps span { display: block; margin-top: 2px; font-size: 15px; font-weight: 400; color: var(--ink-2); }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; z-index: 1;
  background-color: var(--surface); border: 1.5px solid var(--lilac); color: var(--primary); font-weight: 700;
  animation: lit var(--cycle) ease-in-out infinite; animation-delay: calc(var(--i) * var(--cycle) / 4 + 1.2s);
}
/* Connector: a track, plus a fill that grows while this step is the active one. */
.steps li:not(:last-child)::after {
  content: ''; position: absolute; left: 21px; top: 44px; bottom: 0; width: 2px; border-radius: 2px;
  background: linear-gradient(var(--violet), var(--violet)) top / 100% 0% no-repeat, var(--line);
  animation: fill var(--cycle) ease-in-out infinite; animation-delay: calc(var(--i) * var(--cycle) / 4 + 1.2s);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes lit {
  0%, 30%, 100% { background-color: var(--surface); color: var(--primary); border-color: var(--lilac); box-shadow: none; transform: scale(1); }
  4%, 24% { background-color: var(--primary); color: #fff; border-color: var(--violet); box-shadow: 0 3px 12px 2px rgba(151, 77, 248, 0.4); transform: scale(1.1); }
}
@keyframes fill {
  0%, 4% { background-size: 100% 0%, auto; }
  24%, 92% { background-size: 100% 100%, auto; }
  100% { background-size: 100% 0%, auto; }
}

.stage { position: relative; display: grid; place-items: center; padding: 24px 0; }
/* The QR is the point of the page: largest element, brand-coloured frame, glow. */
@property --orbit { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes orbit { to { --orbit: 360deg; } }
@keyframes halo { 50% { box-shadow: 0 0 0 12px rgba(151, 77, 248, 0.16), 0 30px 80px rgba(78, 13, 163, 0.3); } }
.qr { width: 100%; max-width: 470px; border: 4px solid transparent; border-radius: var(--r-lg); padding: 26px;
  /* White card on the padding box; a purple light travelling round the border box. */
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--orbit), var(--primary), var(--violet), #e9d8ff, var(--violet), var(--primary), #2a0763, var(--primary)) border-box;
  box-shadow: 0 0 0 8px rgba(151, 77, 248, 0.1), 0 30px 70px rgba(78, 13, 163, 0.22); text-align: center; position: relative; z-index: 1;
  animation: rise 0.6s 0.15s ease-out both, orbit 4s linear infinite, halo 4s ease-in-out infinite; }
.qr h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.qr p { margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.qr-code { margin: 20px auto 16px; padding: 14px; border-radius: var(--r-md); background: var(--wash); }
.qr-code img { display: block; width: 100%; height: auto; border-radius: 10px; }
.qr a { font-size: 14px; font-weight: 600; color: var(--primary); word-break: break-all; }

/* Preview cards peek out from behind the QR card; the code itself stays clear. */
.float { position: absolute; z-index: 0; width: 232px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--lift-1); padding: 14px; }
.float.l { left: 0; top: 6%; transform: rotate(-6deg); }
.float.r { right: 0; bottom: 8%; transform: rotate(5deg); }
.float .wa { margin-top: 0; padding: 12px; }
.float .wa-bubble { font-size: 13px; }
.mini-title { font-size: 12px; color: var(--ink-2); }
.mini-name { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.mini-hero { border-radius: 14px; padding: 14px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--violet)); margin-bottom: 12px; }
.mini-hero .mini-title { color: rgba(255, 255, 255, 0.8); }
.bar { display: grid; grid-template-columns: 78px 1fr 24px; align-items: center; gap: 8px; font-size: 13px; margin-top: 9px; }
.bar i { height: 8px; border-radius: 99px; background: var(--wash); overflow: hidden; }
.bar i::after { content: ''; display: block; height: 100%; width: var(--v); border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--violet)); }
.bar b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 1080px) {
  .float { display: none; }
}
@media (max-width: 860px) {
  .poster { padding: 16px 20px 40px; }
  /* One column, QR straight after the headline so it is on the first screen.
     The copy block is flattened so the steps can drop below the QR. */
  .poster-grid { display: flex; flex-direction: column; gap: 0; padding: 20px 0 0; }
  .poster-copy { display: contents; }
  .poster-copy h1 { order: 1; font-size: clamp(28px, 8vw, 40px); text-align: center; }
  .stage { order: 2; padding: 0; margin-top: 20px; }
  .poster-copy > p { order: 3; margin: 24px auto 0; text-align: center; }
  .steps { order: 4; margin: 32px auto 0; width: 100%; }
  .qr { padding: 20px; }
  .qr-code { margin: 14px auto 12px; }
}
@media (max-width: 520px) {
  .flow { padding: 16px 0 0; }
  .flow-top { padding: 0 20px 16px; }
  /* Full-bleed sheet on phones: reads as an app screen, not a floating card. */
  .sheet { border-radius: var(--r-lg) var(--r-lg) 0 0; border-width: 1px 0 0; box-shadow: 0 -8px 40px rgba(78, 13, 163, 0.1); padding: 24px 20px 40px; min-height: calc(100dvh - 76px); }
  h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ring::before { opacity: 0.3; transform: scale(1.35); }
}
