/* ==========================================================================
   Componentes reutilizáveis (as duas LPs e as páginas de destino)
   Cor de marca sempre por var(--accent): a troca Geral/Med acontece só em tokens.css.
   ========================================================================== */

/* ---------- Barra de urgência (topo) ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: var(--accent); 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(--accent);
  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; }

/* ---------- 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(--accent); 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] logo" ---------- */
.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; }
.lockup--sm .lockup__black { font-size: clamp(36px, 9vw, 56px); }
.lockup--sm .lockup__tag { --tag-h: clamp(26px, 6.4vw, 36px); }
.lockup--sm .lockup__logo { height: clamp(26px, 6.4vw, 36px); }

/* ---------- 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(--accent); color: var(--ink); box-shadow: 0 12px 32px -12px var(--accent-shadow); }
.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: 48px; 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 var(--accent-shadow); }
  .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;
}
/* Botão sem destino configurado (ex.: WhatsApp vazio em config.js): visível, mas claramente inativo */
.btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn[aria-disabled="true"]::after { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Fita ---------- */
.tape {
  position: relative; z-index: 2;
  width: 120%; margin-left: -10%;
  background: var(--accent); 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%); } }

/* ---------- 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--accent { color: var(--accent); }

/* ---------- Ranking (1º, 2º…) ---------- */
.rank {
  font-stretch: var(--stretch-condensed); font-weight: 900; font-size: 60px; line-height: .8;
  color: var(--accent); white-space: nowrap;
}

/* ---------- 1º prêmio: laranja chapado nas duas LPs (ênfase pontual permitida) ---------- */
.prize-first {
  position: relative; display: grid; gap: 28px; overflow: hidden;
  padding: 28px 24px; border-radius: 26px;
  background: var(--orange); color: var(--ink);
}
.prize-first__copy { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.prize-first .rank { color: var(--ink); font-size: clamp(80px, 22vw, 120px); }
.prize-first__title { font-size: clamp(3rem, 13vw, 5.75rem); line-height: .86; }
.prize-first__text { max-width: 34ch; font-size: 19px; font-weight: 600; line-height: 1.35; }
.prize-first__ill { position: relative; height: 230px; }
.prize-first__ill .bill { position: absolute; left: 50%; top: 50%; translate: -55% -45%; }
.prize-first__ill .stamp { position: absolute; right: 2%; top: 4%; background: var(--orange); font-size: 22px; transform: rotate(12deg); }
.prize-mark { font-size: .55em; vertical-align: super; line-height: 0; }

/* Ressalva obrigatória: em mono, sempre logo abaixo do prêmio */
.ressalva { margin-top: 14px; max-width: 78ch; }
.ressalva sup { color: var(--orange); font-weight: 700; }
.ressalva a { white-space: nowrap; }

/* ---------- Demais prêmios ---------- */
.prizes { list-style: none; padding: 0; margin-top: 20px; display: grid; gap: 16px; }
.prize {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border-radius: 22px;
}
.prize__ill { position: relative; display: grid; place-items: center; height: 220px; overflow: hidden; background: var(--graphite); }
.prize__body { display: flex; flex-direction: column; gap: 12px; padding: 24px 24px 26px; }
.prize__title { font-size: 22px; font-weight: 700; line-height: 1.2; text-wrap: balance; }
.prize__note { margin-top: -2px; font-size: 12px; }

/* ---------- Cards dos prêmios exclusivos de Medicina ---------- */
.cards { list-style: none; padding: 0; 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; }

/* ---------- 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; margin: 0; padding: 0; border: 0; }
.field > label, .field > legend { padding: 0; font-size: 14px; font-weight: 600; }
.field > legend { margin-bottom: 8px; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"] {
  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="radio"]):hover { border-color: #4A4A4A; }
.field input:not([type="radio"]):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-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); } }

/* 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[type="tel"] { padding-left: 84px; }

/* "Você já é cliente VIVA?": Sim / Não em pílulas grandes (área de toque de 54px) */
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice__opt {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 16px; border-radius: 12px; cursor: pointer;
  background: var(--field); border: 1.5px solid #333;
  font-stretch: var(--stretch-wide); font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
  transition: border-color .2s, background-color .2s, color .2s, box-shadow .2s;
}
.choice__opt:hover { border-color: #4A4A4A; }
.choice__opt input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none;
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid #5A5A5A; background: transparent;
  display: grid; place-items: center; cursor: pointer;
}
.choice__opt input::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .25s var(--ease-spring); }
.choice__opt input:focus-visible { outline: none; }
.choice__opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.choice__opt:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.choice__opt input:checked { border-color: var(--ink); }
.choice__opt input:checked::after { transform: scale(1); }
.field[aria-invalid="true"] .choice__opt { border-color: var(--danger); }

/* 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:not([aria-disabled="true"]) { color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.form-consent a:not([aria-disabled="true"]):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); }

/* 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__txt b { font-family: var(--f-mono); font-size: 15px; color: var(--accent); }
.sticky-cta__bar .btn { flex: none; }
.is-campaign-over .sticky-cta { display: none; }

/* ---------- Telas maiores ---------- */
@media (min-width: 720px) {
  .topbar__inner { 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; }
  .prize-first { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); align-items: center; padding: 44px; }
  .prize-first__ill { height: 280px; }
  .prizes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .prize__ill { height: 230px; }
  .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 */
  .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; }
  .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; }
}
