/* =====================================================================
   GDVet · Seções animadas das páginas de venda (GDAV e GDETIV)
   Carregar DEPOIS de styles.css, produto.css, pre-checkout.css e do CSS
   do curso (gdav.css ou gdetiv.css).
   Prefixo m- para não colidir com os componentes v2-* existentes.
   Usa as variáveis do site (--course, --bg-card, --text, --radius...),
   então funciona no tema escuro e no claro e herda a cor do curso.
   Versão 2026.11.11.01: as variáveis m- passam a ser calculadas também
   no elemento com data-course (o site define --course no <body>, não
   no :root). Sem isso, o GDETIV ficaria laranja.
   ===================================================================== */

:root, [data-course] {
  --m-accent: var(--course, #F2811D);
  --m-accent-2: var(--course-2, #FF9D40);
  --m-ink-on-accent: #0A1424;
  --m-card: var(--bg-card, #122E54);
  --m-line: var(--line, rgba(255, 255, 255, 0.08));
  --m-muted: var(--text-muted, #97A6BD);
  --m-radius: var(--radius, 14px);
  --m-radius-lg: var(--radius-lg, 22px);
  --m-shadow: var(--shadow-lg, 0 20px 50px -12px rgba(11, 31, 58, 0.4));
  --m-phone-frame: #1F2D44;
}

/* ---------- utilitários de movimento ---------- */
@keyframes m-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes m-pop { 0%, 30% { opacity: 0; transform: translateY(10px) scale(.96); } 40%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes m-fill { 0% { width: 12%; } 65%, 100% { width: 70%; } }
@keyframes m-cycle { 0% { opacity: 0; } 4%, 30% { opacity: 1; } 34%, 100% { opacity: 0; } }
@keyframes m-scrollshot { 0%, 15% { transform: translateY(0); } 55%, 85% { transform: translateY(var(--m-scroll, -110px)); } 100% { transform: translateY(0); } }
@keyframes m-stamp { 0%, 40% { opacity: 0; transform: scale(1.4) rotate(-8deg); } 48%, 92% { opacity: 1; transform: scale(1) rotate(-8deg); } 100% { opacity: 0; transform: scale(1) rotate(-8deg); } }
@keyframes m-line { from { height: 0; } to { height: 100%; } }
@keyframes m-dot { from { transform: scale(.4); background: var(--m-line); } to { transform: scale(1); background: var(--m-accent); } }
@keyframes m-check { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.m-float { animation: m-float 5s ease-in-out infinite; }
.m-pop { animation: m-pop 7s ease-out infinite; }

/* animações em loop só rodam quando a seção está visível (JS põe .m-on) */
[data-m-loop] *, [data-m-loop] { animation-play-state: paused; }
[data-m-loop].m-on *, [data-m-loop].m-on { animation-play-state: running; }

/* ---------- cartões e chips ---------- */
.m-card {
  background: var(--m-card);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  padding: 14px 16px;
}
.m-chip-card {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  background: var(--m-card);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  padding: 11px 12px;
  box-shadow: var(--m-shadow);
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text, #F5F7FA);
}
.m-chip-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--m-accent-2);
  margin-bottom: 3px;
}
.m-chip-card small { display: block; font-size: 10.5px; color: var(--m-muted); margin-top: 5px; }
.m-progress { display: block; height: 4px; margin-top: 9px; border-radius: 2px; background: var(--m-line); overflow: hidden; }
.m-progress > span { display: block; height: 4px; width: 70%; border-radius: 2px; background: var(--m-accent); animation: m-fill 7s ease-out infinite; }

/* ---------- moldura de celular (CSS, sem imagem) ---------- */
.m-phone {
  position: relative;
  width: 200px;
  aspect-ratio: 9 / 18.5;
  box-sizing: border-box;
  border: 7px solid var(--m-phone-frame);
  border-radius: 32px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--m-shadow);
}
.m-phone > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.m-phone > img.m-scrollshot { height: auto; inset: 0 auto auto 0; animation: m-scrollshot 9s ease-in-out infinite; }
.m-phone--chat { background: #EFEAE2; }

/* troca de telas em ciclo (3 imagens) */
.m-cycle { opacity: 0; animation: m-cycle 10.5s linear infinite; }
.m-cycle:nth-of-type(2) { animation-delay: 3.5s; }
.m-cycle:nth-of-type(3) { animation-delay: 7s; }

/* =====================================================================
   1. TOPO (hero)
   Acrescente a classe m-hero no <header class="prod-hero">.
   ===================================================================== */
.m-hero-visual { position: relative; width: 100%; max-width: 440px; height: 300px; margin: 6px auto 4px; }
.m-hero-visual .m-hero-mock { position: absolute; right: -10px; top: 0; width: 278px; height: auto; max-height: 300px; object-fit: contain; }
.m-hero-visual .m-hero-card-aula { left: 0; top: 22px; width: 156px; }
.m-hero-visual .m-hero-card-grupo { left: 0; top: 172px; width: 176px; background: #F5F7FA; color: #0A1424; border-radius: 14px 14px 14px 4px; }
.m-hero-visual .m-hero-card-grupo .m-chip-kicker { color: #C66912; }
[data-course="gdetiv"] .m-hero-visual .m-hero-card-grupo .m-chip-kicker { color: #B71F23; }
.m-hero-selos { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 12.5px; color: var(--m-muted); margin-top: 12px; }
.m-hero-coord { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12.5px; line-height: 1.35; color: var(--m-muted); }
.m-hero-coord img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--m-accent); flex-shrink: 0; }
.m-hero-coord strong { color: var(--text, #F5F7FA); font-weight: 600; }

/* No site, .prod-hero-visual é um cartão 4:5 com fundo, sombra e overflow
   escondido (produto.css). No topo novo o mockup flutua solto, como no
   protótipo, sem ser cortado. */
.m-hero .prod-hero-visual {
  /* o margin: 0 auto do produto.css encolhia o item da grade até o conteúdo,
     que é todo absoluto: largura 0 e o mockup sumia no computador */
  width: 100%;
  max-width: none;
  aspect-ratio: auto;
  background: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}
.m-hero .prod-hero-visual::before,
.m-hero .prod-hero-visual::after { display: none; }

/* linha de preço e link de perfil do topo */
.m-hero-preco { margin: 4px 0 0; font-size: 15px; color: var(--m-muted); }
.m-hero-preco strong { color: var(--text, #F5F7FA); font-weight: 700; }
.m-hero .prod-hero-cta { flex-direction: column; align-items: flex-start; margin-bottom: 0; }
.m-hero-perfil { font-size: 14px; }
@media (max-width: 899px) {
  .m-hero .prod-hero-cta { align-items: stretch; text-align: center; }
  .m-hero .prod-hero-cta .btn { justify-content: center; }
  .m-hero-preco { text-align: center; }
}

@media (max-width: 899px) {
  /* no celular a imagem do produto entra logo depois do título */
  .m-hero .prod-hero-inner { display: flex; flex-direction: column; gap: 12px; }
  .m-hero .prod-hero-content { display: contents; }
  .m-hero .prod-hero-content > * { order: 6; }
  .m-hero .prod-breadcrumb, .m-hero .prod-hero-course-logo { display: none; }
  .m-hero .prod-tag { order: 3; }
  .m-hero .prod-title { order: 4; }
  .m-hero .prod-hero-visual { order: 5; width: 100%; margin: 0; padding: 0; }
  .m-hero .prod-title { margin-bottom: 0; }
}
@media (min-width: 900px) {
  .m-hero-visual { height: 520px; max-width: 560px; }
  .m-hero-visual .m-hero-mock { width: 480px; max-height: 520px; right: 0; }
  .m-hero-visual .m-hero-card-aula { top: 40px; width: 190px; }
  .m-hero-visual .m-hero-card-grupo { top: 290px; width: 220px; }
  .m-hero-selos { justify-content: flex-start; }
}

/* =====================================================================
   2. TRÊS SOLUÇÕES (abas)
   ===================================================================== */
.m-tablist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  max-width: 520px;
  margin: 0 auto 18px;
  padding: 4px;
  background: var(--bg-alt, #0E2647);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
}
.m-tablist [role="tab"] {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text, #F5F7FA);
  opacity: .8;
  font: 600 14.5px/1 var(--font-body, Inter, system-ui, sans-serif);
  cursor: pointer;
  transition: background .2s, color .2s, opacity .2s;
}
.m-tablist [role="tab"][aria-selected="true"] { background: var(--m-accent); color: var(--m-ink-on-accent); opacity: 1; }
.m-tablist [role="tab"]:focus-visible { outline: 2px solid var(--m-accent-2); outline-offset: 2px; }

.m-panel { display: grid; gap: 18px; justify-items: center; }
.m-panel[hidden] { display: none; }
.m-panel-visual { display: flex; justify-content: center; align-items: center; min-height: 390px; width: 100%; }
.m-panel-visual .m-phone { width: 196px; }
.m-panel-visual .m-mock { width: 312px; max-width: 100%; height: auto; }
.m-panel-text { max-width: 520px; }
.m-panel-lead { margin: 0; font-size: 16px; line-height: 1.5; }
.m-panel-lead strong { font-weight: 700; }
.m-panel-solve { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--m-line); font-size: 14px; line-height: 1.45; color: var(--m-muted); }
.m-panel-solve strong { color: var(--m-accent-2); }

@media (min-width: 900px) {
  .m-panel { grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; max-width: 980px; margin: 0 auto; }
  .m-panel-visual { min-height: 460px; }
  .m-panel-visual .m-phone { width: 230px; }
  .m-panel-visual .m-mock { width: 400px; }
  .m-panel-lead { font-size: 18px; }
}

/* =====================================================================
   3. PRIMEIRA SEMANA (linha do tempo)
   ===================================================================== */
.m-timeline { position: relative; list-style: none; margin: 0 auto; padding: 0 0 0 28px; max-width: 640px; display: grid; gap: 14px; }
.m-timeline::before { content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 2px; background: var(--m-line); }
.m-timeline::after { content: ""; position: absolute; left: 8px; top: 10px; width: 2px; height: 0; background: var(--m-accent); }
.m-timeline.m-in::after { animation: m-line 1.6s ease-out .2s forwards; }
.m-step { position: relative; display: flex; gap: 12px; align-items: center; }
.m-step::before {
  content: ""; position: absolute; left: -27px; top: 50%; margin-top: -8px;
  width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box;
  border: 3px solid var(--bg-alt, #0E2647); background: var(--m-line);
}
.m-timeline.m-in .m-step::before { animation: m-dot .3s ease-out both; }
.m-timeline.m-in .m-step:nth-child(1)::before { animation-delay: .25s; }
.m-timeline.m-in .m-step:nth-child(2)::before { animation-delay: .65s; }
.m-timeline.m-in .m-step:nth-child(3)::before { animation-delay: 1.05s; }
.m-timeline.m-in .m-step:nth-child(4)::before { animation-delay: 1.45s; }
.m-step-thumb { width: 64px; height: 80px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.m-step-when { display: block; font-family: var(--font-display, Fraunces, Georgia, serif); font-size: 17px; font-weight: 600; color: var(--m-accent-2); }
.m-step p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: var(--text, #F5F7FA); opacity: .9; }
.m-note { margin: 16px auto 0; max-width: 640px; text-align: center; font-size: 13px; color: var(--m-muted); }

/* =====================================================================
   4. RESPALDO
   ===================================================================== */
.m-split { display: grid; gap: 18px; grid-template-areas: "head" "visual" "body"; max-width: 1040px; margin: 0 auto; }
.m-split-head { grid-area: head; text-align: center; }
.m-split-visual { grid-area: visual; position: relative; display: flex; justify-content: center; }
.m-split-visual img { width: 330px; max-width: 100%; height: auto; }
.m-split-body { grid-area: body; display: grid; gap: 10px; }
.m-split-body .m-card p { margin: 0; font-size: 15px; line-height: 1.45; }
.m-stamp {
  position: absolute; right: 12%; bottom: 10%;
  background: var(--m-accent); color: var(--m-ink-on-accent);
  font-weight: 700; font-size: 14px; border-radius: 10px; padding: 8px 12px;
  box-shadow: 0 12px 32px -8px color-mix(in srgb, var(--m-accent) 60%, transparent);
  animation: m-stamp 6s ease-out infinite;
}
@media (min-width: 900px) {
  .m-split { grid-template-columns: 1.1fr 1fr; grid-template-areas: "visual head" "visual body"; align-items: center; column-gap: 56px; }
  .m-split-head { text-align: left; align-self: end; }
  .m-split-body { align-self: start; }
  .m-split-visual img { width: 480px; }
}

/* =====================================================================
   5. PROVA (prints do grupo)
   ===================================================================== */
.m-prova-prints { position: relative; display: flex; justify-content: center; gap: 18px; margin: 8px auto 18px; max-width: 520px; }
.m-prova-prints figure { margin: 0; width: 172px; }
.m-prova-prints figure:first-child { transform: rotate(-3deg); margin-top: 18px; }
.m-prova-prints figure:last-child { transform: rotate(3deg); }
.m-prova-prints .m-phone { width: 172px; border-width: 6px; border-radius: 26px; }
.m-prova-prints figcaption { margin-top: 10px; font-size: 12.5px; line-height: 1.35; color: var(--m-muted); }
.m-prova-prints figcaption strong { color: var(--m-accent-2); }
.m-prova-prints figure:last-child .m-scrollshot { animation-delay: 1.2s; --m-scroll: -95px; }
.m-destaque { display: flex; gap: 12px; align-items: center; max-width: 520px; margin: 0 auto; }
.m-destaque-num { font-family: var(--font-display, Fraunces, Georgia, serif); font-size: 26px; font-weight: 600; color: var(--m-accent-2); flex-shrink: 0; }
.m-destaque p { margin: 0; font-size: 14px; line-height: 1.4; }
.m-fonte { margin: 10px auto 0; text-align: center; font-size: 12px; color: var(--m-muted); }
@media (min-width: 900px) {
  .m-prova-prints { max-width: 640px; gap: 40px; }
  .m-prova-prints figure, .m-prova-prints .m-phone { width: 220px; }
}
/* O .container do site tem 24 px de margem fixa: num celular de 390 px sobram
   342 px, e os dois prints com 172 px cada (mais o espaço) passavam disso e a
   página rolava para o lado. Abaixo de 420 px eles dividem a largura. */
@media (max-width: 419px) {
  .m-prova-prints { gap: 12px; }
  .m-prova-prints figure { width: calc(50% - 6px); }
  .m-prova-prints .m-phone { width: 100%; border-width: 5px; border-radius: 22px; }
}

/* =====================================================================
   6. OFERTA (seletor formado/estudante)
   ===================================================================== */
.m-oferta { max-width: 560px; margin: 0 auto; }
.m-oferta .m-tablist { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
.m-oferta-card {
  background: var(--m-card);
  border: 1px solid color-mix(in srgb, var(--m-accent) 38%, transparent);
  border-radius: var(--m-radius-lg);
  padding: 20px 18px;
  box-shadow: var(--m-shadow);
  display: grid;
  gap: 14px;
}
.m-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.m-checks li { position: relative; padding-left: 30px; font-size: 14.5px; line-height: 1.4; }
.m-checks li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--m-accent); color: var(--m-ink-on-accent); font-size: 12px; font-weight: 700;
}
.m-checks.m-in li::before { animation: m-check .25s ease-out both; }
.m-checks.m-in li:nth-child(2)::before { animation-delay: .25s; }
.m-checks.m-in li:nth-child(3)::before { animation-delay: .5s; }
.m-checks.m-in li:nth-child(4)::before { animation-delay: .75s; }
.m-checks.m-in li:nth-child(5)::before { animation-delay: 1s; }
.m-checks span { color: var(--m-muted); }
.m-sep { height: 1px; background: var(--m-line); }
.m-plano[hidden] { display: none; }
.m-de { font-size: 13px; color: var(--m-muted); }
.m-de s { text-decoration: line-through; }
.m-preco { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-top: 2px; }
.m-preco strong { font-family: var(--font-display, Fraunces, Georgia, serif); font-weight: 600; font-size: 42px; line-height: 1; white-space: nowrap; }
@media (max-width: 374px) { .m-preco strong { font-size: 36px; } }
.m-preco span { font-size: 13px; color: var(--m-muted); }
.m-mensal { margin-top: 6px; font-size: 14.5px; font-weight: 600; color: var(--m-accent-2); }
.m-obs { margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: var(--m-muted); }
.m-plano .btn { width: 100%; justify-content: center; margin-top: 14px; }
.m-seguro { text-align: center; font-size: 12px; color: var(--m-muted); }
.m-oferta .m-destaque { margin-top: 14px; }
.m-oferta .m-hero-coord { justify-content: center; }
.m-oferta-whats { display: block; margin-top: 12px; text-align: center; font-size: 14px; }

/* Links de texto (perfil no topo e WhatsApp da oferta): o pacote não dava cor
   e eles saíam no azul padrão do navegador. Laranja claro no tema escuro;
   no claro, um laranja mais fechado para passar de 4,5:1 sobre o branco.
   No GDETIV, o mesmo em vermelho (bloco GDETIV no fim do arquivo). */
:root { --m-link: #A84F08; }
[data-theme="dark"] { --m-link: #FF9D40; }
.m-hero-perfil, .m-oferta-whats { color: var(--m-link); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.m-hero-perfil:hover, .m-oferta-whats:hover { text-decoration-thickness: 2px; }

/* ---------- acessibilidade: menos movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  .m-float, .m-pop, .m-progress > span, .m-cycle, .m-scrollshot, .m-stamp,
  .m-timeline.m-in::after, .m-timeline.m-in .m-step::before, .m-cenas.m-in::after, .m-checks.m-in li::before { animation: none !important; }
  .m-pop, .m-stamp { opacity: 1; }
  .m-cycle { opacity: 0; } .m-cycle:first-of-type { opacity: 1; }
  .m-timeline::after, .m-cenas::after { height: 100%; }
  .m-step::before { background: var(--m-accent); }
}

/* =====================================================================
   GDETIV
   ===================================================================== */
/* botão vermelho com texto branco (4,8:1); textos pequenos em vermelho
   mais claro, porque #F2484C sobre o navy fica em 4,1:1 */
[data-course="gdetiv"] { --m-ink-on-accent: #FFFFFF; --m-accent-2: #FF6B6E; }
/* links de texto em vermelho: fechado no tema claro, claro no escuro */
[data-course="gdetiv"] { --m-link: #B71F23; }
[data-theme="dark"] [data-course="gdetiv"] { --m-link: #FF6B6E; }

/* 2. O PLANTÃO: três cenas com o que ajuda em cada uma */
.m-cenas { position: relative; list-style: none; margin: 0 auto; padding: 0 0 0 22px; max-width: 680px; display: grid; gap: 10px; }
.m-cenas::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--m-line); }
.m-cenas::after { content: ""; position: absolute; left: 6px; top: 8px; width: 2px; height: 0; background: var(--m-accent); }
.m-cenas.m-in::after { animation: m-line 1.8s ease-out .2s forwards; }
.m-cena { background: var(--m-card); border: 1px solid var(--m-line); border-radius: var(--m-radius); padding: 12px 14px; }
.m-cena-head { display: flex; align-items: baseline; gap: 8px; }
.m-cena-time { font-family: var(--font-display, Fraunces, Georgia, serif); font-size: 21px; font-weight: 600; color: var(--m-accent-2); }
.m-cena h3 { margin: 0; font-size: 15px; font-weight: 600; }
.m-cena p { margin: 5px 0 0; font-size: 14px; line-height: 1.45; opacity: .9; }
.m-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.m-tags span {
  font-size: 11.5px; font-weight: 600; line-height: 1.3; border-radius: 999px; padding: 4px 10px;
  background: rgba(220, 42, 46, .18);
  background: color-mix(in srgb, var(--m-accent) 18%, transparent);
}
.m-estudo { max-width: 680px; margin: 14px auto 0; }
.m-estudo p { margin: 0; font-size: 14px; line-height: 1.45; }
.m-estudo .m-fonte { text-align: left; margin-top: 6px; }
@media (min-width: 900px) {
  .m-cena { padding: 16px 20px; }
  .m-cena p { font-size: 15px; }
}

/* 3. ABAS: mockup de celular com moldura própria (PNG/WebP transparente) */
.m-panel-visual .m-mock--phone { width: 210px; }
@media (min-width: 900px) { .m-panel-visual .m-mock--phone { width: 250px; } }

/* 6. PROVA: aviso animado sobre o segundo print */
.m-prova-prints .m-badge {
  position: absolute; right: 8%; top: 64%; z-index: 2;
  background: var(--m-accent); color: var(--m-ink-on-accent);
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 6px 11px;
  box-shadow: 0 10px 24px -6px color-mix(in srgb, var(--m-accent) 60%, transparent);
  animation: m-pop 8s ease-out 2.5s infinite;
}
@media (prefers-reduced-motion: reduce) { .m-prova-prints .m-badge { animation: none; opacity: 1; } }

/* ---------------------------------------------------------------------
   OPCIONAL (recomendado): contraste do botão laranja.
   Texto branco sobre #F2811D tem contraste 2,6:1 (abaixo do mínimo 4,5:1).
   Texto escuro do próprio site (#0A1424) dá 7:1. Vale para todos os botões
   principais das páginas do GDAV (igual ao protótipo aprovado).
   Para voltar ao texto branco, apague a regra abaixo.
   --------------------------------------------------------------------- */
[data-course="gdav"] .btn-primary { color: #0A1424; }
