/* Speak Ahora! — o topo de /<l>/download/ (cartões Windows e macOS, "o que você precisa", os 3 passos, letra miúda com
   SHA-256 e SmartScreen, teste grátis), os passos de /<l>/download/thanks/ e os cartões da página "App" da conta.
   Carregado só fora da home, por <PageStylesheet /> (src/lib/styles.tsx), antes de pages.css; a home tem a versão curta
   da seção (download.css) e não paga por isto. Mesmos tokens (tokens.css) e extensões --site-* (site.css); nenhuma cor
   nova. Mobile primeiro. Plataforma detectada: `data-os` no <html>, posto pelo script do <head> antes do 1º paint. */

/* ------------------------------------------------------------ cabeçalho da seção */
.dl-head { max-width: 52rem; }
.dl-head .h2, .dl-page-title { text-wrap: balance; }
.dl-page-title { max-width: 16ch; }
.section-lead .dl-inline-link { display: inline; padding-block: 0; font-weight: 700; }
/* < 360 px (e com o espaçamento de texto do WCAG 1.4.12) o acento "tu computadora." não cabe numa linha: quebra */
@media (max-width: 22.49rem) { .download .accent.nowrap { white-space: normal; } }

/* ------------------------------------------------------------ palco (creme) com os cartões das plataformas */
.dl-stage {
  position: relative;
  padding: clamp(1rem, 3vw, 2.5rem);
  border-radius: 28px;
  background: var(--sa-brand-cream); /* carvão 13,98:1 · secundário 5,58:1 · coral funcional 4,83:1 */
}
.dl-balloon { display: none; }
@media (min-width: 48rem) {
  .dl-balloon {
    display: block;
    position: absolute;
    z-index: 1;
    right: clamp(1rem, 4vw, 3.5rem);
    top: calc(-1 * clamp(4.25rem, 3rem + 3vw, 6rem));
    width: clamp(6.5rem, 4rem + 6vw, 9.5rem);
    height: auto;
    pointer-events: none;
    filter: drop-shadow(0 12px 18px rgb(94 72 191 / .18));
  }
}

.dl-platforms { display: grid; gap: 1rem; }
.dl-card {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(8, auto);
  align-content: start;
  min-width: 0;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  background: var(--sa-white);
  border: 1px solid var(--sa-border-soft);
  border-radius: var(--sa-radius-card);
}
/* ≥ 768: lado a lado, linhas compartilhadas (subgrid): título, texto, botão e meta alinhados nos dois cartões */
@media (min-width: 48rem) {
  .dl-platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(8, auto); gap: 0 clamp(1rem, 2vw, 1.5rem); }
  .dl-card { grid-row: span 8; grid-template-rows: subgrid; }
  /* só o Windows (o app é para Windows + NVIDIA; o cartão do macOS existe só com instalador para Mac): um cartão
     centralizado, não meia fileira com um vazio ao lado */
  .dl-platforms.is-single { grid-template-columns: minmax(0, 34rem); justify-content: center; }
}
.dl-glyph {
  grid-row: 1; grid-column: 1;
  justify-self: start;
  display: grid;
  place-items: center;
  width: 3.5rem; height: 3.5rem;
  border-radius: 50%;
}
.dl-glyph .icon { width: 1.75rem; height: 1.75rem; stroke-width: 1.7; }
/* as marcas das plataformas (OsGlyph.tsx, as mesmas dos botões da home) ficam na cor do texto, nunca no tom do círculo:
   uso nominativo, monocromáticas e sem alteração; a janela do Windows em 27 px = 1,5 × a grade de 18 px (vãos de 3 px) */
