/* ---------- Home ---------- */

/* Hero: painel cobalto com o formulário dentro (upload OU link). O form é a protagonista. */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); background: var(--brand); color: var(--on-brand); border-radius: var(--radius-lg); padding: var(--space-6) var(--space-4); }
.hero__copy { display: grid; gap: var(--space-5); align-content: start; justify-items: start; min-width: 0; }
.hero__title { font: 700 clamp(44px, 12.5vw, 112px)/.94 var(--font-display); letter-spacing: -.04em; text-transform: uppercase; overflow-wrap: anywhere; }
.hero__title > span { display: block; }
.hero__title em { font-style: normal; color: var(--spark); }
.hero__subtitle { font-size: 18px; line-height: 28px; max-width: 40ch; }
.hero__form { display: grid; gap: var(--space-4); min-width: 0; }
.hero__notes { display: grid; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid rgba(255, 255, 255, .28); min-width: 0; }
.hero__note { font: 400 14px/20px var(--font-text); }
.hero__note a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.hero__note a:hover { color: var(--spark); }
.hero__privacy { opacity: .85; }
.hero__error { font: 500 14px/20px var(--font-text); color: var(--on-spark); background: var(--spark); border-radius: var(--radius-pill); padding: 6px 14px; justify-self: start; }
.hero__error[hidden] { display: none; }
.hero .spinner { color: var(--on-brand); }
.hero__spinner { justify-self: start; }

/* UploadDropzone (DS: bn-drop) sobre o painel brand: fundo surface para destacar a área. */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3);
  min-height: 240px; padding: var(--space-5); border-radius: var(--radius-md); border: 1.5px dashed var(--border-strong);
  background: var(--surface); color: var(--text); text-align: center; cursor: pointer; min-width: 0;
  transition: background-color var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out);
}
.drop:hover, .drop.is-dragover { border-style: solid; border-color: var(--spark); background: var(--surface-sunken); }
.drop.has-file { border-style: solid; }
.drop:focus-within { outline: 2px solid var(--spark); outline-offset: 3px; }
.drop__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--spark); color: var(--on-spark); transition: transform .18s ease-out; }
.drop.is-dragover .drop__icon { transform: translateY(-4px); }
.drop__icon svg { width: 28px; height: 28px; }
.drop__title { font: 500 24px/1.2 var(--font-display); letter-spacing: -.01em; }
.drop__hint { font: 400 14px/20px var(--font-text); color: var(--text-muted); }
.drop__file { display: flex; justify-content: center; max-width: 100%; min-height: 32px; }
.drop__file .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* Prévia local do item escolhido (só no navegador) + botão "trocar" acima do input */
.drop__preview { display: block; width: min(100%, 360px); aspect-ratio: 16 / 10; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--border); pointer-events: none; }
.drop__preview[hidden] { display: none; }
.drop__preview > img, .drop__preview > video { display: block; width: 100%; height: 100%; object-fit: contain; }
.drop.has-preview .drop__icon { display: none; }
.drop__file { align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.drop__tag { display: flex; min-width: 0; max-width: 100%; }
.drop__tag .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.drop__clear {
  position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 10px;
  border: 0; border-radius: var(--radius-pill); background: var(--surface-inverse); color: var(--on-inverse);
  font: 500 13px/18px var(--font-text); cursor: pointer;
}
.drop__clear[hidden] { display: none; }
.drop__clear svg { width: 12px; height: 12px; }
.drop__clear:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Divisor "ou cole um link" */
.hero__or { display: flex; align-items: center; gap: var(--space-4); font: 500 12px/16px var(--font-text); letter-spacing: .12em; text-transform: uppercase; }
.hero__or::before, .hero__or::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .32); }

