/* ==========================================================================
   Componentes reutilizáveis
   ========================================================================== */

/* ---------- Barra de urgência (topo) ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: var(--green); color: var(--ink);
}
.topbar__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px 20px; min-height: 48px; padding-block: 6px;
}
.topbar__item {
  display: flex; align-items: center; gap: 7px;
  font-stretch: var(--stretch-wide); font-weight: 800; font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.topbar__live { display: contents; }
.topbar__icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.topbar__chip {
  display: inline-grid; place-items: center; min-width: 34px; height: 30px; padding: 0 7px;
  border-radius: 8px; background: var(--ink); color: var(--green);
  font-stretch: var(--stretch-condensed); font-weight: 900; font-size: 24px; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: 0;
}
.topbar__clock {
  display: none;
  padding: 3px 7px; border: 1.5px solid currentColor; border-radius: 6px;
  font-family: var(--f-mono); font-stretch: 100%; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.topbar__over { display: none; }
.cd-regular { display: contents; }
.cd-last { display: none; }
.is-last-day .cd-regular { display: none; }
.is-last-day .cd-last { display: inline; }
.topbar.is-last-day .topbar__clock { display: inline-block; }
.topbar.is-over .topbar__live { display: none; }
.topbar.is-over .topbar__over { display: inline; }
/* No celular, a frase vira "Faltam 42 dias" para caber numa linha */
.topbar__long, .topbar__verb { display: none; }

/* ---------- Etiqueta (tag com furo) ---------- */
.tag {
  --tag-h: 38px;
  position: relative; display: inline-flex; align-items: center; flex: none;
  height: var(--tag-h);
  padding: 0 calc(var(--tag-h) * .32) 0 calc(var(--tag-h) * .78);
  background: var(--green); color: var(--ink);
  clip-path: polygon(calc(var(--tag-h) * .42) 0, 100% 0, 100% 100%, calc(var(--tag-h) * .42) 100%, 0 50%);
  transform-origin: 20% 50%;
}
.tag::before { /* furo */
  content: ""; position: absolute; top: 50%; left: calc(var(--tag-h) * .3);
  width: calc(var(--tag-h) * .19); height: calc(var(--tag-h) * .19);
  border-radius: 50%; background: var(--ink); transform: translateY(-50%);
}
.tag__text {
  font-stretch: var(--stretch-condensed); font-weight: 500; line-height: .8;
  font-size: calc(var(--tag-h) * .62);
}

/* ---------- Lockup "BLACK [DA] medmax|VIVA" ---------- */
.lockup { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.lockup__black {
  font-stretch: var(--stretch-condensed); font-weight: 900; text-transform: uppercase;
  font-size: clamp(40px, 11.5vw, 88px); line-height: .78; letter-spacing: -.01em;
}
.lockup__brand { display: flex; align-items: center; gap: 8px; }
.lockup__tag { --tag-h: clamp(28px, 7.8vw, 52px); }
.lockup__logo { height: clamp(28px, 7.8vw, 52px); width: auto; }

/* ---------- Botões ---------- */
.btn {
  --h: 58px;
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 10px 30px; border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--f-sans); font-stretch: var(--stretch-wide); font-weight: 800;
  font-size: 15px; line-height: 1.2; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  text-align: center; text-wrap: balance;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), background-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { color: inherit; }
