/* ==========================================================
   Rastrek | Download do aplicativo
   Mobile-first: estilos base para celular, ajustes para telas maiores no final.
   ========================================================== */

:root {
  --amarelo: #fdb813;
  --grafite: #333333;
  --branco: #ffffff;
  --cinza-claro: #f7f7f7;
  --texto-2: #666666;
  --linha: rgba(51, 51, 51, .08);

  /* Saída suave sem rebote, como uma mola criticamente amortecida */
  --suave: cubic-bezier(.22, 1, .36, 1);

  --margem: max(20px, env(safe-area-inset-left));
  --margem-dir: max(20px, env(safe-area-inset-right));
  --largura: 1080px;
}

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

body {
  margin: 0;
  background: var(--branco);
  color: var(--grafite);
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--grafite); outline-offset: 4px; border-radius: 12px; }

/* ---------- Seção principal ---------- */
.hero { overflow-x: hidden; overflow-x: clip; padding: calc(40px + env(safe-area-inset-top)) var(--margem-dir) 0 var(--margem); }

.hero-grade {
  max-width: var(--largura);
  margin: 0 auto;
  display: grid;
  gap: 32px;
}

.hero-texto { text-align: center; }

h1 {
  margin: 0 auto;
  max-width: 12ch;
  font-size: clamp(2rem, 1.25rem + 3.6vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -.03em;
  font-weight: 700;
  text-wrap: balance;
}

.sub {
  margin: 16px auto 28px;
  max-width: 30ch;
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  line-height: 1.45;
  letter-spacing: -.008em;
  color: var(--texto-2);
}

/* ---------- Botões das lojas ---------- */
.lojas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.selo {
  display: inline-flex;
  height: 54px;                       /* área de toque acima de 44px */
  border-radius: 12px;
  text-decoration: none;
  transition: transform .25s var(--suave), box-shadow .25s var(--suave);
}
@media (hover: hover) {
  .selo:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -12px rgba(0, 0, 0, .45); }
}
.selo:active { transform: scale(.97); transition-duration: .1s; }   /* resposta imediata ao toque */

.selo img { height: 100%; width: auto; }       /* selo oficial: proporção preservada */
.selo img + .selo-txt { display: none; }      /* com o selo oficial na pasta, o botão provisório some */

.selo-txt {                                     /* botão com ícone e texto */
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 176px; padding: 0 20px 0 16px;
  background: #000; color: #fff; border-radius: 12px;
  line-height: 1.1; text-align: left;
}
.selo-txt > span { display: flex; flex-direction: column; }
.selo-ic { flex: none; width: 26px; height: 26px; fill: currentColor; }
.selo-txt small { font-size: .72rem; opacity: .85; }
.selo-txt strong { font-size: 1.22rem; font-weight: 600; letter-spacing: -.015em; }

/* Só a loja do aparelho identificado */
.os-ios .selo-android, .os-android .selo-ios { display: none; }
.os-ios .selo, .os-android .selo { height: 60px; }
.os-ios .selo-txt, .os-android .selo-txt { min-width: 220px; }
.os-ios .selo-ic, .os-android .selo-ic { width: 28px; height: 28px; }

/* ---------- Logo discreta acima do título ---------- */
.logo { display: block; width: 104px; margin: 0 auto 22px; opacity: .9; }
.logo img { width: 100%; height: auto; }