.dl-glyph .os-glyph { width: 27px; height: 27px; color: var(--sa-ink); }
.dl-glyph .os-glyph--apple { width: 28px; height: 28px; margin-top: -4px; }
.dl-glyph.is-coral { background: var(--sa-coral-soft); color: var(--sa-action); }   /* 4,4:1 gráfico */
.dl-glyph.is-lilac { background: var(--site-lilac-soft); color: var(--site-lilac-deep); } /* 5,53:1 */
.dl-badge {
  grid-row: 1; grid-column: 1;
  justify-self: end;
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 2rem;
  max-width: calc(100% - 4.5rem);
  padding: .25rem .75rem;
  border: 1px solid var(--sa-border-control);
  border-radius: var(--sa-radius-pill);
  background: var(--sa-white);
  color: var(--sa-ink);
  font: 700 .8125rem/1.25 var(--sa-font-body);
  text-align: center;
}
.dl-badge::before { content: ""; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--sa-action); }
.dl-badge.is-available { border-color: var(--sa-success); color: var(--sa-success); }
.dl-badge.is-available::before { background: var(--sa-success); }
.dl-card-title {
  grid-row: 2;
  margin-top: 1.25rem;
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem);
  letter-spacing: -.03em;
}
.dl-card-text { grid-row: 3; margin-top: .375rem; color: var(--sa-text-muted); font-size: .9375rem; line-height: 1.5; text-wrap: pretty; }
.dl-action { grid-row: 4; display: flex; flex-direction: column; gap: .5rem; margin-top: 1.5rem; min-width: 0; }
.dl-action:empty { display: none; }
.dl-meta:empty { display: none; }
.dl-btn {
  width: 100%;
  min-height: 3.5rem;
  padding-inline: 1rem;
  font-size: 1rem;
  text-align: center;
}
@media (min-width: 64rem) { .dl-btn { padding-inline: 1.25rem; font-size: 1.0625rem; } }
.dl-btn .icon { width: 1.375rem; height: 1.375rem; }
/* celular: o rótulo dos botões fica numa linha ("Avísame en el lanzamiento" em 320 px) */
@media (max-width: 29.99rem) {
  .dl-stage { padding: .75rem; border-radius: 22px; }
  .dl-card { padding: 1.25rem 1rem; }
  .dl-btn { padding-inline: .75rem; gap: .5rem; font-size: 1rem; }
}
@media (max-width: 22.49rem) {
  .dl-btn { font-size: .9375rem; }
}
@media (max-width: 21.24rem) {
  .dl-btn { font-size: .875rem; padding-inline: .5rem; }
}
@media (max-width: 22.49rem) {
  .dl-btn .icon { display: none; } /* < 360 px: o ícone sai antes de o rótulo quebrar */
  .dl-installer-tile { aspect-ratio: auto; }
}
.dl-meta { grid-row: 5; margin-top: .75rem; color: var(--sa-text-muted); font-size: .875rem; line-height: 1.5; }
.dl-meta a { font-weight: 700; }
.dl-card .dl-status { grid-row: 6; }
.dl-detected, .dl-arm {
  display: none;
  align-items: flex-start;
  gap: .5rem;
  margin-top: 1rem;
  padding-top: .875rem;
  border-top: 1px solid var(--sa-border-soft);
  font-size: .875rem;
  line-height: 1.45;
}
.dl-detected { grid-row: 7; }
.dl-arm { grid-row: 8; }
.dl-detected .icon { color: var(--sa-success); }
.dl-detected .icon, .dl-arm .icon, .dl-os-note .icon { width: 1.125rem; height: 1.125rem; margin-top: .1rem; }

/* plataforma detectada (script do <head>): só destaque — a ordem fica a do DOM (Windows, depois macOS) para a leitura
   visual, a do teclado e a do leitor de tela coincidirem (WCAG 2.4.3/1.3.2; v-experience-4); as duas sempre visíveis */