/* Campo de link em pílula */
.link-field { display: flex; align-items: center; gap: var(--space-2); padding: 6px; border-radius: var(--radius-pill); background: var(--surface); color: var(--text); min-width: 0; }
.link-field:focus-within { outline: 2px solid var(--spark); outline-offset: 3px; }
.link-field__input { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 var(--space-4); border: 0; background: transparent; color: var(--text); font: 400 16px/24px var(--font-text); outline: none; text-overflow: ellipsis; }
.link-field__input::placeholder { color: var(--text-muted); opacity: 1; }

@media (min-width: 600px) {
  .hero { padding: var(--space-7) var(--space-6); }
  .drop { min-height: 280px; padding: var(--space-6); }
}
@media (min-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: var(--space-8); row-gap: var(--space-6); padding: var(--space-8) var(--space-7); }
  .hero__copy { align-content: center; }
  .hero__title { font-size: clamp(72px, 7.2vw, 112px); }
  .hero__form { grid-column: 2; grid-row: 1; }
  .hero__notes { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-6); }
  .drop { min-height: 320px; }
}
@media (prefers-reduced-motion: reduce) { .drop, .drop__icon { transition: none; } .drop.is-dragover .drop__icon { transform: none; } }

/* Slot do resultado: some quando vazio (não gera gap extra no grid do .main) */
.home-result:empty { display: none; }
.home-result.result-slot:not(:empty) { margin-top: 0; scroll-margin-top: var(--space-6); }

/* Exemplo real: MediaFrame + mini resultado (VerdictBadge, ScoreMeter, SignalList) */
.real__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gutter); }
.frame { position: relative; overflow: hidden; margin: 0; border-radius: var(--radius-lg); background: var(--brand); aspect-ratio: 1; min-width: 0; }
.frame > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame__pin { position: absolute; font-size: 12px; max-width: calc(100% - 2 * var(--space-4)); overflow: hidden; text-overflow: ellipsis; }
.frame__pin--2 { top: calc(var(--space-4) + 40px); left: var(--space-4); }
.frame__corner { position: absolute; left: var(--space-4); bottom: var(--space-4); max-width: calc(100% - 2 * var(--space-4)); }
.real__result { display: grid; gap: var(--space-3); align-content: start; min-width: 0; }
.real__head { display: grid; gap: var(--space-4); justify-items: start; padding: var(--space-5); border-radius: var(--radius-md); background: var(--surface); }
.real__head .eyebrow { color: var(--text-muted); }
.real__note { font: 400 12px/16px var(--font-text); color: var(--text-muted); }
.real__score { padding: var(--space-5); border-radius: var(--radius-md); gap: var(--space-3); }
.real__score .score__value { font-size: clamp(64px, 14vw, 80px); }
.real__signals .signal { padding: var(--space-4) var(--space-5); }
.real__signals .signal__title { font-size: 20px; }
@media (min-width: 600px) {
  .frame__pin { font-size: 13px; }
  .frame__pin--2 { top: var(--space-4); left: auto; right: var(--space-4); }
}
@media (min-width: 1000px) {
  .real__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: stretch; }
  .frame { aspect-ratio: auto; min-height: 100%; }
  .frame > img { position: absolute; inset: 0; }
  .real__result { align-content: space-between; }
}

/* StatCard: ritmo branco / preto / azul / lima */
.stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gutter); }
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-5); min-height: 160px; padding: var(--space-5); border-radius: var(--radius-md); background: var(--surface); color: var(--text); min-width: 0; }
.stat__top { display: flex; justify-content: space-between; gap: var(--space-3); font: 500 12px/16px var(--font-text); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.stat__value { display: block; font: 300 clamp(56px, 16vw, 72px)/1 var(--font-display); letter-spacing: -.04em; white-space: nowrap; }
.stat__label { display: block; font: 400 14px/20px var(--font-text); margin-top: var(--space-2); }
.stat--inverse { background: var(--surface-inverse); color: var(--on-inverse); }
.stat--inverse .stat__value { color: var(--accent-on-inverse); }
.stat--brand { background: var(--brand); color: var(--on-brand); }
.stat--spark { background: var(--spark); color: var(--on-spark); }
.stat--inverse .stat__top, .stat--brand .stat__top, .stat--spark .stat__top { color: inherit; opacity: .8; }
@media (min-width: 600px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-height: 196px; }
  .stat__value { font-size: clamp(48px, 8vw, 72px); }
}
@media (min-width: 1100px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat__value { font-size: clamp(56px, 5vw, 72px); }
}