/* ---------- Celular ---------- */
.hero-visual {
  --fone: min(220px, 58vw);
  --disco: min(320px, 84vw);
  position: relative;
  display: flex;
  justify-content: center;
  height: clamp(360px, 104vw, 440px);   /* no celular mostra a parte de cima, sem empurrar demais a página */
  padding-top: 24px;
  overflow: hidden;
  perspective: 1200px;
  -webkit-mask-image: linear-gradient(#000 72%, transparent 100%);
  mask-image: linear-gradient(#000 72%, transparent 100%);
}

/* Disco amarelo com ondas de sinal saindo do centro */
.disco {
  position: absolute;
  left: 50%; top: calc(24px + var(--fone) * .38);
  width: var(--disco); aspect-ratio: 1;
  margin-left: calc(var(--disco) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd15a, var(--amarelo) 55%, #f2a900);
  animation: disco 1.1s var(--suave) .1s both;
}
@keyframes disco { from { opacity: 0; transform: scale(.7); } }

.onda {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(253, 184, 19, .55);
  opacity: 0;
  animation: onda 6s cubic-bezier(.2, .6, .3, 1) 1.2s 3;   /* 3 ciclos e para: não compete com a leitura */
}
.onda:nth-child(2) { animation-delay: 3.2s; }
.onda:nth-child(3) { animation-delay: 5.2s; }
@keyframes onda { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.75); opacity: 0; } }

.fone-wrap { position: relative; z-index: 2; height: max-content; }

.aparelho {
  width: var(--fone);
  padding: 9px;
  border-radius: 48px;
  background: linear-gradient(150deg, #3a3a3c, #111113);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .12),
    0 2px 4px rgba(0, 0, 0, .08),
    0 40px 70px -28px rgba(51, 40, 0, .55);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
}
@media (hover: hover) and (pointer: fine) { .aparelho { will-change: transform; } }

/* Etiquetas de vidro */
.etiqueta {
  position: absolute; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px 9px 9px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 14px 30px -14px rgba(0, 0, 0, .3);
  font-size: .8125rem; font-weight: 600; line-height: 1.2; letter-spacing: -.005em; color: var(--grafite);
  white-space: nowrap;
  translate: var(--px, 0px) var(--py, 0px);
  animation: etiqueta .9s var(--suave) both;
}
.etiqueta-ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--grafite); }
.etiqueta-ic svg { width: 17px; height: 17px; fill: none; stroke: var(--amarelo); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.etiqueta-a { top: 24%; left: 0; animation-delay: .8s; }
.etiqueta-b { top: 50%; right: 0; animation-delay: 1s; }
@keyframes etiqueta { from { opacity: 0; transform: translateY(10px) scale(.94); } }

.tela {
  position: relative;
  aspect-ratio: 600 / 1303;
  border-radius: 39px;
  overflow: hidden;
  background: #151517;
  isolation: isolate;
}

.cena { position: absolute; inset: 0; }
.cena img { width: 100%; height: 100%; object-fit: cover; }

/* Abertura: aparece e some por cima de tudo */
.cena-abertura { z-index: 4; opacity: 0; transition: opacity .5s ease; }
[data-cena="0"] .cena-abertura { opacity: 1; }

/* Tela inicial: recua e escurece quando a de rastreamento entra por cima */
.cena-inicio { z-index: 1; transition: transform .6s var(--suave), filter .6s var(--suave); }
[data-cena="2"] .cena-inicio { transform: translateX(-28%); filter: brightness(.6); }

/* Rastreamento: entra pela direita e volta pela direita (mesmo caminho, como o "voltar" do iPhone) */
.cena-rastreio {
  z-index: 3; transform: translateX(100%);
  box-shadow: -12px 0 30px rgba(0, 0, 0, .18);
  transition: transform .6s var(--suave);
}
[data-cena="2"] .cena-rastreio { transform: none; }

/* Toque em "Meus veículos" */
.toque {
  position: absolute; left: 18.8%; top: 41.6%;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; background: var(--grafite); opacity: 0; pointer-events: none;
}
.tela.tocando .toque { animation: toque .7s ease-out forwards; }
@keyframes toque { 0% { transform: scale(.3); opacity: .35; } 100% { transform: scale(1.5); opacity: 0; } }

/* Radar no pin do veículo */
.radar {
  position: absolute; left: 47.1%; top: 36.1%;
  width: 56px; height: 56px; margin: -28px 0 0 -28px;
  border-radius: 50%; border: 2px solid #1db954; opacity: 0; pointer-events: none;
}
[data-cena="2"] .radar { animation: radar 1.8s ease-out .5s 3; }
[data-cena="2"] .radar + .radar { animation-delay: 1.4s; }
@keyframes radar { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

.coluna-visual { min-width: 0; }

/* ---------- QR code (só no computador) ---------- */
.qr { display: none; }
@media (min-width: 900px) {
  .qr:not([hidden]) {
    display: flex; align-items: center; gap: 16px;
    max-width: 360px; margin-top: 28px; padding: 12px 18px 12px 12px;
    border-radius: 18px; background: var(--cinza-claro); border: 1px solid var(--linha);
    animation: surge .9s var(--suave) .3s both;
  }
}
.qr-codigo { flex: none; width: 88px; height: 88px; padding: 6px; border-radius: 10px; background: #fff; }
.qr-codigo svg { display: block; width: 100%; height: 100%; }
.qr p { margin: 0; font-size: .8125rem; line-height: 1.4; color: var(--texto-2); }
.qr strong { display: block; margin-bottom: 2px; font-size: .9375rem; font-weight: 600; color: var(--grafite); letter-spacing: -.01em; }

/* ---------- Funcionalidades ---------- */
.recursos { padding: 52px var(--margem-dir) calc(56px + env(safe-area-inset-bottom)) var(--margem); }

/* Um único painel grafite, com os itens separados por linhas finas (sem cards individuais) */
.itens {
  list-style: none;
  margin: 0 auto;
  padding: 6px 22px;
  max-width: var(--largura);
  display: grid;
  background: var(--grafite);
  border-radius: 28px;
  color: var(--branco);
}

.item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
}
.item + .item { border-top: 1px solid rgba(255, 255, 255, .1); }

.icone {
  flex: none;
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(253, 184, 19, .14);
}
.icone svg { width: 21px; height: 21px; fill: none; stroke: var(--amarelo); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.item h2 { margin: 1px 0 0; font-size: .9375rem; line-height: 1.3; letter-spacing: -.01em; font-weight: 600; color: var(--branco); }
.item p { margin: 3px 0 0; font-size: .8125rem; line-height: 1.45; color: rgba(255, 255, 255, .66); }

/* ---------- Animações de entrada ---------- */
@keyframes surge { from { opacity: 0; transform: translateY(12px); } }
@keyframes surge-visual { from { opacity: 0; transform: translateY(36px); } }

.entra { animation: surge .9s var(--suave) both; }
.sub.entra { animation-delay: .08s; }
.lojas.entra { animation-delay: .16s; }
.entra-visual { animation: surge-visual 1.1s var(--suave) .25s both; }

.js .revela {
  opacity: 0; transform: translateY(16px);
  transition: opacity .7s var(--suave), transform .7s var(--suave), background-color .3s ease, border-color .3s ease;
}
.js .revela.visivel { opacity: 1; transform: none; }

/* Itens entram em sequência, um após o outro */
.js .item.revela:nth-child(2) { transition-delay: .08s; }
.js .item.revela:nth-child(3) { transition-delay: .16s; }
.js .item.revela:nth-child(4) { transition-delay: .24s; }


/* ---------- Tablet: 2 x 2 ---------- */
@media (min-width: 600px) {
  .hero-visual { --fone: 230px; --disco: 360px; height: 470px; }
  .etiqueta-a { left: calc(50% - var(--fone) / 2 - 110px); }
  .etiqueta-b { right: auto; left: calc(50% + var(--fone) / 2 - 40px); }

  .itens { grid-template-columns: 1fr 1fr; padding: 8px 32px; border-radius: 32px; }
  .item { padding: 28px 0; }
  .item + .item { border-top: 0; }
  .item:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .1); }
  .item:nth-child(odd) { padding-right: 28px; }
  .item:nth-child(even) { padding-left: 28px; border-left: 1px solid rgba(255, 255, 255, .1); }
}

/* ---------- Desktop: duas colunas ---------- */
@media (min-width: 900px) {
  .hero { padding-top: calc(72px + env(safe-area-inset-top)); }
  .hero-grade { grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; }

  .hero-texto { text-align: left; }
  h1, .sub, .logo { margin-left: 0; margin-right: 0; }
  .logo { width: 116px; margin-bottom: 26px; }
  .sub { margin-top: 20px; margin-bottom: 36px; max-width: 32ch; }
  .lojas { justify-content: flex-start; }

  .hero-visual { --fone: min(252px, 24vw); --disco: min(420px, 40vw); height: auto; padding: 20px 0 16px; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .disco { top: 50%; margin-top: calc(var(--disco) / -2); }
  .aparelho { border-radius: 52px; padding: 10px; }
  .etiqueta { padding: 11px 18px 11px 11px; font-size: .875rem; }
  .etiqueta-ic { width: 36px; height: 36px; }
  .etiqueta-a { top: 22%; left: calc(50% - var(--fone) / 2 - 120px); }
  .etiqueta-b { top: 62%; right: auto; left: min(calc(50% + var(--fone) / 2 - 50px), calc(100% - 150px)); }
  .tela { border-radius: 44px; }

  .recursos { padding-top: 128px; padding-bottom: 104px; }

  /* Uma faixa com 4 colunas separadas por linhas verticais */
  .itens { grid-template-columns: repeat(4, 1fr); padding: 44px 8px; border-radius: 36px; }
  .item, .item:nth-child(odd), .item:nth-child(even) {
    flex-direction: column; gap: 20px;
    padding: 0 30px; border-top: 0; border-left: 0;
  }
  .item + .item { border-left: 1px solid rgba(255, 255, 255, .1); }
  .icone { width: 48px; height: 48px; }
  .icone svg { width: 24px; height: 24px; }
  .item h2 { font-size: 1rem; }
  .item p { font-size: .8125rem; }
}

/* ---------- 320px ---------- */
@media (max-width: 360px) {
  .selo, .selo-txt { width: 100%; }
  .etiqueta { font-size: .75rem; padding: 7px 10px 7px 7px; }
  .etiqueta-ic { width: 28px; height: 28px; }
  .itens { padding: 4px 18px; }
  .item { gap: 14px; }
}

/* ---------- Acessibilidade ---------- */
@media (prefers-reduced-motion: reduce) {
  .entra, .entra-visual, .disco, .etiqueta { animation: none; }
  .onda { animation: none; opacity: .5; }
  .onda:nth-child(2) { transform: scale(1.3); opacity: .3; }
  .onda:nth-child(3) { transform: scale(1.6); opacity: .15; }
  .aparelho { transform: none !important; }
  .etiqueta { translate: none !important; }
  .js .revela { transform: none; transition: opacity .3s ease; }
  .cena-inicio, [data-cena="2"] .cena-inicio { transform: none; filter: none; transition: none; }
  .cena-rastreio { transform: none; opacity: 0; box-shadow: none; transition: opacity .3s ease; }
  [data-cena="2"] .cena-rastreio { opacity: 1; }
  .cena-abertura { transition: opacity .3s ease; }
  .selo { transition: none; }
  .selo:hover, .selo:active { transform: none; }
  .radar, .toque { display: none; }
}

@media (prefers-contrast: more) {
  :root { --texto-2: #444444; }
  .item p { color: rgba(255, 255, 255, .85); }
}

/* Menos transparência: vidro vira superfície sólida */
@media (prefers-reduced-transparency: reduce) {
  .etiqueta { background: var(--branco); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--linha); }
}

/* ---------- Modo escuro (segue o ajuste do aparelho) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --branco: #161617;              /* fundo da página */
    --grafite: #f5f5f7;             /* texto principal */
    --cinza-claro: #232325;
    --texto-2: #a1a1a6;
    --linha: rgba(255, 255, 255, .1);
  }
  .logo { opacity: 1; }
  .selo-txt { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }   /* contorno, como nos selos oficiais em fundo escuro */
  .aparelho { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 40px 70px -28px rgba(0, 0, 0, .8); }
  .etiqueta { background: rgba(44, 44, 46, .72); border-color: rgba(255, 255, 255, .12); color: #f5f5f7; }
  .etiqueta-ic { background: #0b0b0c; }
  .onda { border-color: rgba(253, 184, 19, .4); }
  .itens { background: #232325; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
  .item h2 { color: #f5f5f7; }
  :focus-visible { outline-color: var(--amarelo); }
}
@media (prefers-color-scheme: dark) and (prefers-reduced-transparency: reduce) {
  .etiqueta { background: #2c2c2e; }
}