.btn--accent { background: var(--green); color: var(--ink); box-shadow: 0 12px 32px -12px rgba(3, 177, 82, .8); }
.btn--accent:hover { color: var(--ink); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { color: var(--paper); }
.btn--ghost { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1.5px #3A3A3A; }
.btn--ghost:hover { color: var(--paper); box-shadow: inset 0 0 0 1.5px var(--paper); }
.btn--sm { --h: 46px; padding: 8px 20px; font-size: 12px; }
@media (max-width: 719px) {
  .btn:not(.btn--sm) { --h: 56px; padding: 10px 22px; font-size: 13px; letter-spacing: .05em; }
}
@media (max-width: 359px) {
  .btn { letter-spacing: .02em; }
  .btn:not(.btn--sm) { padding-inline: 16px; font-size: 12px; }
  .btn--sm { padding-inline: 14px; font-size: 11px; }
}
.btn--block { width: 100%; }
.btn__arrow { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease-out); }
.btn::after { /* brilho que atravessa o botão */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-110%);
}
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); }
  .btn--accent:hover { box-shadow: 0 18px 40px -12px rgba(3, 177, 82, .95); }
  .btn:hover::after { transform: translateX(110%); transition: transform .8s var(--ease-out); }
  .btn:hover .btn__arrow { transform: translateX(4px); }
}
.btn:active { transform: translateY(0) scale(.98); }
.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"] .btn__label { visibility: hidden; }
.btn[aria-busy="true"]::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Fita ---------- */
.tape {
  position: relative; z-index: 2;
  width: 120%; margin-left: -10%;
  background: var(--green); color: var(--ink);
  transform: rotate(-2deg) skewX(var(--tape-skew, 0deg));
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.tape__track { display: flex; width: max-content; animation: marquee 60s linear infinite; } /* duração refeita pelo JS conforme o tamanho */
.tape__item {
  display: flex; align-items: center; gap: 18px; padding: 14px 9px;
  font-stretch: var(--stretch-wide); font-weight: 800; font-size: 15px; letter-spacing: .14em;
  text-transform: uppercase; white-space: nowrap;
}
.tape__item i { font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Cards do pack ---------- */
.cards { display: grid; gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--radius-lg); overflow: hidden;
  transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out);
  will-change: transform;
}
.card__ill {
  position: relative; display: grid; place-items: center; height: 220px; overflow: hidden;
  background: var(--graphite);
}
.card__ill::after { /* reflexo que acompanha o mouse */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .10), transparent 45%);
}
.card:hover .card__ill::after { opacity: 1; }
.card__body { display: flex; flex-direction: column; gap: 12px; padding: 24px 24px 28px; }
.card__title { font-size: 22px; font-weight: 800; line-height: 1.15; text-wrap: balance; }
.card__desc { font-size: 16px; font-weight: 500; line-height: 1.5; color: var(--text-soft); text-wrap: pretty; }

/* Logos oficiais dos parceiros (arquivos enviados pela VIVA, sem alteração) */
/* Dimensionados pela largura (altura automática), então nunca distorcem em colunas estreitas */
.partner { height: auto; max-width: 100%; align-self: flex-start; flex: 0 1 auto; min-width: 0; object-fit: contain; }
.partner--c1 { width: 254px; }
.partner--ms { width: 134px; }
.partner--mg { width: 127px; }

/* ---------- Passos ---------- */
.steps { list-style: none; padding: 0; display: grid; gap: 14px; }
.step {
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
  padding: 24px; border-radius: 22px; background: var(--ink);
}
.tag--step { --tag-h: 52px; }
.tag--step .tag__text { font-weight: 900; font-size: 36px; }
.step__title { font-size: 21px; font-weight: 700; line-height: 1.25; }

