/* =========================================================
   LANCEI NO DIGITAL — Formulário de leads (compartilhado)
   Usado pelo site e pela /bio. Herda os tokens de cor da página
   (--accent, --bg, --line, --text...) e traz fallback para os
   tokens que só existem em uma delas.
   ========================================================= */

.sheet {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ok: #2FCB6E;
  --warn: #FFB020;
  --err: #FF6B6B;

  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
  visibility: hidden; pointer-events: none;
  font-family: var(--font-body);
}
.sheet.is-open { visibility: visible; pointer-events: auto; }
body.is-locked { overflow: hidden; }

.sheet .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.sheet__backdrop {
  position: absolute; inset: 0;
  background: rgba(5,6,8,.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .35s var(--ease);
}
.sheet.is-open .sheet__backdrop { opacity: 1; }

.sheet__panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 500px; max-height: 94svh;
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 22px 22px 0 0;
  transform: translateY(102%);
  transition: transform .45s var(--ease-out);
  overflow: hidden;
  text-align: left;
}
.sheet.is-open .sheet__panel { transform: none; }

.sheet__bar { display: grid; place-items: center; padding: 10px 0 2px; flex: none; }
.sheet__bar span { width: 40px; height: 4px; border-radius: 100px; background: rgba(255,255,255,.14); }

.sheet__head {
  flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 10px 18px 14px;
}
.sheet__eyebrow {
  font-size: .68rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.sheet__title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  letter-spacing: -.032em; line-height: 1.15; margin-top: 6px; color: var(--text);
}
.sheet__close {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted);
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  cursor: pointer;
  transition: color .25s var(--ease), background .25s var(--ease);
}
@media (hover: hover) { .sheet__close:hover { color: var(--text); background: rgba(255,255,255,.09); } }

.sheet .progress { flex: none; height: 2px; background: rgba(255,255,255,.07); }
.sheet .progress span {
  display: block; height: 100%; width: 16%;
  background: var(--accent);
  transition: width .45s var(--ease);
}

.sheet__body {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 20px 18px calc(18px + var(--safe-bottom));
  display: flex; flex-direction: column;
}
.steps-count {
  font-size: .68rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 14px;
}

.sheet .step { border: 0; display: none; padding: 0; margin: 0; }
.sheet .step.is-active { display: block; animation: sheetStepIn .4s var(--ease-out) both; }
@keyframes sheetStepIn { from { opacity: 0; transform: translateY(12px); } }
.step__title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.08rem;
  letter-spacing: -.03em; line-height: 1.2; padding: 0; color: var(--text);
}
.step__lead { margin-top: 8px; color: var(--muted); font-size: .86rem; line-height: 1.55; }

