/* Conversa com o consultor (/talk/ e a janela do nome na vitrine). Usa os tokens e as peças
   de landing.css (sf-agent, sf-paper, sf-chips, sf-swap); tudo daqui começa com tk-.
   Ordem: 1 palco, 2 consultor, 3 ficha e formulário, 4 passos, 5 resumo, 6 janela,
   7 telas menores, 8 movimento reduzido. */

/* 1. Palco: a mesa ao fundo, o consultor de um lado e a ficha do outro. */
body.tk .foot { display: none; }
body.tk .top { position: absolute; }
.tk-stage { position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: center; gap: 0 clamp(24px, 5vw, 80px); padding: 88px var(--sf-gutter) 40px; max-width: 1280px; margin-inline: auto; }
.tk-desk { position: fixed; inset: 0; }
.tk-desk .sf-room { --hz: 58%; --lx: 30%; }
.tk-desk .sf-room-obj { display: none; }
.tk-desk .sf-lamp { right: auto; left: 2%; width: 17%; scale: -1 1; }
.tk-desk .sf-lamp::after { display: none; }
.tk-desk::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(90deg, rgb(var(--paper-rgb) / 0) 30%, rgb(var(--paper-rgb) / .8) 66%); }
.tk-path { position: relative; grid-column: 1 / -1; display: flex; gap: 8px; margin-bottom: clamp(16px, 4vh, 40px); }
.tk-path li { flex: 1; max-width: 150px; padding-top: 10px; border-top: 3px solid var(--line); font: 500 .8125rem/1.2 var(--font); color: var(--dim); transition: border-color .4s, color .4s; }
.tk-path li.is-on { border-color: var(--dot); color: var(--ink); }

/* 2. O consultor e o que ele diz. A cena ativa é a que tem .is-on. */
.tk-host { position: relative; display: grid; justify-items: center; gap: 18px; }
.sf-swap > .is-on { --on: 1; }
.tk-says { width: min(100%, 420px); }
.tk-say { position: relative; z-index: 4; padding: 16px 20px; background: var(--wash); border: 1px solid var(--line-strong); border-radius: 14px; font-size: 1.125rem; line-height: 1.4; rotate: none !important; translate: 0 calc((1 - var(--on)) * 10px); }
.tk-say::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 14px; height: 14px; margin-left: -7px; background: var(--wash); border: solid var(--line-strong); border-width: 0 1px 1px 0; rotate: 45deg; }
.tk-figures { width: min(100%, 44svh, 400px); --nm-reach: 10px; }

