/* MarginSheet sign up. Consumes tokens.css. Nothing else.
   This is the shipped Signup design brought into the token system.
   Every literal hex from the original has been replaced by its token;
   no visual decision was changed except the three noted in
   IMPLEMENTATION.md. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin:0; background:var(--ms-paper); color:var(--ms-ink);
  font-family:var(--ms-font-ui); -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }
a { color:var(--ms-ink); text-decoration:underline; text-decoration-color:var(--ms-border);
  text-underline-offset:3px; }
a:hover { color:var(--ms-brand-hover); text-decoration-color:var(--ms-brand-hover); }
input::placeholder { color:var(--ms-muted); }
button { font-family:inherit; color:inherit; }
.ms-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.ms-tnum { font-variant-numeric:tabular-nums; }

@keyframes msPop  { 0%{transform:scale(.4);opacity:0} 55%{transform:scale(1.12);opacity:1} 100%{transform:scale(1);opacity:1} }
@keyframes msRing { 0%{transform:scale(.7);opacity:.55} 100%{transform:scale(2.3);opacity:0} }
@keyframes msDraw { 0%{stroke-dashoffset:22} 100%{stroke-dashoffset:0} }
@keyframes msRise { 0%{transform:translateY(10px);opacity:0} 100%{transform:translateY(0);opacity:1} }
@keyframes msScroll { 0%,10%{transform:translateY(0)} 90%,100%{transform:translateY(-28%)} }
@keyframes msSettle { 0%{opacity:.35} 50%{opacity:.62} 100%{opacity:.35} }
@media (prefers-reduced-motion:reduce) { *{ animation:none !important } }

/* ---------- Page ---------- */
.ms-page {
  min-height:100dvh; display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding:28px 20px 48px; background:var(--ms-paper);
}
.ms-brandmark { display:flex; align-items:center; justify-content:center; gap:var(--ms-sp-4); margin-bottom:22px; }
.ms-brandmark img { width:34px; height:34px; border-radius:var(--ms-r-sm); display:block; }
.ms-wordmark { font-size:16px; font-weight:var(--ms-w-semi); color:var(--ms-ink); }
.ms-wordmark b { font-weight:inherit; color:var(--ms-brand); }

/* row-reverse + wrap: wide screens put the form left and the sample right;
   narrow screens stack the sample above the form with no media query. */
.ms-cols {
  display:flex; flex-flow:row-reverse wrap;
  align-items:center; justify-content:center;
  gap:clamp(10px,4vw,44px); width:100%; max-width:924px;
}
.ms-col-form { flex:0 1 392px; min-width:260px; width:100%; max-width:392px; }
.ms-col-sample { flex:0 1 400px; min-width:260px; display:flex; flex-direction:column; align-items:center; }

/* ---------- The sample statement ----------
   Sells the product while they sign up. It is a real settled month at
   8% Margin, not a marketing mock, and it must survive any rework of
   this surface. Preserved from the shipped design. */