/* ---------- campos ---------- */
.field { display: block; margin-top: 18px; }
.field__label {
  display: block; font-size: .85rem; font-weight: 600; color: var(--text);
  margin-bottom: 8px; line-height: 1.4;
}
.field__label b { color: var(--accent); font-weight: 600; }
.field input[type="text"],
.field input[type="tel"],
.field textarea {
  width: 100%; display: block;
  min-height: 50px; padding: 13px 14px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 12px;
  font-family: inherit; font-size: 1rem; line-height: 1.4; resize: vertical;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { min-height: 84px; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field__err { display: none; margin-top: 7px; font-size: .78rem; color: var(--err); }
.field.has-error input, .field.has-error textarea { border-color: var(--err); }
.field.has-error .field__err { display: block; }
.field.has-error .opts { border-radius: 13px; box-shadow: 0 0 0 1px var(--err); }

/* ---------- radios ---------- */
.opts { display: flex; flex-direction: column; gap: 8px; }
.opts--row { flex-direction: row; }
.opts--row .opt { flex: 1; }
.opt {
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  padding: 13px 14px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line-2);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt__box {
  flex: none; width: 19px; height: 19px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.24); position: relative;
  transition: border-color .2s var(--ease);
}
.opt__box::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--accent); transform: scale(0); transition: transform .2s var(--ease);
}
.opt__txt { font-size: .89rem; line-height: 1.35; color: var(--muted); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt:has(input:checked) .opt__box { border-color: var(--accent); }
.opt:has(input:checked) .opt__box::after { transform: scale(1); }
.opt:has(input:checked) .opt__txt { color: var(--text); font-weight: 600; }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- notas ---------- */
.note {
  margin-top: 16px; padding: 15px;
  border-radius: 13px; background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
}
.note p { color: var(--muted); font-size: .86rem; line-height: 1.55; }
.note p + p, .note p + .note__list { margin-top: 10px; }
.note strong { color: var(--text); }
.note__list { counter-reset: n; display: flex; flex-direction: column; gap: 9px; list-style: none; }
.note__list li {
  counter-increment: n; position: relative; padding-left: 29px;
  color: var(--muted); font-size: .86rem; line-height: 1.5;
}
.note__list li::before {
  content: counter(n); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: .68rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
}

.explain {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  background: rgba(255,176,32,.07); border: 1px solid rgba(255,176,32,.22);
  color: var(--muted); font-size: .83rem; line-height: 1.5;
  animation: sheetStepIn .3s var(--ease-out) both;
}

/* ---------- investimento ---------- */
.invest { display: grid; gap: 10px; margin-top: 16px; list-style: none; }
.invest li {
  padding: 15px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 5px;
}
.invest strong {
  font-family: var(--font-display); font-weight: 700; font-size: 1.45rem;
  letter-spacing: -.038em; line-height: 1; color: var(--accent);
}
.invest strong span { font-size: .8rem; font-weight: 600; letter-spacing: 0; }
.invest > li > span { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.invest em { color: var(--faint); font-size: .74rem; font-style: normal; }
@media (min-width: 420px) { .invest { grid-template-columns: 1fr 1fr; } }

/* ---------- nav ---------- */
.sheet__nav {
  display: flex; gap: 10px; margin-top: 24px;
  position: sticky; bottom: calc(-18px - var(--safe-bottom));
  padding: 14px 0 calc(4px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, var(--bg-2) 34%);
}
.sheet__nav .btn { flex: 1; padding: 0 16px; }
.sheet__nav .btn--ghost { flex: 0 0 auto; width: 52px; padding: 0; }
.sheet__nav .btn--ghost span { display: none; }

.spinner {
  display: none; width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: sheetSpin .7s linear infinite;
}
@keyframes sheetSpin { to { transform: rotate(360deg); } }
.btn.is-loading .btn__label { opacity: .55; }
.btn.is-loading .spinner { display: block; }

/* ---------- desfechos ---------- */
.outcome {
  padding: 8px 22px calc(28px + var(--safe-bottom)); text-align: center; overflow-y: auto;
  animation: sheetStepIn .4s var(--ease-out) both;
}
.outcome__icon {
  width: 58px; height: 58px; margin: 6px auto 18px;
  border-radius: 50%; display: grid; place-items: center;
}
.outcome__icon--ok { color: var(--ok); background: rgba(47,203,110,.1); border: 1px solid rgba(47,203,110,.3); }
.outcome__icon--no { color: var(--warn); background: rgba(255,176,32,.09); border: 1px solid rgba(255,176,32,.28); }
.outcome h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 1.26rem;
  letter-spacing: -.032em; line-height: 1.18; color: var(--text);
}
.outcome p { margin: 12px auto 0; max-width: 38ch; color: var(--muted); font-size: .89rem; line-height: 1.6; }
.outcome p strong { color: var(--text); }
.outcome .btn { margin-top: 22px; width: 100%; }
.outcome__link {
  display: block; margin: 16px auto 0; font-size: .8rem; color: var(--faint);
  background: none; border: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  transition: color .25s var(--ease);
}
@media (hover: hover) { .outcome__link:hover { color: var(--text); } }

/* ---------- desktop ---------- */
@media (min-width: 640px) {
  .sheet { align-items: center; padding: 24px; }
  .sheet__panel {
    border-radius: 22px; border-bottom: 1px solid var(--line);
    max-height: min(88svh, 800px);
    transform: translateY(20px) scale(.98); opacity: 0;
    transition: transform .4s var(--ease-out), opacity .28s var(--ease);
  }
  .sheet.is-open .sheet__panel { transform: none; opacity: 1; }
  .sheet__bar { display: none; }
  .sheet__head { padding-top: 20px; }
  .sheet__body { padding-left: 24px; padding-right: 24px; }
  .sheet__nav .btn--ghost { width: auto; padding: 0 20px; }
  .sheet__nav .btn--ghost span { display: inline; }
  .outcome { padding-left: 32px; padding-right: 32px; }
  .outcome .btn { width: auto; min-width: 250px; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
