/* ============================================================
   /modulos/estetica: hero próprio e demonstração do mapa facial
   (views landing.heroes.estetica e landing.demos.estetica).

   Carrega DEPOIS do modulo.css e ANTES do style.css: num empate de
   especificidade o style.css vence. Por isso tudo aqui usa classes
   próprias (.est-*) e, onde o elemento também leva classe do
   modulo.css (.mod-hero, .mod-ctas, .sub), o seletor é composto.

   O :focus-visible do style.css troca o border-radius de quem recebe
   foco para 6px; cada controle arredondado daqui repete o próprio raio
   no foco, senão a pílula vira quadrado no Tab.

   Cores da demo = tokens do ApplicationEditor.vue (toxina #1c8af6,
   preenchedor #e5568f, tinta #000029, cinzas dos campos). Onde a cor
   do produto não passa no AA como texto pequeno, a versão escura
   entra só no texto: #1571d0 (4,9:1) e #b8336a (5,6:1).
   ============================================================ */

/* ---------- Hero ---------- */
.mod-hero.est-hero { text-align: left; padding: 150px 0 64px; }
.est-hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(32px, 4.5vw, 64px); align-items: center;
}
.est-hero-copy { min-width: 0; }
.est-hero-badge {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 15px; letter-spacing: -.01em; color: var(--ink);
}
.est-hero-badge-ic {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(13, 40, 90, .09);
  box-shadow: 0 12px 26px -12px rgba(13, 40, 90, .28), inset 0 1px 0 #fff;
}
.est-hero-badge-ic .ic { width: 21px; height: 21px; }
.mod-hero.est-hero h1 {
  margin: 20px 0 0; max-width: none;
  font-size: clamp(2.1rem, 4.2vw, 3.35rem); line-height: 1.07; text-wrap: balance;
}
.mod-hero.est-hero .sub { margin: 20px 0 0; max-width: 540px; }
.est-hero .mod-ctas { justify-content: flex-start; gap: 12px; margin-top: 28px; }
.est-hero .mod-ctas .btn-lg { padding: 15px 22px; font-size: 15px; }
.est-hero-fatos {
  list-style: none; margin: 22px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.est-hero-fatos li {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; line-height: 1.2; color: var(--ink);
  padding: 7px 12px; border-radius: 100px;
  background: rgba(28, 138, 246, .07); border: 1px solid rgba(28, 138, 246, .16);
}
.est-hero-fatos li::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--grad);
}
.est-hero .mod-seg-link { margin-top: 20px; }