.ms-phone {
  position:relative; width:250px; height:clamp(200px,32vw,248px);
  border-radius:26px 26px 0 0; background:var(--ms-ink); padding:7px 7px 0;
  mask-image:linear-gradient(180deg,#000 95%,transparent 100%);
  -webkit-mask-image:linear-gradient(180deg,#000 95%,transparent 100%);
}
.ms-phone-screen {
  height:100%; border-radius:21px 21px 0 0; background:var(--ms-paper);
  overflow:hidden; padding:14px 15px 0; display:flex; flex-direction:column;
}
.ms-phone-head { display:flex; justify-content:space-between; align-items:baseline; flex:none; }
.ms-phone-head b { font-size:12.5px; font-weight:var(--ms-w-semi); }
.ms-phone-head span { font-size:10px; color:var(--ms-muted); }
.ms-phone-kept {
  margin-top:11px; padding:11px 12px; flex:none;
  background:var(--ms-card); border:1px solid var(--ms-brand); border-radius:var(--ms-r-sm);
}
.ms-phone-kept-row { display:flex; align-items:center; gap:6px; }
.ms-phone-swatch { width:7px; height:7px; border-radius:2px; background:var(--ms-tan); flex:none; }
.ms-phone-kept-label { font-size:15px; font-weight:var(--ms-w-semi); color:var(--ms-muted2); }
.ms-phone-kept-fig { margin-top:3px; display:flex; align-items:baseline; justify-content:space-between; }
.ms-phone-kept-fig b { font-size:23px; font-weight:var(--ms-w-semi); color:var(--ms-amber-ink); font-variant-numeric:tabular-nums; }
.ms-phone-kept-fig span { font-size:12px; font-weight:var(--ms-w-semi); color:var(--ms-amber-ink); font-variant-numeric:tabular-nums; }
.ms-phone-scroll {
  position:relative; flex:1; min-height:0; overflow:hidden;
  mask-image:linear-gradient(180deg,transparent 0,#000 14px,#000 96%,transparent 100%);
  -webkit-mask-image:linear-gradient(180deg,transparent 0,#000 14px,#000 96%,transparent 100%);
}
.ms-phone-lines {
  display:flex; flex-direction:column; gap:6px; margin-top:12px;
  font-size:11.5px; color:var(--ms-muted2);
  animation:msScroll 15s ease-in-out 1.4s infinite alternate both;
}
.ms-phone-lines div { display:flex; justify-content:space-between; }
.ms-phone-lines div b { font-weight:var(--ms-w-semi); font-variant-numeric:tabular-nums; }
.ms-phone-lines div.sub { padding-left:10px; color:var(--ms-muted); }
.ms-phone-lines div.sub span:first-child { font-style:italic; }
.ms-phone-lines div.rule { padding-top:6px; border-top:1px solid var(--ms-border3); }
.ms-sample-cap { margin:10px 0 0; max-width:310px; font-size:12.5px; line-height:1.55;
  color:var(--ms-muted); text-align:center; }

/* ---------- Progress ---------- */
.ms-prog { margin-bottom:14px; }
.ms-prog-bars { display:flex; gap:4px; }
.ms-prog-bars i { flex:1; height:2px; border-radius:1px; background:var(--ms-track); }
.ms-prog-bars i.on { background:var(--ms-brand); }
.ms-prog-label { margin-top:var(--ms-sp-3); font-size:15px; font-weight:var(--ms-w-semi); color:var(--ms-brand); }

/* ---------- Card body ---------- */
.ms-body { padding:22px 0 20px; }
.ms-body h1 { margin:0; font-size:21px; font-weight:var(--ms-w-semi); color:var(--ms-brand);
  line-height:1.25; text-wrap:pretty; }
.ms-body p { margin:var(--ms-sp-3) 0 0; font-size:var(--ms-fs-15); line-height:var(--ms-lh-body); color:var(--ms-muted2); }
.ms-body p.ms-fine { font-size:12.5px; line-height:1.5; color:var(--ms-muted); }
.ms-body strong { font-weight:var(--ms-w-semi); color:var(--ms-ink); }

.ms-doors { display:flex; flex-direction:column; gap:9px; margin-top:18px; }
.ms-door {
  display:flex; align-items:center; justify-content:center; gap:var(--ms-sp-4);
  width:100%; min-height:48px;
  background:var(--ms-card); border:1px solid var(--ms-border); border-radius:var(--ms-r-sm);
  color:var(--ms-ink); font-size:15px; font-weight:var(--ms-w-semi); cursor:pointer;
}
.ms-door:hover { border-color:var(--ms-brand); background:var(--ms-paper); }
.ms-door svg { width:17px; height:17px; flex:none; }

.ms-or { display:flex; align-items:center; gap:12px; margin-top:16px; }
.ms-or i { flex:1; height:1px; background:var(--ms-border3); }
.ms-or span { font-size:15px; font-weight:var(--ms-w-semi); color:var(--ms-muted); }

.ms-label { display:block; margin-bottom:6px; font-size:12.5px; font-weight:var(--ms-w-semi); color:var(--ms-muted2); }
.ms-field {
  display:block; width:100%; min-height:48px; padding:0 13px;
  background:var(--ms-paper); border:1px solid var(--ms-border); border-radius:var(--ms-r-sm);
  font-family:inherit; font-size:var(--ms-fs-16); color:var(--ms-ink);
}
.ms-field:focus { outline:none; border-color:var(--ms-brand); }
.ms-field-row { display:flex; gap:10px; margin-top:10px; min-width:0; }
.ms-field-row .ms-field { flex:1; min-width:0; }

.ms-btn {
  display:flex; align-items:center; justify-content:center; gap:var(--ms-sp-3);
  width:100%; min-height:50px; margin-top:16px;
  background:var(--ms-brand); border:1px solid var(--ms-brand); border-radius:var(--ms-r-sm);
  color:var(--ms-paper); font-size:var(--ms-fs-16); font-weight:var(--ms-w-semi);
  cursor:pointer; text-decoration:none;
}
.ms-btn:hover { background:var(--ms-brand-hover); border-color:var(--ms-brand-hover); color:var(--ms-paper); }
.ms-btn[disabled], .ms-btn.is-busy { cursor:default; opacity:.72; }
.ms-btn[disabled]:hover, .ms-btn.is-busy:hover { background:var(--ms-brand); border-color:var(--ms-brand); }
.ms-spin { width:15px; height:15px; border-radius:var(--ms-r-pill);
  border:2px solid rgba(251,247,240,.35); border-top-color:var(--ms-paper);
  animation:msSpin .8s linear infinite; }
@keyframes msSpin { to { transform:rotate(360deg) } }

.ms-panel {
  margin-top:16px; padding:13px 14px;
  background:var(--ms-paper); border:1px solid var(--ms-border3); border-radius:var(--ms-r-sm);
  font-size:13.5px; line-height:1.65; color:var(--ms-muted2);
}
.ms-panel div { display:flex; justify-content:space-between; gap:12px; }
.ms-panel b { font-weight:var(--ms-w-semi); color:var(--ms-ink); font-variant-numeric:tabular-nums; }
.ms-panel s { color:var(--ms-muted); text-decoration-color:var(--ms-muted); }

/* Founding variant: the panel restates the founding terms, it does not
   annotate the trial terms. Aubergine edge, because it is a fact about
   their account rather than a promotion. */
.ms-panel.is-founding { border-color:var(--ms-brand); background:var(--ms-brand-wash); }
.ms-founding-tag { display:flex; align-items:baseline; justify-content:space-between; gap:12px;
  margin-bottom:8px; padding-bottom:8px; border-bottom:1px solid var(--ms-border2); }
.ms-founding-tag span:first-child { font-size:var(--ms-fs-13); letter-spacing:.1em;
  text-transform:uppercase; font-weight:var(--ms-w-semi); color:var(--ms-brand); }
.ms-founding-tag span:last-child { font-size:13px; color:var(--ms-muted2); }

/* ---------- Notice ----------
   Same three markers as the shell. Nothing on this surface is red:
   a declined card is the issuer's answer, not a fact about the
   household's money. */
.ms-notice { display:flex; gap:11px; align-items:flex-start; margin-top:16px;
  font-size:13.5px; line-height:1.6; color:var(--ms-muted2); }
.ms-notice p { margin:0; text-wrap:pretty; }
.ms-notice-rule { width:3px; flex:0 0 3px; align-self:stretch; min-height:32px; }
.ms-notice.is-ours   .ms-notice-rule { background:var(--ms-amber); }
.ms-notice.is-action .ms-notice-rule { background:var(--ms-brand); }
.ms-notice-dot { width:7px; flex:0 0 7px; height:7px; margin-top:7px;
  border-radius:var(--ms-r-pill); background:var(--ms-muted); }
.ms-notice-eyebrow { display:block; font-size:13.5px; font-weight:var(--ms-w-semi); color:var(--ms-amber-ink); }
.ms-notice.is-action .ms-notice-eyebrow { color:var(--ms-brand); }

.ms-skel { display:block; border-radius:3px; background:var(--ms-border);
  animation:msSettle 2.4s ease-in-out infinite; }

/* ---------- Welcome ---------- */
.ms-done-head { display:flex; align-items:center; gap:15px; margin-bottom:14px; }
.ms-done-badge { position:relative; width:52px; height:52px; flex:none; }
.ms-done-badge i { position:absolute; inset:0; border-radius:var(--ms-r-pill); }
.ms-done-badge i:nth-child(1) { border:2px solid var(--ms-brand); animation:msRing 1.5s cubic-bezier(.2,.7,.3,1) .15s forwards; }
.ms-done-badge i:nth-child(2) { border:2px solid var(--ms-brand-hover); animation:msRing 1.5s cubic-bezier(.2,.7,.3,1) .5s forwards; }
.ms-done-badge span { position:relative; display:flex; align-items:center; justify-content:center;
  width:52px; height:52px; border-radius:var(--ms-r-pill); background:var(--ms-brand);
  animation:msPop .62s cubic-bezier(.18,.9,.3,1.12) both; }
.ms-done-badge svg path { stroke-dasharray:22; animation:msDraw .5s ease-out .34s both; }
.ms-done-head h1 { font-size:22px; }
.ms-rise-1 { animation:msRise .5s cubic-bezier(.2,.8,.3,1) .16s both; }
.ms-rise-2 { animation:msRise .5s cubic-bezier(.2,.8,.3,1) .28s both; }
.ms-rise-3 { animation:msRise .5s cubic-bezier(.2,.8,.3,1) .4s both; }
.ms-rise-4 { animation:msRise .5s cubic-bezier(.2,.8,.3,1) .52s both; }

/* ---------- Footer, on every step ---------- */
.ms-foot { margin:16px 4px 0; font-size:12px; line-height:1.5; color:var(--ms-muted); text-align:center; }
.ms-foot + .ms-foot { margin-top:10px; }
.ms-back { margin:14px 4px 0; font-size:12.5px; text-align:center; }
.ms-alt { margin:16px 0 0; padding-top:14px; border-top:1px solid var(--ms-border3);
  font-size:13.5px; text-align:center; color:var(--ms-muted2); }

@media (max-width: 700px) {
  .ms-page { padding:20px 18px 40px; justify-content:flex-start; }
  .ms-cols { gap:18px; }
  .ms-body { padding:16px 0 14px; }
  .ms-body h1 { font-size:20px; }
  .ms-done-head { gap:12px; }
  .ms-done-head h1 { font-size:20px; }
  .ms-field-row { flex-direction:column; gap:10px; }
}
