/* Botão principal: pílula laranja de texto com seta. O laranja é cor de ação, nunca de aprovação. */
.btn {
  --mx: 0px;
  --my: 0px;
  --sobe: 0px;
  --aperta: 1;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--e3);
  min-height: 3.5rem;
  max-width: 100%;
  padding: 0 var(--e6);
  border: 0;
  border-radius: var(--r-pilula);
  background: var(--laranja-txt);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transform: translate3d(var(--mx), calc(var(--my) + var(--sobe)), 0) scale(var(--aperta));
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), background-color var(--dur);
  -webkit-tap-highlight-color: transparent;
}
.btn > * { position: relative; z-index: 1; }

/* o brilho que varre o fundo */
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .34) 50%, transparent 68%);
  transform: translateX(-130%);
}

.btn-seta {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  transition: transform 260ms var(--ease);
}

@media (hover: hover) {
  .btn:hover:not([aria-disabled="true"]) {
    --sobe: -2px;
    box-shadow: 0 12px 18px -12px rgba(66, 66, 60, .6);
  }
  .btn:hover:not([aria-disabled="true"])::before {
    transform: translateX(130%);
    transition: transform 720ms var(--ease);
  }
  .btn:hover:not([aria-disabled="true"]) .btn-seta { transform: translateX(5px); }
}
.btn:active:not([aria-disabled="true"]) { --aperta: .97; --sobe: 0px; transition-duration: 90ms; }
.btn:focus-visible { outline: 3px solid var(--grafite); outline-offset: 3px; border-radius: var(--r-pilula); }

/* Desabilitado: chapado, sem movimento. A razão vem escrita embaixo (.motivo). */
.btn[aria-disabled="true"] {
  background: var(--creme);
  color: var(--grafite);
  cursor: not-allowed;
  box-shadow: none;
}
.btn[aria-disabled="true"]::before { display: none; }
.btn[aria-disabled="true"] .btn-seta { display: none; }

.motivo {
  max-width: 26rem;
  font-size: var(--t-apoio);
  line-height: 1.45;
  color: var(--grafite-claro);
}

/* Botão secundário: texto grafite, sublinhado que se desenha no hover */
.btn-texto {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--e2);
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--grafite);
  font-size: var(--t-ui);
  font-weight: 600;
  text-decoration: none;
}
.btn-texto::before,
.btn-texto::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: .5rem;
  height: 1.5px;
  background: currentColor;
}
.btn-texto::before { opacity: .28; }
.btn-texto::after {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur) var(--ease);
}
.btn-texto:hover::after,
.btn-texto:focus-visible::after { transform: scaleX(1); }

/* Ação de apoio (adicionar, copiar, abrir): contorno grafite, sem competir com o laranja */
.btn-contorno {
  --sobe: 0px;
  --aperta: 1;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--e2);
  min-height: 2.75rem;
  padding: 0 var(--e5);
  border: 1.5px solid var(--grafite);
  border-radius: var(--r-pilula);
  background: var(--papel);
  color: var(--grafite);
  font-size: var(--t-ui);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transform: translateY(var(--sobe)) scale(var(--aperta));
  transition: transform 200ms var(--ease), background-color var(--dur), color var(--dur), border-color var(--dur), box-shadow 200ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn-contorno svg { width: 1.125rem; height: 1.125rem; flex: none; }
@media (hover: hover) {
  .btn-contorno:hover:not([aria-disabled="true"]) {
    --sobe: -1px;
    background: var(--grafite);
    color: var(--papel);
    box-shadow: 0 8px 14px -10px rgba(66, 66, 60, .6);
  }
}
.btn-contorno:active:not([aria-disabled="true"]) { --aperta: .97; transition-duration: 80ms; }
.btn-contorno[aria-disabled="true"] {
  border-color: var(--fio-campo);
  color: var(--grafite-claro);
  cursor: not-allowed;
}

/* Copiar: vira "Copiado" com o visto verde desenhado, por 2 segundos */
.btn-contorno.copiado,
.btn-contorno.copiado:hover:not([aria-disabled="true"]) {
  border-color: var(--certo);
  background: var(--papel);
  color: var(--certo-txt);
  box-shadow: none;
}
.copiar { display: contents; }
.btn-copiar .ic-padrao { display: inline-flex; }
.btn-copiar .ic-copiado,
.btn-copiar .rotulo-copiado { display: none; }
.btn-copiar.copiado .ic-padrao,
.btn-copiar.copiado .rotulo-padrao { display: none; }
.btn-copiar.copiado .ic-copiado { display: inline-flex; }
.btn-copiar.copiado .rotulo-copiado { display: inline; }

.visto { overflow: visible; }
.visto path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
}
.copiado .visto path,
.visto.desenha path { animation: desenha 420ms var(--ease) forwards; }
@keyframes desenha { to { stroke-dashoffset: 0; } }

/* Botão só de ícone: remover linha, fechar painel */
.btn-icone {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  border-radius: var(--r-pilula);
  color: var(--grafite-claro);
  transition: color var(--dur), background-color var(--dur), transform 160ms var(--ease);
}
.btn-icone svg { width: 1.125rem; height: 1.125rem; }
@media (hover: hover) {
  .btn-icone:hover { color: var(--grafite); background: rgba(66, 66, 60, .07); }
}
.btn-icone:active { transform: scale(.92); }

.acoes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--e3) var(--e5);
}