.est-hero-media { position: relative; min-width: 0; }
.est-hero-shot { background: #fff; }
/* O chip repete os totais do print (enfeite): entra depois da imagem, só com
   transform, para não mexer no LCP, que é o print. */
.est-hero-chip {
  position: absolute; left: -18px; bottom: -20px; z-index: 2;
  display: flex; flex-direction: column; gap: 5px;
  padding: 11px 15px; border-radius: 18px;
  font-size: 13px; font-weight: 600; line-height: 1.25; color: #33415a;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(13, 40, 90, .08);
  box-shadow: 0 18px 40px -16px rgba(13, 21, 38, .32);
  animation: est-chip-in .7s var(--ease) .55s backwards;
}
.est-hero-chip span { display: flex; align-items: center; gap: 8px; }
.est-hero-chip b { margin-left: auto; padding-left: 12px; font-weight: 800; color: var(--ink); }
@keyframes est-chip-in {
  from { transform: translateY(14px) scale(.96); }
  to { transform: none; }
}
.no-motion .est-hero-chip { animation: none; }

/* ---------- Pontos de cor (hero, legenda, registro) ---------- */
.est-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.est-dot--tox { background: #1c8af6; }
.est-dot--ah { background: #e5568f; }
.est-tx-tox { color: #1571d0; }
.est-tx-ah { color: #b8336a; }

/* ---------- Demonstração ---------- */
.est-demo { max-width: 1132px; margin: 0 auto; }
.est-app {
  --est-ink: #000029; --est-muted: #5b6b86; --est-faint: #8794ab;
  --est-bd: rgba(20, 40, 80, .1); --est-field: #eef1f6; --est-card: #f2f4f8;
  --est-raise: 0 6px 24px rgba(20, 40, 80, .07);
  position: relative;
  padding: 22px 24px 24px; border-radius: 28px;
  background: #fff; color: var(--est-ink);
  border: 1px solid rgba(20, 40, 80, .08);
  box-shadow: 0 34px 90px -44px rgba(13, 21, 38, .38), 0 12px 30px -18px rgba(13, 21, 38, .16);
  line-height: 1.45;
}
.est-app-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--est-bd);
}
.est-app-tt { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.3px; line-height: 1.2; }
.est-tag {
  font-size: 12px; font-weight: 700; color: var(--est-muted);
  padding: 5px 11px; border-radius: 999px;
  background: var(--est-card); border: 1px solid var(--est-bd);
}

/* Campos do topo: procedimento e dose na primeira linha, injetável e lote na
   segunda, como no editor (Título/Procedimento, Injetável/Lote). */
.est-campos {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas: "proc dose" "inj lote";
  gap: 14px 16px; margin-bottom: 14px;
}
.est-campo { min-width: 0; }
.est-campo--proc { grid-area: proc; }
.est-campo--dose { grid-area: dose; }
.est-campo--inj { grid-area: inj; }
.est-campo--lote { grid-area: lote; }
.est-flabel { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; color: var(--est-ink); }
.est-procs { display: flex; flex-wrap: wrap; gap: 8px; }
.est-proc {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 14px; border-radius: 14px;
  font-size: 14px; font-weight: 600; color: var(--est-ink);
  background: var(--est-field); border: 1px solid transparent;
  transition: background .16s, box-shadow .16s;
}
.est-proc small { font-size: 12px; font-weight: 600; color: var(--est-muted); }
.est-proc.on { background: #fff; }
.est-proc[data-proc="tox"].on { box-shadow: inset 0 0 0 2px #1c8af6, var(--est-raise); }
.est-proc[data-proc="ah"].on { box-shadow: inset 0 0 0 2px #e5568f, var(--est-raise); }
.est-proc:focus-visible { border-radius: 14px; }
.est-field {
  display: flex; align-items: center; width: 100%; min-height: 44px;
  padding: 0 14px; border-radius: 12px;
  font: inherit; font-size: 14.5px; color: var(--est-ink);
  background: var(--est-field); border: 1px solid var(--est-bd);
}
select.est-field {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%235b6b86' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.est-field:focus-visible { border-radius: 12px; }
.est-doses { display: flex; flex-wrap: wrap; gap: 6px; }
.est-chip {
  min-height: 44px; min-width: 60px; padding: 0 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; color: var(--est-muted);
  background: var(--est-field); border: 1px solid var(--est-bd);
  transition: background .16s, color .16s, box-shadow .16s;
}
.est-chip:hover { color: var(--est-ink); }
.est-chip.on { background: #fff; color: var(--est-ink); box-shadow: inset 0 0 0 1.5px #1c8af6, var(--est-raise); }
.est-demo[data-proc="ah"] .est-chip.on { box-shadow: inset 0 0 0 1.5px #e5568f, var(--est-raise); }
.est-chip:focus-visible { border-radius: 999px; }

.est-dica { margin: 2px 0 12px; font-size: 14px; font-weight: 500; color: var(--est-ink); }
.est-dica b { font-weight: 700; }

/* Palco + Registro, lado a lado a partir de 1024px */
.est-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: stretch; }
.est-palco-col { display: flex; flex-direction: column; min-width: 0; }
.est-face-top { display: flex; justify-content: center; margin-bottom: 10px; }
.est-seg {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--est-card); border: 1px solid var(--est-bd);
}
.est-seg-opt {
  min-height: 38px; padding: 0 18px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--est-muted);
  transition: background .16s, color .16s;
}
.est-seg-opt:hover { color: var(--est-ink); }
.est-seg-opt.on { color: #fff; background: #1571d0; }
.est-seg-opt:focus-visible { border-radius: 999px; }

/* O desenho é recortado no rosto e no pescoço (viewBox 190 16 700 990 no
   SVG). O <img> de trás usa o mesmo recorte: largura 1080/700, deslocado
   190/700 para a esquerda e 16/990 para cima. */
.est-palco {
  position: relative; width: 100%; max-width: 470px; margin: 0 auto;
  aspect-ratio: 700 / 990; overflow: hidden; border-radius: 22px;
  background: radial-gradient(120% 90% at 50% 22%, #ffffff 0%, #f4f7fc 62%, #eef2f8 100%);
}
.est-palco:has(.est-zona:focus-visible) { box-shadow: 0 0 0 3px rgba(21, 113, 208, .35); }
.est-arte {
  position: absolute; left: -27.1429%; top: -1.6162%;
  width: 154.2857%; max-width: none; height: auto;
  pointer-events: none; user-select: none; -webkit-user-select: none;
}
.est-svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }

/* Regiões: invisíveis até o mouse ou o foco, como a Seleção do produto
   (véu .28 e contorno .8 na cor do procedimento; o rosto geral, que cobre
   tudo, só com um véu leve). */
.est-zona {
  fill: var(--zc, #1c8af6); stroke: var(--zc, #1c8af6); stroke-width: 3;
  fill-opacity: 0; stroke-opacity: 0; cursor: pointer; outline: none;
  transition: fill-opacity .16s, stroke-opacity .16s;
}
@media (hover: hover) {
  .est-zona:hover { fill-opacity: .28; stroke-opacity: .8; }
  .est-zona--ampla:hover { fill-opacity: .12; }
}
.est-zona:focus-visible { outline: none; fill-opacity: .3; stroke-opacity: 1; stroke-width: 4; }
.est-zona--ampla:focus-visible { fill-opacity: .12; }
.est-rotulo-tx {
  fill: #08403a; font-size: 22px; font-weight: 800;
  text-anchor: middle; dominant-baseline: central;
  paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round;
  pointer-events: none;
}

/* Marcas: medidas do produto divididas por 2,6665 (unidade do viewBox dele
   por pixel da arte). */
.est-marca { cursor: pointer; }
.est-pino { fill: var(--c); stroke: #fff; stroke-width: 5.25; }
.est-marca.sel .est-pino { stroke-width: 9.75; }
.est-pino-v {
  fill: #fff; font-weight: 800; text-anchor: middle; dominant-baseline: central;
  pointer-events: none;
}
.est-area {
  fill: var(--c); fill-opacity: .16; stroke: var(--c);
  stroke-width: 4.1; stroke-dasharray: 7.5 5.6;
}
.est-marca--area:hover .est-area { fill-opacity: .28; }
.est-marca.sel .est-area { fill-opacity: .26; stroke-dasharray: none; stroke-width: 7.5; }
.est-area-v {
  fill: #fff; font-size: 31.5px; font-weight: 800;
  text-anchor: middle; dominant-baseline: central;
  paint-order: stroke; stroke: #e5568f; stroke-width: 3.75; stroke-linejoin: round;
  pointer-events: none;
}
.est-marca--nova { animation: est-pop .34s var(--ease) backwards; transform-box: fill-box; transform-origin: center; }
@keyframes est-pop {
  from { transform: scale(.25); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.no-motion .est-marca--nova { animation: none; }

.est-acoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.est-mbtn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 15px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--est-muted);
  background: var(--est-card); border: 1px solid var(--est-bd);
}
.est-mbtn:hover:not([aria-disabled="true"]) { color: var(--est-ink); }
.est-mbtn[aria-disabled="true"] { opacity: .45; cursor: default; }
.est-mbtn--primary { color: #1571d0; border-color: rgba(28, 138, 246, .3); }
.est-mbtn--perigo { color: #c9353a; border-color: rgba(229, 72, 77, .28); }
.est-mbtn--primary:hover:not([aria-disabled="true"]) { color: #0f5fb3; }
.est-mbtn--perigo:hover:not([aria-disabled="true"]) { color: #a8282d; }
.est-mbtn:focus-visible { border-radius: 999px; }
.est-legenda {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px;
  margin-top: 12px; font-size: 12.5px; color: var(--est-muted);
}
.est-legenda span { display: inline-flex; align-items: center; gap: 7px; }

/* Registro de Atendimento (moldura cinza + cartão branco, como no editor).
   No computador o cartão é absoluto dentro da moldura: quem dita a altura
   da linha é o palco, e a lista rola por dentro. */
.est-reg-moldura {
  position: relative; min-width: 0;
  padding: 12px; border-radius: 24px; background: var(--est-card);
}
.est-reg {
  position: absolute; inset: 12px;
  display: flex; flex-direction: column; min-height: 0;
  padding: 18px 14px 10px; border-radius: 18px;
  background: #fff; box-shadow: var(--est-raise);
}
.est-reg-head { margin-bottom: 12px; text-align: center; }
.est-reg-tt { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.est-reg-sub { margin-top: 4px; font-size: 12.5px; color: var(--est-muted); }
.est-reg-lista {
  position: relative; flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 4px 4px 2px;
  scrollbar-width: thin; scrollbar-color: rgba(20, 40, 80, .2) transparent;
}
.est-grp { margin-bottom: 14px; }
.est-grp > header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.est-count {
  margin-left: auto; display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--est-muted);
  background: var(--est-field); border: 1px solid var(--est-bd);
}
.est-rows { list-style: none; margin: 0; padding: 0; }
.est-row {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 7px; padding: 4px 5px 4px 4px; border-radius: 14px;
  background: var(--est-field); transition: box-shadow .16s;
}
.est-row.sel { box-shadow: inset 0 0 0 1.5px var(--c); }
.est-row-nome {
  flex: 1; min-width: 0; min-height: 40px;
  display: flex; align-items: center; gap: 8px;
  padding: 3px 6px; border-radius: 10px; text-align: left;
}
.est-row-nome > span { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.est-row-nome b { font-size: 13px; font-weight: 600; color: var(--est-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est-row-nome small { font-size: 11.5px; color: var(--est-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est-row-nome:focus-visible { border-radius: 10px; }
.est-row-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c); }
.est-row-dose {
  flex: none; display: inline-flex; align-items: center; gap: 1px;
  padding: 2px; border-radius: 12px; background: #fff; border: 1px solid var(--est-bd);
}
.est-step, .est-row-rm {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center;
  color: var(--est-muted); transition: background .14s, color .14s;
}
.est-step { border-radius: 9px; }
.est-step:hover { color: var(--est-ink); background: var(--est-field); }
.est-step:focus-visible { border-radius: 9px; }
.est-row-v {
  min-width: 52px; padding: 0 2px; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--est-ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.est-row-rm { border-radius: 50%; }
.est-row-rm:hover { color: #c9353a; background: rgba(229, 72, 77, .1); }
.est-row-rm:focus-visible { border-radius: 50%; }
.est-vazio {
  padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--est-bd);
  font-size: 12.5px; line-height: 1.5; color: var(--est-muted);
}

/* Totais, aviso de dose e título automático */
.est-totais {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 20px;
  margin-top: 16px; padding: 18px 20px; border-radius: 24px; background: var(--est-card);
}
.est-totais[hidden], .est-dose-alta[hidden] { display: none; }
.est-total { text-align: center; }
.est-total-lbl { margin-bottom: 8px; font-size: 15px; font-weight: 600; color: var(--est-ink); }
.est-total-pill {
  padding: 10px; border-radius: 999px; background: #fff; box-shadow: var(--est-raise);
  font-size: 20px; font-weight: 800; letter-spacing: -.3px; line-height: 1.3;
}
.est-total-pill--ah { color: #e5568f; }
.est-dose-alta {
  display: flex; align-items: center; gap: 7px;
  margin-top: 10px; padding: 9px 12px; border-radius: 12px;
  font-size: 13px; font-weight: 600; color: #c9353a;
  background: rgba(229, 72, 77, .1); border: 1px solid rgba(229, 72, 77, .22);
}
.est-dose-alta svg { flex: none; }
.est-titulo-auto { margin-top: 12px; text-align: center; font-size: 12.5px; line-height: 1.5; color: var(--est-muted); }
.est-titulo-auto b { font-weight: 700; color: var(--est-ink); }
.est-demo-nota {
  max-width: 780px; margin: 18px auto 0; text-align: center;
  font-size: 13.5px; line-height: 1.6; color: var(--muted);
}
.est-demo-nota a { color: #1571d0; text-decoration: underline; text-underline-offset: 3px; }
.est-demo-nota a:hover { color: #0f5fb3; }

/* Sem JS: o estado inicial fica desenhado, os controles somem. */
.no-js .est-so-js { display: none !important; }

/* ---------- Responsivo ---------- */
@media (max-width: 1023px) {
  .mod-hero.est-hero { padding: 128px 0 48px; }
  .est-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .mod-hero.est-hero .sub { max-width: 640px; }
  .est-hero-media { max-width: 720px; }
  .est-grid { grid-template-columns: minmax(0, 1fr); }
  .est-reg { position: static; }
  .est-reg-lista { max-height: 400px; }
}
@media (max-width: 719px) {
  .mod-hero.est-hero { padding: 116px 0 40px; }
  .est-hero-chip { left: 10px; bottom: -18px; font-size: 12px; padding: 9px 12px; }
  .est-app { padding: 16px 14px 18px; border-radius: 22px; }
  .est-app-tt { font-size: 19px; }
  .est-campos { grid-template-columns: minmax(0, 1fr); grid-template-areas: "proc" "dose" "inj" "lote"; gap: 12px; }
  .est-proc { flex: 1 1 200px; }
  .est-palco { max-width: 420px; border-radius: 18px; }
  .est-reg-moldura { padding: 0; background: none; }
  .est-reg { padding: 14px 10px 8px; box-shadow: none; border: 1px solid var(--est-bd); }
  .est-reg-lista { max-height: 380px; }
  .est-totais { padding: 14px; gap: 12px; }
  .est-total-lbl { font-size: 14px; }
  .est-total-pill { font-size: 18px; }
}
@media (max-width: 520px) {
  .est-hero .mod-ctas .btn { width: 100%; }
  .est-hero-fatos li { font-size: 12.5px; }
}
@media (max-width: 400px) {
  /* Nome em cima, dose e remover embaixo, para o nome não virar reticências */
  .est-row { flex-wrap: wrap; }
  .est-row-nome { flex-basis: 100%; }
  .est-row-dose { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .est-hero-chip, .est-marca--nova { animation: none; }
  .est-zona, .est-proc, .est-chip, .est-seg-opt, .est-row, .est-step, .est-row-rm { transition: none; }
}
