/* =========================================================================
   COMPONENTES — medidas, painéis, etiquetas, revelações, avisos
   ========================================================================= */

/* ---------- Linha de medida (elemento assinatura) ---------- */
.dim {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  user-select: none;
}

.dim__line {
  position: relative;
  flex: 1 1 auto;
  height: 1px;
  min-width: 18px;
  background: var(--line-2);
  transform-origin: left center;
}
.dim__line::before,
.dim__line::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 9px;
  background: var(--line-3);
}
.dim__line::before { left: 0; }
.dim__line::after { right: 0; }
.dim__line--r { transform-origin: right center; }

.dim__label {
  flex: none;
  display: inline-block;
  white-space: nowrap;
  min-width: 0;
}
.dim__label b { font-weight: 500; }
.dim__label b {
  font-weight: 500;
  color: var(--text-2);
}

/* ---------- Etiquetas ---------- */
.tag {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.02);
}
.tag svg { width: 11px; height: 11px; }

.tag--green { color: var(--green-300); border-color: rgba(46, 224, 140, 0.34); background: rgba(23, 201, 118, 0.08); }
.tag--red { color: var(--red-300); border-color: rgba(255, 87, 104, 0.34); background: rgba(229, 56, 74, 0.08); }
.tag--blue { color: var(--blue-400); border-color: rgba(63, 124, 255, 0.4); background: rgba(31, 92, 255, 0.09); }
.tag--cyan { color: var(--cyan-300); border-color: rgba(92, 231, 255, 0.34); background: rgba(31, 212, 242, 0.08); }

.tag--solid-red {
  color: #fff;
  background: var(--red-500);
  border-color: var(--red-400);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  flex: none;
}
.dot--live {
  background: var(--green-400);
  box-shadow: 0 0 0 3px rgba(46, 224, 140, 0.14);
  animation: dot-live 2.4s var(--ease-in-out) infinite;
}
@keyframes dot-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Painel técnico ---------- */
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background:
    linear-gradient(180deg, rgba(12, 22, 38, 0.9), rgba(6, 11, 21, 0.86));
  box-shadow: var(--shadow-panel);
}

/* marcas de registro nos cantos */
.panel--marked::before,
.panel--marked::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
  opacity: 0.75;
}
.panel--marked::before {
  top: 6px;
  left: 6px;
  border-top: 1px solid var(--line-3);
  border-left: 1px solid var(--line-3);
}
.panel--marked::after {
  right: 6px;
  bottom: 6px;
  border-right: 1px solid var(--line-3);
  border-bottom: 1px solid var(--line-3);
}

/* ---------- Revelação no scroll ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 760ms var(--ease-out),
    transform 760ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 80ms);
  will-change: opacity, transform;
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

.js [data-reveal="mask"] {
  clip-path: inset(0 0 102% 0);
  opacity: 1;
  transform: none;
  transition: clip-path 900ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js [data-reveal="mask"].is-in { clip-path: inset(0 0 -2% 0); }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal],
  .js [data-reveal="mask"] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}

/* ---------- Aviso / toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border: 1px solid rgba(92, 231, 255, 0.32);
  border-radius: var(--r-sm);
  background: rgba(8, 16, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 44px -20px rgba(0, 0, 0, 0.9);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.35;
  transform: translate(-50%, 22px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease-out),
              transform var(--t-base) var(--ease-out),
              visibility var(--t-base);
}
.toast[data-show="true"] {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.toast svg { width: 17px; height: 17px; color: var(--cyan-400); flex: none; }
.toast--green { border-color: rgba(46, 224, 140, 0.35); }
.toast--green svg { color: var(--green-400); }

/* ---------- Botão copiar e-mail ---------- */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.copy-btn:hover { color: var(--text); border-color: var(--line-3); background: rgba(255, 255, 255, 0.04); }
.copy-btn svg { width: 14px; height: 14px; flex: none; }
.copy-btn__idle { display: inline-flex; align-items: center; gap: 7px; }
.copy-btn__ok { display: none; align-items: center; gap: 6px; color: var(--green-300); }
.copy-btn[data-copied="true"] { border-color: rgba(46, 224, 140, 0.45); border-style: solid; }
.copy-btn[data-copied="true"] .copy-btn__idle { display: none; }
.copy-btn[data-copied="true"] .copy-btn__ok { display: inline-flex; }

/* ---------- Faixa de fatos (hero) ---------- */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 0;
  padding-top: var(--s-5);
  margin-top: var(--s-5);
  border-top: 1px solid var(--line);
  list-style: none;
}
.facts li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.facts svg { width: 14px; height: 14px; color: var(--blue-400); flex: none; }

/* ---------- Ícone em círculo/quadrado ---------- */
.icon-box {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(31, 92, 255, 0.16), rgba(31, 92, 255, 0.04));
  color: var(--cyan-300);
  flex: none;
}
.icon-box svg { width: 19px; height: 19px; }

/* ---------- Modo medição (easter egg) ---------- */
html.is-measuring [data-measure] {
  outline: 1px dashed rgba(92, 231, 255, 0.55);
  outline-offset: 2px;
}
html.is-measuring .sheet__grid { opacity: 1; }

.mlabel {
  position: fixed;
  z-index: 95;
  pointer-events: none;
  padding: 2px 5px;
  background: rgba(4, 12, 22, 0.92);
  border: 1px solid rgba(92, 231, 255, 0.4);
  color: var(--cyan-300);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-radius: 2px;
}

/* ---------- Régua de status do sistema (usada no palco de demos) ---------- */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
}
.statusbar__group { display: inline-flex; align-items: center; gap: 7px; }

/* Em telas estreitas a anotação pode quebrar em duas linhas em vez de estourar */
@media (max-width: 560px) {
  .dim { font-size: 9.5px; letter-spacing: 0.1em; gap: 8px; }
  .dim__line { min-width: 12px; }
  .dim__label {
    flex: 0 1 auto;
    white-space: normal;
    text-align: center;
    line-height: 1.5;
    letter-spacing: 0.09em;
  }
}