:root[data-os="windows"] .dl-card--windows,
:root[data-os="mac"] .dl-card--mac {
  border-color: var(--sa-ink);
  box-shadow: 0 0 0 1px var(--sa-ink), 0 16px 36px rgb(33 30 27 / .1);
}
:root[data-os="windows"] .dl-card--windows .dl-detected,
:root[data-os="mac"] .dl-card--mac .dl-detected { display: flex; }
:root[data-os="windows"][data-arch="arm"] .dl-card--windows .dl-arm { display: flex; }
/* Windows on Arm isn't supported: no "you're on Windows" line, and the download stops being the main action */
:root[data-os="windows"][data-arch="arm"] .dl-card--windows .dl-detected { display: none; }
:root[data-os="windows"][data-arch="arm"] .dl-card--windows .dl-get {
  border-color: var(--sa-border-control);
  background: transparent;
  color: var(--sa-ink);
}
:root[data-os="windows"][data-arch="arm"] .dl-card--windows .dl-get:hover { background: var(--sa-brand-cream); color: var(--sa-ink); }


.dl-os-note {
  display: none;
  align-items: flex-start;
  gap: .625rem;
  margin-top: 1rem;
  padding: .75rem 1rem;
  border-radius: var(--sa-radius-field);
  background: var(--sa-white);
  font-size: .9375rem;
  line-height: 1.5;
}
:root[data-os="linux"] .dl-os-note[data-for="other"],
:root[data-os="chromeos"] .dl-os-note[data-for="other"],
:root[data-os="other"] .dl-os-note[data-for="other"],
:root[data-os="ios"] .dl-os-note[data-for="mobile"],
:root[data-os="android"] .dl-os-note[data-for="mobile"] { display: flex; }


