/* Lyforic assistant onboarding — Direction B, "Airbnb-sheet"
   Modern product register: white cards on near-white ground, hairline borders,
   Inter only, a single navy thread (#1b3a5f). The card reads like a mobile sheet:
   a compact top bar inside the card (brand word left, step counter right, hairline
   below), then content. No cream, no serif, no engraved frames, no wax seal.

   Re-skin of the prior stationery build: timing tokens + choreography structure
   preserved (520ms soft entrances, staggered rises, pop for the final CTA, spine
   draw, num/segment fill, reduced-motion zeroing durations AND delays). */

:root {
  /* Surfaces */
  --ground:       #fafafa;
  --card:         #ffffff;
  --line:         #ececec;
  --line-strong:  #e0e2e6;
  --note-bg:      #f4f5f7;

  /* Ink */
  --ink:          #17181c;
  --ink-2:        #5c6470;
  --ink-3:        #9aa1ab;

  /* The one Lyforic thread */
  --action:        #1b3a5f;
  --action-hover:  #152b47;
  --action-active: #111f32;
  --action-ring:   rgba(27, 58, 95, .25);

  /* Success (sage) */
  --success:       #5f7d4f;
  --success-text:  #375a30;

  /* Danger */
  --danger-bg:     #fdeeec;
  --danger-border: #f2c4bd;
  --danger-text:   #a13535;

  /* Radius */
  --r-card:     16px;
  --r-control:  12px;
  --r-chip:     999px;

  /* Shadow */
  --shadow-card: 0 1px 2px rgba(16,17,20,.04), 0 12px 32px rgba(16,17,20,.07);

  /* Type — Inter only */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Motion (unchanged from prior build; re-skin, don't re-time) */
  --ease:          cubic-bezier(.2, .7, .2, 1);
  --ease-out-soft: cubic-bezier(.22, 1, .36, 1);
  --ease-out-back: cubic-bezier(.34, 1.4, .46, 1);
  --motion-base:   220ms;
  --motion-slow:   520ms;
  --motion-shift:  14px;
  --motion-scale-from: .96;
  --motion-pop-from:   .9;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font: 15.5px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(18px, 5vw, 56px) 16px;
}

/* ── The sheet ─────────────────────────────────────────────────── */

.card {
  background: var(--card);
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 5vw, 26px) clamp(20px, 5vw, 30px) clamp(26px, 5vw, 32px);
  position: relative;
  animation: sheet-in var(--motion-slow) var(--ease-out-soft) both;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(var(--motion-shift)) scale(var(--motion-scale-from)); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Sheet top bar: brand word left, step counter right, hairline below ── */

.letterhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--line);
  animation: rise var(--motion-slow) .12s var(--ease-out-soft) both;
}

/* brand mark: navy rounded-square glyph + wordmark */
.seal {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--action);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  flex: none;
  animation: seal-strike var(--motion-base) .18s var(--ease-out-back) both;
}
.wordmark {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  animation: rise var(--motion-slow) .2s var(--ease-out-soft) both;
}
/* step counter, right side of the sheet top bar */
.stepcount {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  flex: none;
  animation: rise var(--motion-slow) .2s var(--ease-out-soft) both;
}
/* group the glyph + word on the left, counter on the right */
.letterhead .seal { order: 0; }
.letterhead .wordmark { order: 1; margin-right: auto; }
.letterhead .stepcount { order: 2; }

