/* "Como funciona" em motion graphics: três cenas ilustradas em SVG que tocam em sequência, no estilo stories (howto.js). */
.howto{width:min(980px,100% - 48px);max-height:min(640px,100% - 48px);padding:0;border:0;border-radius:24px;background:var(--paper);color:var(--ink);overflow:hidden;box-shadow:0 50px 120px -30px rgba(11,18,32,.55)}
.howto::backdrop{background:rgba(11,18,32,.45);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.howto[open]{display:flex;animation:rise .28s cubic-bezier(.2,.7,.3,1)}
.hw-shell{flex:1;display:flex;flex-direction:column;min-height:0}
.hw-top{display:flex;align-items:center;gap:16px;padding:14px 14px 14px 24px;border-bottom:1px solid var(--line)}
.hw-segs{flex:1;display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.hw-seg{height:4px;border-radius:999px;background:#e4e7ec;overflow:hidden}
.hw-seg span{display:block;height:100%;border-radius:inherit;background:var(--ink);transform:scaleX(0);transform-origin:0 50%}
.hw-seg.is-done span{transform:scaleX(1)}
.hw-seg.is-active span{animation:hw-progress var(--dur,6.2s) linear forwards}
@keyframes hw-progress{to{transform:scaleX(1)}}
.hw-body{flex:1;display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);min-height:0;overflow-y:auto}
.hw-stage{position:relative;display:grid;place-items:center;padding:28px;background:radial-gradient(80% 70% at 50% 40%,#fff,#eef2f8);border-right:1px solid var(--line);cursor:pointer;-webkit-tap-highlight-color:transparent}
.hw-scene{grid-area:1/1;width:100%;height:auto;max-height:420px;overflow:visible;opacity:0;visibility:hidden;transition:opacity .35s,visibility 0s .35s}
.hw-scene.is-active{opacity:1;visibility:visible;transition:opacity .35s}
.hw-copy{display:flex;flex-direction:column;padding:34px 34px 30px}
.hw-count{margin:0 0 10px;font-size:12px;font-weight:700;letter-spacing:1.4px;text-transform:uppercase;color:var(--blue)}
.hw-copy h2{margin:0;font-family:var(--display);font-size:clamp(28px,2.8vw,38px);font-weight:800;letter-spacing:-.035em;line-height:1.08}
.hw-text{margin:14px 0 0;font-size:16px;line-height:1.6;color:var(--muted)}
.hw-copy.is-swap h2,.hw-copy.is-swap .hw-text,.hw-copy.is-swap .hw-count{animation:hw-copy .5s cubic-bezier(.2,.7,.3,1) both}
.hw-copy.is-swap .hw-text{animation-delay:.06s}
@keyframes hw-copy{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.hw-nav{display:flex;align-items:center;gap:8px;margin-top:24px}
.hw-nav .link-button{margin-left:8px}
.hw-cta{display:flex;flex-wrap:wrap;gap:10px;margin-top:auto;padding-top:28px}
.hw-cta .button-primary,.hw-cta .button-ghost{flex:1;min-width:150px}

/* Peças comuns das ilustrações */
.hw-panel{fill:#fff;stroke:#d0d5dd;stroke-width:1.5;filter:drop-shadow(0 18px 30px rgba(16,24,40,.12))}
.hw-rule{stroke:#e4e7ec;stroke-width:1.5}
.hw-dot{fill:#d0d5dd}
.hw-url{fill:#f2f4f7}
.hw-card{fill:#fff;stroke:#e4e7ec;stroke-width:1.2}
.hw-card.is-flat{stroke:none}
.hw-card.is-raised{filter:drop-shadow(0 14px 22px rgba(16,24,40,.14))}
.hw-photo{fill:#e4e8ef}
.hw-photo.is-blue{fill:#dbe6fb}
.hw-ln{fill:#e4e7ec}
.hw-ink{fill:#0b1220}
.hw-mtn{fill:none;stroke:#98a2b3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hw-phone{fill:#0b1220}
.hw-screen{fill:#f4f5f7}
.hw-avatar{fill:#0b1220}
.hw-avatar-t{fill:#fff;font:800 9px var(--sans);text-anchor:middle}
.hw-online{fill:#17b26a}
.hw-bubble{fill:#fff;stroke:#e4e7ec;stroke-width:1}
.hw-bubble-me{fill:#1849a9}
.hw-typedot{fill:#98a2b3}
.hw-ico-blue{fill:#eef4ff;stroke:#c7d7fe}
.hw-ico-green{fill:#079455}
.hw-ico-line{fill:none;stroke:#1849a9;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hw-ico-green+.hw-ico-line{stroke:#fff}
.hw-t-xs{fill:#667085;font:600 9.5px var(--sans)}
.hw-t-sm{fill:#0b1220;font:800 11px var(--sans)}
.hw-t-md{fill:#0b1220;font:800 15px var(--sans);letter-spacing:-.3px}
.hw-t-lg{fill:#0b1220;font:800 17px var(--sans);letter-spacing:-.4px}
.hw-t-row{fill:#1d2939;font:600 12.5px var(--sans)}
.hw-t-bubble{fill:#0b1220;font:600 9.5px var(--sans)}
.hw-t-bubble.is-light{fill:#fff}
.is-good{fill:#067647}
.hw-scene g{transform-box:fill-box;transform-origin:center}

/* Cena 1: escolher o carro */
.s1-card{opacity:0}
.is-active .s1-browser{animation:hw-pop .6s cubic-bezier(.2,.8,.3,1) both}
.is-active .s1-card{animation:hw-up .55s calc(.25s + var(--i)*.07s) cubic-bezier(.2,.8,.3,1) both}
.is-active .s1-pick{animation:hw-up .55s .32s cubic-bezier(.2,.8,.3,1) both,s1-lift .5s 2s cubic-bezier(.3,1.5,.5,1) forwards}
@keyframes s1-lift{to{opacity:1;transform:translateY(-6px) scale(1.07);filter:drop-shadow(0 14px 16px rgba(24,73,169,.28))}}
.s1-pick .hw-card{transition:stroke .3s}
.is-active .s1-pick .hw-card{animation:s1-stroke .1s 2s forwards}
@keyframes s1-stroke{to{stroke:#2563eb;stroke-width:2}}
.s1-cursor{opacity:0;fill:#0b1220;stroke:#fff;stroke-width:1.4;transform-box:view-box;transform-origin:0 0}
.is-active .s1-cursor{animation:s1-cursor 1.9s .9s cubic-bezier(.5,0,.2,1) forwards}
@keyframes s1-cursor{0%{opacity:0;transform:translate(360px,270px)}12%{opacity:1}70%{transform:translate(166px,108px)}78%{transform:translate(166px,108px) scale(.82)}86%{transform:translate(166px,108px) scale(1)}100%{opacity:1;transform:translate(166px,108px)}}
.s1-ripple{fill:none;stroke:#2563eb;stroke-width:2;opacity:0}
.is-active .s1-ripple{animation:s1-ripple .7s 2.35s ease-out forwards}
@keyframes s1-ripple{0%{opacity:.8;transform:scale(.3)}100%{opacity:0;transform:scale(2.2)}}
.s1-ripple{transform-box:fill-box;transform-origin:center}
.s1-pop{opacity:0}
.is-active .s1-pop{animation:s1-pop .7s 2.5s cubic-bezier(.2,.8,.3,1) forwards}
@keyframes s1-pop{from{opacity:0;transform:translateX(26px) scale(.96)}to{opacity:1;transform:none}}
.s1-track{fill:none;stroke:#e9ecf1;stroke-width:9;stroke-linecap:round}
.s1-fill{fill:none;stroke:#079455;stroke-width:9;stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:100}
.is-active .s1-fill{animation:s1-fill 1.3s 3s cubic-bezier(.2,.8,.2,1) forwards}
@keyframes s1-fill{to{stroke-dashoffset:40}}
.s1-needle{transform-box:view-box;transform-origin:370px 190px}
.s1-needle line{stroke:#0b1220;stroke-width:3.5;stroke-linecap:round}
.s1-needle circle{fill:#0b1220;stroke:#fff;stroke-width:2}
.is-active .s1-needle{animation:s1-needle 1.4s 3s cubic-bezier(.3,1.35,.45,1) forwards}
@keyframes s1-needle{to{transform:rotate(144deg)}}
.s1-chip{opacity:0}
.s1-chip rect{fill:#079455}
.s1-chip text{fill:#fff;font:800 10.5px var(--sans);text-anchor:middle}
.is-active .s1-chip{animation:hw-bounce .55s 4s cubic-bezier(.3,1.6,.5,1) forwards}

/* Cena 2: falar com a equipe */
.s2-me,.s2-typing,.s2-reply,.s2-pic,.s2-float{opacity:0}
.is-active .s2-phone{animation:hw-pop .6s cubic-bezier(.2,.8,.3,1) both}
.s2-me{transform-origin:100% 100%}
.is-active .s2-me{animation:hw-bubble .5s .45s cubic-bezier(.3,1.5,.5,1) forwards}
.s2-read{fill:none;stroke:#93c5fd;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;opacity:0}
.is-active .s2-read{animation:hw-fade .3s 1.15s forwards}
.s2-typing,.s2-reply{transform-origin:0 100%}
.is-active .s2-typing{animation:hw-bubble .4s 1.35s cubic-bezier(.3,1.5,.5,1) forwards,hw-out .2s 2.45s forwards}
.is-active .hw-typedot{animation:s2-type .9s 1.4s ease-in-out infinite}
.hw-typedot:nth-child(3){animation-delay:1.55s!important}.hw-typedot:nth-child(4){animation-delay:1.7s!important}
@keyframes s2-type{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-3px);opacity:1}}
.hw-typedot{transform-box:fill-box;transform-origin:center}
.is-active .s2-reply{animation:hw-bubble .5s 2.55s cubic-bezier(.3,1.5,.5,1) forwards}
.is-active .s2-pic{animation:hw-up .5s calc(3.15s + var(--i)*.12s) cubic-bezier(.2,.8,.3,1) forwards}
.is-active .s2-float-a{animation:s2-float-a .7s 3.7s cubic-bezier(.2,.8,.3,1) forwards,hw-hover 3s 4.4s ease-in-out infinite alternate}
.is-active .s2-float-b{animation:s2-float-b .7s 4.1s cubic-bezier(.2,.8,.3,1) forwards,hw-hover 3s 4.8s ease-in-out infinite alternate}
@keyframes s2-float-a{from{opacity:0;transform:translateX(-20px)}to{opacity:1;transform:none}}
@keyframes s2-float-b{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:none}}
@keyframes hw-hover{from{opacity:1;transform:translateY(0)}to{opacity:1;transform:translateY(-5px)}}

/* Cena 3: decidir com segurança */
.s3-row,.s3-badge,.s3-rays{opacity:0}
.s3-dots{display:none}
.is-active .s3-card{animation:hw-pop .6s cubic-bezier(.2,.8,.3,1) both}
.is-active .s3-row{animation:hw-up .5s calc(.35s + var(--i)*.12s) cubic-bezier(.2,.8,.3,1) forwards}
.s3-box{fill:#fff;stroke:#d0d5dd;stroke-width:1.6}
.is-active .s3-box{animation:s3-box .3s calc(1.15s + var(--i)*.55s) ease forwards}
@keyframes s3-box{to{fill:#079455;stroke:#079455}}
.s3-check{fill:none;stroke:#fff;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1}
.is-active .s3-check{animation:hw-draw .35s calc(1.25s + var(--i)*.55s) cubic-bezier(.6,0,.3,1) forwards}
.is-active .s3-badge{animation:hw-bounce .6s 2.95s cubic-bezier(.3,1.6,.5,1) forwards}
.s3-ring{fill:none;stroke:#079455;stroke-width:2;opacity:.5}
.is-active .s3-ring{animation:s3-ring 1.6s 3.4s ease-out infinite}
@keyframes s3-ring{0%{opacity:.6;transform:scale(1)}100%{opacity:0;transform:scale(1.6)}}
.s3-ring{transform-box:fill-box;transform-origin:center}
.s3-big{fill:none;stroke:#fff;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1}
.is-active .s3-big{animation:hw-draw .45s 3.25s cubic-bezier(.6,0,.3,1) forwards}
.s3-rays{fill:none;stroke:#17b26a;stroke-width:2.4;stroke-linecap:round}
.is-active .s3-rays{animation:s3-rays .6s 3.4s ease-out forwards}
@keyframes s3-rays{0%{opacity:0;transform:scale(.7)}50%{opacity:1}100%{opacity:0;transform:scale(1.15)}}

/* Movimentos base */
@keyframes hw-pop{from{opacity:0;transform:translateY(14px) scale(.97)}to{opacity:1;transform:none}}
@keyframes hw-up{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes hw-bubble{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:none}}
@keyframes hw-bounce{from{opacity:0;transform:scale(.5)}to{opacity:1;transform:none}}
@keyframes hw-fade{to{opacity:1}}
@keyframes hw-out{to{opacity:0;transform:scale(.8)}}
@keyframes hw-draw{to{stroke-dashoffset:0}}

/* Pausa (segurar) e movimento reduzido */
.howto.is-paused .hw-seg.is-active span,.howto.is-paused .hw-scene.is-active *{animation-play-state:paused!important}
.howto.is-calm .hw-scene *{animation-duration:.01s!important;animation-delay:0s!important;animation-iteration-count:1!important}
.howto.is-calm .hw-seg.is-active span{animation:none;transform:scaleX(1)}

/* Botão "Veja como funciona" no topo */
.how-play{display:inline-flex;align-items:center;gap:10px;min-height:50px;padding:0 6px;border:0;background:none;font:600 15px var(--sans);color:var(--ink);cursor:pointer;white-space:nowrap}
.how-play-ico{position:relative;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--blue);color:#fff;box-shadow:0 8px 18px -8px rgba(24,73,169,.7);transition:transform .2s}
.how-play-ico::after{content:"";position:absolute;inset:-5px;border-radius:50%;border:2px solid rgba(37,99,235,.35);animation:how-pulse 2.2s ease-out infinite}
@keyframes how-pulse{0%{transform:scale(.85);opacity:1}100%{transform:scale(1.35);opacity:0}}
.how-play-ico svg{width:14px;height:14px;fill:currentColor;margin-left:2px}
.how-play:hover .how-play-ico{transform:scale(1.08)}
.how-play:hover{color:var(--blue)}
@media (prefers-reduced-motion:reduce){.how-play-ico::after{animation:none;opacity:0}}

@media (max-width:860px){
 .howto{width:100%;max-width:100%;height:100%;max-height:100%;margin:0;border-radius:0}
 .hw-top{padding:calc(10px + env(safe-area-inset-top,0px)) 12px 10px 16px}
 .hw-body{grid-template-columns:1fr;grid-template-rows:auto 1fr}
 .hw-stage{padding:18px 14px;border-right:0;border-bottom:1px solid var(--line)}
 .hw-copy{padding:22px 18px calc(18px + env(safe-area-inset-bottom,0px))}
 .hw-copy h2{font-size:28px}
 .hw-text{font-size:15px}
 .hw-nav{margin-top:16px}
 .hw-cta{padding-top:20px}
}