/* 3. A ficha e o formulário. */
.tk-card { position: relative; align-self: center; padding: clamp(24px, 3.4vw, 44px); border-radius: 14px; animation: tk-in .6s var(--sf-spring) both; }
.tk-card :is(h1, h2), .tk-step legend { font: 700 clamp(1.7rem, 3vw, 2.5rem)/1.06 var(--font); letter-spacing: -.03em; color: var(--sf-card-ink); margin: 8px 0 18px; padding: 0; }
.tk-text { color: var(--sf-card-text); }
.tk-note { margin-top: 14px; font-size: .875rem; color: var(--sf-card-dim) !important; }
.tk-note a, .tk-card .link { color: var(--sf-card-ink); }
.tk-form { display: grid; gap: 16px; }
.tk-field { display: grid; gap: 6px; font-weight: 500; color: var(--sf-card-ink); }
.tk-field small, .tk-group-label { font-weight: 400; color: var(--sf-card-dim); }
.tk-field :is(input, textarea) { width: 100%; min-height: 52px; padding: 12px 14px; background: #FFFFFF; color: var(--sf-card-ink); border: 1px solid rgba(20, 24, 29, .28); border-radius: var(--radius); font: 400 1.0625rem/1.4 var(--font); }
.tk-field textarea { resize: vertical; min-height: 132px; }
.tk-field :is(input, textarea):focus-visible { outline: 2px solid var(--sf-card-dot); outline-offset: 1px; border-color: var(--sf-card-dot); }
.tk-error { color: #B42318; font-size: .9375rem; font-weight: 500; }
.tk-trap { position: absolute; left: -9999px; }
.tk-card .button { background: var(--sf-card-ink); border-color: var(--sf-card-ink); color: var(--sf-card); }
.tk-card .button:hover { background: var(--sf-card-dot); border-color: var(--sf-card-dot); color: #fff; }
.tk-card .button.wide { width: 100%; }
.tk-card :is(a, button, input, textarea):focus-visible { outline-color: var(--sf-card-dot); }
.tk-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.tk-nav > :only-child { margin-left: auto; }
.tk-group { display: grid; gap: 8px; }
.tk-group-label { margin: 0; font-size: .9375rem; }
.tk-card .sf-chips { margin: 0; }
.tk-card .sf-chips span { border-color: rgba(20, 24, 29, .3); color: var(--sf-card-ink); min-height: 42px; padding: 0 15px; }
.tk-card .sf-chips span:hover { border-color: var(--sf-card-ink); }
.tk-card .sf-chips input:checked + span { background: var(--sf-card-ink); border-color: var(--sf-card-ink); color: var(--sf-card); }
@keyframes tk-in { from { opacity: 0; transform: translateY(26px) rotate(1.2deg); } }

/* 4. Passos: sem JavaScript aparecem os três; com JavaScript (html.tk-js), um por vez. */
.tk-step { display: grid; gap: 16px; min-width: 0; margin: 0; padding: 0; border: 0; }
.tk-steps { gap: 36px; }
.tk-js .tk-steps { display: grid; gap: 0; }
.tk-js .tk-step { grid-area: 1 / 1; opacity: 0; visibility: hidden; translate: 36px 0; filter: blur(6px); transition: opacity .35s, translate .5s var(--sf-spring), filter .35s, visibility 0s .35s; }
.tk-js .tk-step.is-past { translate: -36px 0; }
.tk-js .tk-step.is-on { opacity: 1; visibility: visible; translate: 0; filter: none; transition-delay: .12s, .12s, .12s, 0s; }
html:not(.tk-js) .tk-step [data-tk-next], html:not(.tk-js) .tk-step [data-tk-back] { display: none; }

/* 5. O resumo. */
.tk-meta { color: var(--sf-card-dim) !important; margin: -8px 0 18px; }
.tk-needs { display: grid; border-top: 1px solid var(--sf-card-line); margin-bottom: 20px; }
.tk-needs li { position: relative; padding: 12px 0 12px 22px; border-bottom: 1px solid var(--sf-card-line); color: var(--sf-card-ink); }
.tk-needs li::before { content: ""; position: absolute; left: 2px; top: 1.25em; width: 8px; height: 8px; border-radius: 50%; background: var(--sf-card-dot); }
.tk-team { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 20px; }
.tk-team li { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; background: #101316; border-radius: 99px; }
.tk-team img { width: 44px; height: 44px; }
.tk-team span { display: grid; line-height: 1.2; }
.tk-team strong { color: #F0F6FC !important; }
.tk-team small { color: #94A3B8; font-size: .8125rem; }
.tk-next { margin: 18px 0 6px; padding: 14px 16px; background: color-mix(in srgb, var(--sf-card-dot) 10%, transparent); border-radius: var(--radius); color: var(--sf-card-ink) !important; }
.tk-redo { margin-top: 10px; }
/* Agenda no resumo: um botão por horário, agrupados por dia. */
/* A fileira de dias rola sozinha: sem min-width 0 ela alarga a coluna inteira do grid. */
.tk-card, .tk-agenda { min-width: 0; }
.tk-agenda { margin-top: 18px; scroll-margin-top: 80px; }
.tk-agenda .tk-text { margin: 4px 0 12px; }
.tk-notice { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius); color: var(--sf-card-ink); background: color-mix(in srgb, #DC2626 12%, transparent); }
.tk-slots { display: grid; gap: 12px; }
.tk-day { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tk-day legend { width: 100%; padding: 0; margin-bottom: 6px; font-weight: 600; color: var(--sf-card-ink); text-transform: capitalize; }
.tk-slot { min-width: 64px; padding: 8px 10px; border: 1px solid var(--sf-card-line); border-radius: var(--radius); background: transparent; color: var(--sf-card-ink); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color .15s, background .15s; }
.tk-slot:hover, .tk-slot:focus-visible { border-color: var(--sf-card-dot); background: color-mix(in srgb, var(--sf-card-dot) 10%, transparent); }
.tk-slots[aria-busy="true"] .tk-slot { opacity: .5; pointer-events: none; }
.tk-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: thin; }
.tk-pick { position: absolute; opacity: 0; pointer-events: none; }
.tk-days label { flex: 0 0 auto; display: grid; justify-items: center; min-width: 56px; padding: 6px 8px; border: 1px solid var(--sf-card-line); border-radius: var(--radius); color: var(--sf-card-ink); font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color .15s, background .15s; }
.tk-days label small { font-size: .75rem; color: var(--sf-card-dim); }
.tk-pick:checked + label { border-color: var(--sf-card-dot); background: color-mix(in srgb, var(--sf-card-dot) 14%, transparent); }
.tk-pick:focus-visible + label { outline: 2px solid var(--sf-card-dot); outline-offset: 2px; }
.tk-redo .link { font-size: .9375rem; color: var(--sf-card-dim); }
.tk-wait { display: flex; gap: 8px; margin: 22px 0 8px; }
.tk-wait span { width: 10px; height: 10px; border-radius: 50%; background: var(--sf-card-dot); animation: tk-wait 1.1s calc(var(--n, 0) * .16s) ease-in-out infinite; }
.tk-wait span:nth-child(2) { --n: 1; }
.tk-wait span:nth-child(3) { --n: 2; }
@keyframes tk-wait { 0%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-6px); } }
[data-tk-ready] { animation: tk-in .6s var(--sf-spring) both; }

/* 6. A janela do nome, na vitrine. */
.tk-dialog { width: min(92vw, 760px); max-height: 92svh; padding: 0; border: 0; background: none; color: inherit; overflow: visible; }
.tk-dialog::backdrop { background: rgba(8, 11, 14, .78); backdrop-filter: blur(6px); }
.tk-dialog[open] { animation: tk-in .5s var(--sf-spring) both; }
.tk-dialog-in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); align-items: end; gap: clamp(12px, 3vw, 32px); }
.tk-dialog .tk-host { gap: 12px; }
.tk-dialog .tk-figures { width: min(100%, 260px); }
.tk-dialog .tk-card { animation: none; }
.tk-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 50%; color: var(--sf-card-dim); font: 400 1.5rem/1 var(--font); cursor: pointer; }
.tk-close:hover { color: var(--sf-card-ink); background: rgba(20, 24, 29, .08); }

/* 7. Tablet e celular: o consultor sobe e encolhe, a ficha ocupa a largura. */
@media (max-width: 860px) {
  .tk-desk .sf-lamp { width: 30%; left: auto; right: 2%; scale: none; bottom: auto; top: 56px; }
  .tk-desk .sf-room { --hz: 24%; }
  .tk-desk::after { background: linear-gradient(rgb(var(--paper-rgb) / 0) 12%, rgb(var(--paper-rgb) / .86) 34%); }
  .tk-stage { grid-template-columns: 1fr; grid-template-rows: auto auto auto; align-content: start; gap: 14px; padding: 72px var(--sf-gutter) 24px; }
  .tk-path { margin-bottom: 4px; }
  .tk-path li { font-size: .75rem; }
  .tk-host { grid-template-columns: auto 1fr; align-items: center; justify-items: start; gap: 12px; }
  .tk-figures { order: -1; width: 96px; }
  .tk-say { font-size: 1rem; padding: 12px 14px; }
  .tk-say::after { left: -8px; bottom: auto; top: 50%; margin: -7px 0 0; border-width: 0 0 1px 1px; }
  .tk-dialog-in { grid-template-columns: 1fr; }
  .tk-dialog .tk-figures { width: 88px; }
  .tk-nav .button { flex: 1; }
}

/* 8. Movimento reduzido. */
@media (prefers-reduced-motion: reduce) {
  .tk-card, .tk-dialog[open], [data-tk-ready], .tk-wait span { animation: none; }
  .tk-js .tk-step { transition: none; translate: none; filter: none; }
}