@keyframes seal-strike {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Progress: Evernote-style thin segment bar (3 segments) ──────
   Rendered from the existing <nav class=steps><ol>...</ol></nav> markup:
   each <li.step> becomes a 4px segment; the connector rules are hidden.
   Filled (#1b3a5f) for done/current, #e0e2e6 upcoming. Lives inside the
   top bar's flow region, but we place it as its own row under the bar. */

.steps {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 22px;
  animation: rise var(--motion-slow) .26s var(--ease-out-soft) both;
}
.steps ol {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}
.step {
  flex: 1 1 0;
  height: 4px;
  border-radius: var(--r-chip);
  background: var(--line-strong);   /* upcoming */
  overflow: hidden;
  position: relative;
}
.step .num, .step .label { display: none; }
.step-rule { display: none; }

/* done + current segments fill navy; current animates its fill */
.step.done { background: var(--action); }
.step.on {
  background: var(--action);
  /* segment fill sweep, honoring the num/segment-fill choreography beat */
  animation: segment-fill var(--motion-base) .56s var(--ease-out-soft) both;
  transform-origin: left center;
}
@keyframes segment-fill {
  from { transform: scaleX(.4); opacity: .5; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* ── Eyebrow / kicker (sentence case, no uppercase kickers) ─────── */

.kicker {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin: 0 0 10px;
  overflow-wrap: anywhere;
  animation: rise var(--motion-slow) .32s var(--ease-out-soft) both;
}

/* index eyebrow pill → quiet chip */
.pill {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-chip);
  background: var(--card);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  animation: rise var(--motion-slow) .28s var(--ease-out-soft) both;
}

h1 {
  font-family: var(--font);
  font-weight: 600;
  font-size: clamp(30px, 5.6vw, 40px);
  line-height: 1.15;
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0 0 14px;
  text-wrap: balance;
  animation: rise var(--motion-slow) .38s var(--ease-out-soft) both;
}
/* copy is fixed; drop italic emphasis into the flat weight/color of the register */
h1 em { font-style: normal; color: var(--ink); }

.sub {
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0 0 22px;
  animation: rise var(--motion-slow) .44s var(--ease-out-soft) both;
}
.sub b { color: var(--ink); font-weight: 600; }

/* ── Buttons ──────────────────────────────────────────────────── */

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  animation: rise var(--motion-slow) .5s var(--ease-out-soft) both;
}

/* primary CTA: full-width, 52px, navy, radius 12 */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  background: var(--action);
  color: #fff;
  text-decoration: none;
  font-family: var(--font);
  font-weight: 600;
  font-size: 15.5px;
  padding: 12px 20px;
  border-radius: var(--r-control);
  border: 1px solid var(--action);
  cursor: pointer;
  text-align: center;
  transition: background .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { background: var(--action-hover); border-color: var(--action-hover); }
.btn:active { background: var(--action-active); border-color: var(--action-active); }

/* provider rows (index): Airbnb-style white rows, icon flush-left, label centered */
.actions .btn {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  font-weight: 500;
  position: relative;
}
.actions .btn:hover { background: var(--note-bg); border-color: var(--line-strong); }
.actions .btn:active { background: var(--note-bg); }

.ms {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-weight: 500;
  font-size: 15.5px;
  padding: 0 42px; /* keep the centered label clear of the flush-left icon */
}
/* icon flush-left, label optically centered (Airbnb pattern) */
.ms svg {
  position: absolute;
  left: 18px;
  width: 20px;
  height: 20px;
  flex: none;
}

/* ── Trust markers (index): quiet stacked micro-rows, sage checks ── */

.trust {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  animation: rise var(--motion-slow) .58s var(--ease-out-soft) both;
}
.trust li {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-2);
}
.trust svg { width: 15px; height: 15px; flex: none; color: var(--success); }

/* ── Form (phone) ─────────────────────────────────────────────── */

form {
  margin: 0;
  animation: rise var(--motion-slow) .5s var(--ease-out-soft) both;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin: 0 0 8px;
}

/* generic single input (fallback / verify-style if ever used) */
input[type="tel"], input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--card);
  color: var(--ink);
  font: 15.5px/1.3 var(--font);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input::placeholder { color: var(--ink-3); }
input:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 2px var(--action-ring); }

/* phone: split country-select + tel input styled as ONE 52px field.
   The wrapper owns the border + focus ring (focus-within). */