/* Como funciona: 3 cards surface, termo técnico como título */
.how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gutter); }
.how__card { display: grid; align-content: start; gap: var(--space-3); padding: var(--space-5); border-radius: var(--radius-md); background: var(--surface); color: var(--text); }
.how__card .eyebrow { color: var(--text-muted); margin-bottom: var(--space-5); }
.how__card h3 { font-size: 22px; line-height: 1.2; }
.how__plain { font-size: 18px; line-height: 28px; }
.how__detail { font-size: 14px; line-height: 20px; color: var(--text-muted); }
@media (min-width: 900px) { .how { grid-template-columns: repeat(3, minmax(0, 1fr)); } .how__card { padding: var(--space-6); } }

/* Exemplos: MediaFrame em mosaico */
.mosaic { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gutter); }
.example { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--brand); aspect-ratio: 16 / 10; min-width: 0; }
.example > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease-out; }
.example:hover > img { transform: scale(1.02); }
.example__region { position: absolute; border: 2px solid var(--spark); border-radius: 12px; pointer-events: none; }
.example__pin { position: absolute; max-width: calc(100% - 2 * var(--space-4)); overflow: hidden; text-overflow: ellipsis; }
.example__corner { position: absolute; left: var(--space-4); bottom: var(--space-4); max-width: calc(100% - 2 * var(--space-4)); }
@media (max-width: 599px) {
  .example__pin { font-size: 12px; }
  .example__pin + .example__pin { display: none; } /* no mobile, só uma etiqueta por mídia */
}
@media (min-width: 600px) { .mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 600px) { .mosaic > .example:first-child { grid-column: 1 / -1; } }
@media (min-width: 1000px) {
  .mosaic { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: clamp(200px, 17vw, 248px); }
  .example { aspect-ratio: auto; grid-column: 8 / span 5; }
  .mosaic > .example:first-child { grid-column: 1 / span 7; grid-row: span 2; }
}

/* CTA final */
.cta { display: grid; gap: var(--space-5); justify-items: start; background: var(--surface-inverse); color: var(--on-inverse); border-radius: var(--radius-lg); padding: var(--space-7) var(--space-5); }
.cta h2 { font-size: clamp(36px, 9vw, 64px); line-height: 1; letter-spacing: -.03em; }
.cta h2 span { color: var(--accent-on-inverse); }
.cta p { max-width: 46ch; }
@media (min-width: 600px) { .cta { padding: var(--space-7) var(--space-6); } }
@media (min-width: 900px) { .cta { grid-template-columns: 1fr auto; align-items: end; padding: var(--space-8) var(--space-7); } .cta > .btn { grid-row: 1 / span 3; grid-column: 2; } }

/* Botão Analisar: grande, abaixo do upload e do link; habilita quando há arquivo ou link. */
.hero__submit { min-height: 64px; font-size: 18px; }

/* Coluna do formulário do hero: toggle de modo no topo + formulário de mídia ou de texto. */
.hero__forms { display: grid; gap: var(--space-4); align-content: start; min-width: 0; }
@media (min-width: 1000px) {
  .hero__forms { grid-column: 2; grid-row: 1; }
  .hero__forms .hero__form { grid-column: auto; grid-row: auto; }
}

/* Linha discreta do "Como funciona" sobre o modo texto. */
.how__note { display: flex; align-items: flex-start; gap: var(--space-3); margin-top: var(--space-5); font: 400 15px/22px var(--font-text); color: var(--text-muted); max-width: 72ch; }
.how__note b { font-weight: 500; color: var(--text); }
.how__note-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--text); }
.how__note-icon svg { width: 16px; height: 16px; }