/* ---------- Prêmios compactos ---------- */
.mini { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mini__item {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 20px; border-radius: var(--radius); background: var(--card);
}
.mini__item p { font-size: 17px; font-weight: 700; line-height: 1.25; text-wrap: balance; }
.mini__item--hot { background: var(--orange); color: var(--ink); }
.mini--2, .mini--3 { grid-template-columns: minmax(0, 1fr); }
.mini__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rank {
  font-stretch: var(--stretch-condensed); font-weight: 900; font-size: 48px; line-height: .8;
  color: var(--orange); white-space: nowrap;
}
.mini__item--hot .rank { color: var(--ink); }
.rank--green { color: var(--green); }
.mini__top .partner { align-self: center; }
.mini__top .partner--c1 { width: 196px; }
.mini__top .partner--mg { width: 108px; }
.mini__top .partner--ms { width: 118px; }
.mini__mark { font-size: .7em; margin-left: 1px; }
.mini__note { margin-top: 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.mini__note sup { color: var(--orange); font-weight: 700; }
.mini__note a { white-space: nowrap; }

/* ---------- Valor total ---------- */
.total {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px;
  margin-top: 16px; padding: 20px 24px; border-radius: var(--radius);
  background: rgba(3, 177, 82, .08); border: 1px solid rgba(3, 177, 82, .35);
}
.total__v {
  font-family: var(--f-mono); font-weight: 700; color: var(--green);
  font-size: clamp(18px, 5.4vw, 26px); letter-spacing: .02em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
/* Asterisco da regra dos 25: aponta para a nota única no rodapé (#nota-pack). */
.nota-ref { color: var(--accent); font-family: var(--f-mono); font-weight: 700; font-size: .5em; line-height: 0;
  vertical-align: super; margin-left: .12em; text-decoration: none; }
a.nota-ref { display: inline-block; padding: .1em .15em; border-radius: 4px; }
a.nota-ref:hover { color: var(--paper); }
.total .nota-ref { font-size: .9em; }
.hero__title .nota-ref { font-size: .32em; margin-left: .18em; } /* o título é enorme: o asterisco não pode competir com ele */

/* ---------- Caixa "Importante" ---------- */
.notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 48px;
  padding: 26px; border: 2px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #101010, var(--ink));
}
.notice__copy { display: flex; flex-direction: column; gap: 14px; flex: 1 1 320px; }
.notice__list { list-style: none; padding: 0; display: grid; gap: 10px; }
.notice__list li { position: relative; padding-left: 22px; font-size: 18px; font-weight: 600; line-height: 1.35; }
.notice__list li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 11px; height: 11px; background: var(--green);
  clip-path: polygon(40% 0, 100% 0, 100% 100%, 40% 100%, 0 50%);
}
.big-stat { display: flex; align-items: baseline; gap: 14px; }
.big-stat__n {
  font-stretch: var(--stretch-condensed); font-weight: 900; font-size: clamp(96px, 26vw, 140px); line-height: .8;
  color: var(--green); font-variant-numeric: tabular-nums;
}
.big-stat__l {
  font-stretch: var(--stretch-wide); font-weight: 800; font-size: 16px; letter-spacing: .06em;
  line-height: 1.3; text-transform: uppercase;
}
.notice.is-sold-out .big-stat__n { color: var(--orange); }

/* ---------- Carimbo ---------- */
.stamp {
  display: inline-grid; place-items: center; text-align: center;
  padding: 10px 16px; border: 3px solid currentColor; border-radius: 10px;
  outline: 1.5px solid currentColor; outline-offset: 4px;
  font-family: var(--f-mono); font-weight: 700; font-size: 18px; line-height: 1.05;
  letter-spacing: .05em; text-transform: uppercase;
  transform: rotate(-9deg);
}
.stamp--ink { color: var(--ink); }
.stamp--green { color: var(--green); }

/* ---------- Formulário ---------- */
.form-card {
  position: relative; padding: 20px; border-radius: var(--radius-lg);
  background: var(--card); border: 1px solid #1F1F1F;
}
.lead-form { display: grid; gap: 18px; }
.form-grid { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; align-content: start; min-width: 0; }
.field > label { font-size: 14px; font-weight: 600; }
.field input:not([type="checkbox"]) {
  width: 100%; height: 54px; padding: 0 16px; border-radius: 12px;
  background: var(--field); border: 1.5px solid #333; color: var(--paper); font-size: 16px;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field input::placeholder { color: #8A867E; }
.field input:not([type="checkbox"]):hover { border-color: #4A4A4A; }
.field input:not([type="checkbox"]):focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px var(--green-glow); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(255, 138, 122, .2); }
.field__err { display: none; font-size: 13px; font-weight: 600; color: var(--danger); }
.field__err.is-on { display: block; animation: err-in .3s var(--ease-out); }
@keyframes err-in { from { opacity: 0; transform: translateY(-4px); } }

/* Campo travado pelo link (consultor) */
.input-lock { position: relative; }
.input-lock__icon {
  position: absolute; right: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  display: none; pointer-events: none;
}
.field.is-locked .input-lock__icon { display: block; }
.field.is-locked input {
  padding-right: 46px; cursor: default;
  background: #121212; border-style: dashed; border-color: #3A3A3A; color: var(--text-soft);
}
.field.is-locked input:hover { border-color: #3A3A3A; }
.field.is-locked input:focus { border-color: var(--green); box-shadow: none; }

/* Telefone com +55 fixo */
.phone-field { position: relative; }
.phone-field__ddi {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 7px; pointer-events: none;
  font-size: 16px; font-weight: 600; color: var(--text-soft);
}
.phone-field__flag { width: 22px; height: 16px; flex: none; }
.field .phone-field input:not([type="checkbox"]) { padding-left: 84px; }

/* Aceite pelo envio: nota de regulamento (.fine, mono) logo abaixo do botão */
.form-consent { margin-top: -4px; text-align: center; text-wrap: pretty; }
.form-consent a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.form-consent a:hover { color: var(--paper); }

.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: 14px; font-weight: 600; color: var(--danger); }
.form-status:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Confirmação */
.success { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 4px 8px; text-align: center; }
.success__ticket {
  position: relative; width: min(100%, 330px); padding: 28px 24px 30px; border-radius: 16px;
  background: var(--paper); color: var(--ink);
  -webkit-mask: radial-gradient(14px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(14px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(14px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(14px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
}
.success__ticket .eyebrow { color: #4F4C46; }
.success__title { margin-top: 8px; font-size: 52px; outline: none; }
.success__stamp { position: absolute; right: 14px; bottom: -12px; font-size: 13px; background: var(--paper); }
.success__text { max-width: 36ch; font-size: 16px; color: var(--text-soft); }

/* Cadastro encerrado */
.closed { display: flex; flex-direction: column; gap: 14px; padding: 12px 4px; }
.closed__title { font-size: clamp(2.6rem, 11vw, 3.6rem); color: var(--orange); }
.closed__text { max-width: 40ch; font-size: 17px; color: var(--text-soft); }

/* ---------- Barra fixa de cadastro (celular) ---------- */
.sticky-cta { position: sticky; bottom: 0; z-index: 35; height: 0; }
.sticky-cta__bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(10, 10, 10, .86);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid #262626;
  transform: translateY(105%); transition: transform .45s var(--ease-out);
}
.sticky-cta.is-on .sticky-cta__bar { transform: none; }
.sticky-cta__txt { min-width: 0; font-size: 13px; line-height: 1.3; color: var(--muted); }
.sticky-cta__bar .btn { flex: none; }
.is-campaign-over .sticky-cta { display: none; }
.sticky-cta__txt b { font-family: var(--f-mono); font-size: 15px; color: var(--green); }
.sticky-cta__bar.is-over .sticky-cta__txt { visibility: hidden; }

/* ---------- Aviso rápido ---------- */
.toast {
  position: fixed; left: 50%; z-index: 60;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  width: max-content; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 12px;
  background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 600; text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none; transform: translate(-50%, 12px);
  transition: opacity .3s, transform .4s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Telas maiores ---------- */
@media (min-width: 720px) {
  .topbar__inner { gap: 6px 56px; min-height: 56px; }
  .topbar__item { font-size: 14px; gap: 10px; }
  .topbar__icon { width: 22px; height: 22px; }
  .topbar__chip { min-width: 44px; height: 38px; font-size: 32px; border-radius: 9px; }
  .topbar__clock { display: inline-block; }
  .topbar__long, .topbar__verb { display: inline; }
  .cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* sem MEDGRUPO: 2 cards na largura toda, alinhados ao título e ao total */
  .card__ill { height: 240px; }
  .card__body { padding: 28px; }
  .card__title { font-size: 24px; }
  .partner--c1 { width: 293px; }
  .partner--ms { width: 152px; }
  .partner--mg { width: 146px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .step { padding: 28px; }
  .step__title { font-size: 23px; }
  .mini { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .mini--3 { grid-template-columns: minmax(0, 1fr); }
  .mini--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini__item { padding: 24px; }
  .mini__item p { font-size: 20px; }
  .rank { font-size: 56px; }
  .notice { padding: 36px 40px; }
  .form-card { padding: 32px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .field--full { grid-column: 1 / -1; }
  .sticky-cta { display: none; }
  .toast { bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
}

@media (min-width: 1040px) {
  .mini--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