.phone-field {
  display: flex;
  align-items: stretch;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--card);
  overflow: hidden;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.phone-field:focus-within {
  border-color: var(--action);
  box-shadow: 0 0 0 2px var(--action-ring);
}
.phone-field .cc {
  flex: none;
  border: 0;
  border-right: 1px solid var(--line);   /* subtle right hairline */
  border-radius: 0;
  background: var(--card);
  color: var(--ink);
  font: 15.5px/1.3 var(--font);
  padding: 14px 30px 14px 16px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235c6470' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}
.phone-field .cc:hover { background-color: var(--note-bg); }
/* the inner controls carry no frame of their own; the wrapper owns it */
.phone-field input[type="tel"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.phone-field input[type="tel"]:focus { box-shadow: none; border-color: transparent; }
/* keyboard :focus-visible still lands a ring on the individual control for a11y */
.phone-field .cc:focus-visible,
.phone-field input[type="tel"]:focus-visible { outline: 2px solid var(--action); outline-offset: -2px; }

form .btn { margin-top: 18px; }

/* ── done.html: Revolut-style checklist card + spine ───────────── */

.receipt {
  position: relative;
  background: var(--note-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  padding: 6px 16px 6px 34px;   /* left gutter houses spine + row checks */
  margin: 6px 0 20px;
  animation: rise var(--motion-slow) .46s var(--ease-out-soft) both;
}

/* progress spine: 1px hairline in the left gutter, draws downward,
   synced to the row cascade. transform+opacity only. Anchored to .receipt. */
.spine {
  position: absolute;
  left: 16px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: linear-gradient(to bottom, var(--success), var(--line-strong));
  transform-origin: top center;
  transform: scaleY(0);
  animation: spine-draw var(--motion-slow) .58s var(--ease-out-soft) both;
}
@keyframes spine-draw {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

.row {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 0;
  font-size: 14.5px;
}
.row + .row { border-top: 1px solid var(--line); }

/* sage check circle marks each completed line */
.row .check {
  position: absolute;
  left: -26px;
  top: 12px;
  width: 18px;
  height: 18px;
  line-height: 0;
  animation: pop-in var(--motion-base) .74s var(--ease-out-back) both;
}
.row .check svg { width: 18px; height: 18px; display: block; }
.row + .row .check { animation-delay: .82s; }
.tag {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  min-width: 74px;
  flex: none;
}
.row .val { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }

.mails-intro { margin-top: 4px; animation-delay: .5s; }
.mail-list { margin: 0 0 22px; }

/* .mail rows: crisp list, server emits them flat (no wrapper) */
.mail {
  border-top: 1px solid var(--line);
  padding: 13px 2px;
  font-size: 14.5px;
  animation: rise var(--motion-slow) .56s var(--ease-out-soft) both;
}
.mail + .mail { animation-delay: .62s; }
.mail + .mail + .mail { animation-delay: .68s; }
.mail + .mail + .mail + .mail { animation-delay: .74s; }
.mail + .mail + .mail + .mail + .mail { animation-delay: .8s; }
.mail + .mail + .mail + .mail + .mail + .mail { animation-delay: .86s; }
.mail:last-child { border-bottom: 1px solid var(--line); }
.mail b {
  display: block;
  font-weight: 600;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.35;
}
.mail span {
  display: block;
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 13px;
}

/* activate: navy primary CTA, pops in last (terracotta is gone) */
.activate {
  margin: 0;
  animation: pop-in var(--motion-base) .88s var(--ease-out-back) both;
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(var(--motion-pop-from)); }
  to   { opacity: 1; transform: scale(1); }
}
.activate .btn {
  background: var(--action);
  border-color: var(--action);
  color: #fff;
  font-weight: 600;
}
.activate .btn:hover { background: var(--action-hover); border-color: var(--action-hover); }
.activate .btn:active { background: var(--action-active); border-color: var(--action-active); }

/* server-injected ACTIVATE variants arrive flat (no .activate wrapper) */
.card > .btn {
  margin: 16px 0 0;
  background: var(--action);
  border-color: var(--action);
  color: #fff;
  font-weight: 600;
  animation: pop-in var(--motion-base) .88s var(--ease-out-back) both;
}
.card > .btn:hover { background: var(--action-hover); border-color: var(--action-hover); }
.card > .ok {
  display: block;
  text-align: center;
  margin: 16px 0 0;
  animation: pop-in var(--motion-base) .88s var(--ease-out-back) both;
}

/* ── Shared small type + server-injected flat blocks ───────────── */

.ok { color: var(--success-text); font-weight: 600; }

.note {
  background: var(--note-bg);
  border: 1px solid var(--line);
  color: var(--ink-2);
  padding: 13px 15px;
  border-radius: var(--r-control);
  font-size: 14px;
  margin: 16px 0 0;
}
.err {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  padding: 13px 15px;
  border-radius: var(--r-control);
  font-size: 14px;
  margin: 16px 0 0;
}

.muted {
  color: var(--ink-2);
  font-size: 13px;
  margin: 20px 0 0;
  animation: rise var(--motion-slow) .64s var(--ease-out-soft) both;
}
.page-done .muted { animation-delay: .96s; }
.muted a { color: var(--action); text-underline-offset: 3px; }
.muted a:hover { color: var(--action-hover); }
.muted code {
  font-family: var(--font);
  font-size: 12.5px;
  background: var(--note-bg);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--ink-2);
}

/* ── verify.html: 6-digit code boxes ──────────────────────────── */

.code {
  display: flex;
  justify-content: space-between;
  gap: clamp(7px, 2.4vw, 12px);
  margin: 6px 0 20px;
}
.code-box {
  flex: 1 1 0;
  max-width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--card);
  font-family: var(--font);
  font-weight: 600;
  font-size: clamp(20px, 5.6vw, 24px);
  color: var(--action);
  animation: pop-in var(--motion-base) var(--ease-out-back) both;
}
.code-box:nth-child(1) { animation-delay: .40s; }
.code-box:nth-child(2) { animation-delay: .54s; }
.code-box:nth-child(3) { animation-delay: .68s; }
.code-box:nth-child(4) { animation-delay: .86s; }
.code-box:nth-child(5) { animation-delay: 1.02s; }
.code-box:nth-child(6) { animation-delay: 1.18s; }
/* filled boxes read as active: navy border + navy digit */
.code-box:not(:empty) { border-color: var(--action); }
.resend { animation-delay: 1.3s; }

/* ── done.html closing: try-first chips ───────────────────────── */

.allset { margin-top: 24px; animation: rise var(--motion-slow) 1s var(--ease-out-soft) both; }
.allset .sub { margin-bottom: 14px; }
.allset .try {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin: 0 0 10px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13px;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-chip);
  padding: 7px 14px;
}

/* ── Signoff (retained hook; quiet footer line) ────────────────── */

.signoff {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  animation: rise var(--motion-slow) .7s var(--ease-out-soft) both;
}
.page-done .signoff { animation-delay: 1s; }
.signoff .from {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.signoff .role {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--ink-2);
}

/* ── Cross-page continuity (progressive enhancement) ───────────── */
@view-transition { navigation: auto; }
.seal  { view-transition-name: seal; }
.steps { view-transition-name: steps; }

/* ── Focus + motion accessibility ─────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible { outline-offset: 2px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover { transform: none; }
  @view-transition { navigation: none; }
}

/* ── 360px floor ──────────────────────────────────────────────── */

@media (max-width: 380px) {
  body { padding: 14px 10px; }
  .card { padding: 20px 16px 26px; }
  .tag { min-width: 64px; }
  .ms svg { left: 14px; }
}