/* o que você precisa (dentro do palco) */
.dl-needs {
  position: relative;
  z-index: 2;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  padding-top: clamp(1.25rem, 2.5vw, 1.75rem);
  border-top: 1px solid rgb(33 30 27 / .14);
}
.dl-needs-title { margin-bottom: 1rem; font-size: 1.0625rem; letter-spacing: -.01em; }
.dl-needs-list { display: grid; gap: .75rem 1.75rem; }
.dl-needs-list li { display: flex; gap: .625rem; align-items: flex-start; font-size: .9375rem; line-height: 1.45; min-width: 0; text-wrap: pretty; }
.dl-needs-list .icon { margin-top: .05rem; }
@media (min-width: 40rem) { .dl-needs-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .dl-needs-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dl-needs > .dl-inline-link { margin-top: .5rem; }

/* links soltos: alvo de 48 px de altura; a seta acompanha a última palavra quando o texto quebra */
.dl-inline-link {
  display: inline-block;
  padding-block: .75rem;
  line-height: 1.5;
  font-weight: 700;
  text-underline-offset: .2em;
}
.dl-inline-link .icon { display: inline-block; width: 1.125rem; height: 1.125rem; margin-left: .375rem; vertical-align: -.2em; stroke-width: 2; }

/* ------------------------------------------------------------ depois de baixar (3 passos) */
.dl-steps { margin-top: clamp(2.5rem, 5vw, 4rem); }
.dl-steps-title { margin-bottom: 1.25rem; font-size: var(--sa-type-h3); letter-spacing: -.02em; }
.dl-step-list { display: grid; gap: 2rem; padding: 0; list-style: none; }
.dl-step { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
/* 768–1023: um passo por linha, tela à esquerda e texto à direita (em 3 colunas o texto ficava com ~190 px) */
@media (min-width: 48rem) and (max-width: 63.99rem) {
  .dl-step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.5rem; align-items: start; }
}
@media (min-width: 64rem) {
  /* figura e texto em linhas compartilhadas: o passo 1 (sem legenda de tela) alinha o texto com os outros */
  .dl-step-list { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; gap: 1rem clamp(1rem, 2.5vw, 2rem); }
  .dl-step { display: grid; grid-row: span 2; grid-template-rows: subgrid; gap: 1rem; }
}
.dl-step-figure { position: relative; margin: 0; }
.dl-step-frame { aspect-ratio: 1586 / 992; overflow: hidden; }
.dl-step-frame img { width: 100%; height: 100%; object-fit: contain; }
.dl-step-enlarge { position: absolute; top: .5rem; right: .5rem; z-index: 1; box-shadow: 0 4px 12px rgb(33 30 27 / .16); }
.no-js .dl-step-figure .enlarge-fallback { display: inline-grid; }
.dl-step-caption { margin-top: .5rem; color: var(--sa-text-muted); font-size: .8125rem; line-height: 1.4; }
.dl-installer-tile {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .625rem;
  aspect-ratio: 1586 / 992;
  padding: 1rem;
  border: 1px dashed var(--sa-border-control);
  border-radius: var(--sa-radius-card);
  background: var(--sa-coral-soft);
  text-align: center;
}
.dl-installer-icon {
  display: grid;
  place-items: center;
  width: 4rem; height: 4rem;
  border-radius: 50%;
  background: var(--sa-white);
  color: var(--sa-action);
  box-shadow: 0 8px 18px rgb(191 48 36 / .14);
}
.dl-installer-icon .icon { width: 1.875rem; height: 1.875rem; stroke-width: 1.8; }
.dl-installer-file {
  max-width: 100%;
  padding: .25rem .75rem;
  border: 1px solid var(--sa-border-soft);
  border-radius: var(--sa-radius-field);
  background: var(--sa-white);
  font: 700 .875rem/1.4 var(--sa-font-body);
  overflow-wrap: anywhere;
}
.dl-installer-label { color: var(--sa-ink); font-size: .8125rem; }
/* < 768: no approved installer screen to show, so no 16:10 placeholder either — a compact row (icon, file, label) */
@media (max-width: 47.99rem) {
  .dl-installer-tile {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    place-content: stretch;
    justify-items: start;
    align-items: center;
    gap: .125rem .875rem;
    aspect-ratio: auto;
    padding: .875rem 1rem;
    text-align: left;
  }
  .dl-installer-icon { grid-row: 1 / span 2; width: 3rem; height: 3rem; box-shadow: none; }
  .dl-installer-icon .icon { width: 1.5rem; height: 1.5rem; }
  .dl-installer-file { padding: 0; border: 0; background: none; }
}
.dl-step-copy { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: .75rem; align-items: start; align-content: start; }
.dl-step-num {
  grid-row: 1 / span 3;
  display: inline-grid;
  place-items: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  background: var(--sa-ink);
  color: var(--sa-white);
  font: 700 .9375rem/1 var(--sa-font-body);
  font-variant-numeric: tabular-nums;
}
.dl-step-title { margin: .375rem 0 .25rem; font-size: 1.0625rem; line-height: 1.3; letter-spacing: -.01em; }
.dl-step-copy p { font-size: .9375rem; line-height: 1.55; }
.dl-step-copy .dl-inline-link { justify-self: start; }

/* ------------------------------------------------------------ letra miúda (SHA-256, SmartScreen, links) */
.dl-fine { display: grid; gap: .5rem; margin-top: clamp(2rem, 4vw, 3rem); padding-top: 1.25rem; border-top: 1px solid var(--sa-border-soft); }
.dl-fine-note { max-width: 72ch; color: var(--sa-text-muted); font-size: .875rem; line-height: 1.6; }
.sha-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; font-size: .875rem; }
.sha-label { font-weight: 700; }
.sha-value {
  min-width: 0;
  max-width: 100%;
  padding: .25rem .5rem;
  border-radius: 6px;
  background: var(--sa-white);
  border: 1px solid var(--sa-border-soft);
  font: 500 .8125rem/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
  overflow-wrap: anywhere;
}
.copy-btn.is-compact { min-height: var(--sa-target); padding-inline: .875rem 1rem; font-size: .875rem; background: var(--sa-white); }
.dl-links { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }


/* ------------------------------------------------------------ teste grátis por campanha (v1.2, integracao-web.md §15)
   Tudo sai do build vazio e com [hidden] (TrialOffer.tsx); só aparece quando GET /v1/meta diz que há campanha e a
   seção tem release. Sem salto de layout: o selo cabe na linha do título (altura fixa: 21 px < linha do título), o resto
   fica abaixo da dobra ou no espaço reservado do obrigado (só quando o cache da sessão já diz "campanha ligada"). */
[data-sa-trial][hidden] { display: none !important; }
/* the badge shares the title's cell: the title stays explicitly in column 1 (an auto-placed title would open a 2nd column) */
.dl-card > .dl-card-title { grid-column: 1; }
.dl-trial-badge {
  grid-row: 2; grid-column: 1;
  justify-self: end;
  align-self: end;
  margin-bottom: .25rem;
  display: inline-flex;
  align-items: center;
  padding: .125rem .5rem;
  border: 1px solid var(--sa-action);
  border-radius: var(--sa-radius-pill);
  background: var(--sa-coral-soft);
  color: var(--sa-action);                /* 5,37:1 sobre o coral claro */
  font: 700 .75rem/1.25 var(--sa-font-body);
  white-space: nowrap;
}
@media (max-width: 22.49rem) { .dl-trial-badge { display: none; } } /* < 360 px: o título fica sozinho na linha */
/* o selo é um link para as condições (#dl-trial-terms — revisão product-8): mesma caixa, sem sublinhado */
a.dl-trial-badge { text-decoration: none; }
a.dl-trial-badge:hover { text-decoration: underline; text-underline-offset: .15em; }
.dl-trial-step {
  max-width: 72ch;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-size: .9375rem;
  line-height: 1.55;
}
.dl-trial-step, .dl-trial-slot-account { display: flex; align-items: flex-start; gap: .5rem; }
.dl-trial-step .icon, .dl-trial-slot-account .icon { flex: none; width: 1.125rem; height: 1.125rem; margin-top: .2rem; color: var(--sa-action); }
.dl-trial-step a, .dl-trial-slot-account a { font-weight: 700; text-underline-offset: .15em; }
.dl-trial-terms { display: grid; gap: .375rem; max-width: 72ch; }
.dl-trial-terms p { color: var(--sa-text-muted); font-size: .875rem; line-height: 1.6; }
.dl-trial-terms .dl-trial-line { color: var(--sa-ink); }
.dl-trial-terms .dl-inline-link { display: inline; padding-block: 0; font-weight: 700; }
/* /<l>/download/: a oferta completa num bloco próprio entre o palco e "Depois de baixar" */
.dl-trial-terms.dl-trial-block {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  padding: 1rem 1.25rem;
  border: 1px solid var(--sa-border-soft);
  border-left: 4px solid var(--sa-action);
  border-radius: 12px;
  background: var(--sa-white);
}
.dl-trial-block .dl-trial-step { margin-top: .25rem; color: var(--sa-ink); }
/* obrigado, passo 3: a conta e quando o teste começa; altura reservada quando a sessão já sabe da campanha */
.dl-trial-slot { grid-column: 2; min-width: 0; }
/* medido (tools/trial_check.py, 320–1440 px, 3 idiomas, com o link "Condições do teste grátis" — revisão product-8;
   v1.3: a frase padrão agora é trial.start.sign_in, mais longa que a first_use): até 273 px de conteúdo; ≥ 1280 px até
   230 px (first_use: 252 / 208) */
.sa-trial .dl-trial-slot { min-height: 17.25rem; }
@media (min-width: 80rem) { .sa-trial .dl-trial-slot { min-height: 14.5rem; } }
.dl-trial-slot-body { display: grid; gap: .5rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--sa-border-soft); }
.dl-trial-slot-body p { font-size: .875rem; line-height: 1.55; }

@media print {
  .dl-balloon, .dl-step-enlarge { display: none !important; }
}
@media (forced-colors: active) {
  .dl-card, .dl-badge, .dl-stage, .dl-trial-badge { border: 1px solid CanvasText; }
}
