/*
  Demonstração: o painel do Dashpoint (o de verdade, numa janela), o relógio
  de ponto da empresa fictícia e o Coletor Dashpoint.
  Usa os tokens da identidade do sistema, definidos em site.css.
*/

:root {
  --palco: var(--verde-800);
  --sobre-palco: var(--creme);
  --sobre-palco-2: var(--verde-100);
  --palco-linha: rgba(255, 251, 233, 0.16);
  --palco-realce: rgba(255, 251, 233, 0.07);
  --relogio-corpo: #f1eee2;
  --relogio-fenda: #d9d4c1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ Seção (palco verde) */

.secao-demo {
  background: var(--palco);
  color: var(--sobre-palco);
}

.secao-demo h2 {
  color: var(--sobre-palco);
}

.secao-demo .sobretitulo {
  color: var(--rosa-500);
}

.secao-demo .lead {
  color: var(--sobre-palco-2);
}

.demo-cabeca {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: clamp(24px, 4vw, 56px);
  align-items: end;
  margin-bottom: clamp(24px, 3vw, 36px);
}

.demo-cabeca-texto {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.demo-rodape {
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--sobre-palco-2);
  max-width: 80ch;
}

.demo-sem-js {
  padding: 24px;
  border: 1px solid var(--palco-linha);
  border-radius: var(--raio-g);
}

@media (max-width: 960px) {
  .demo-cabeca {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Roteiro */
.roteiro {
  border: 1px solid var(--palco-linha);
  background: var(--palco-realce);
  border-radius: var(--raio-g);
  padding: 14px 14px 10px;
}

.roteiro-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 4px 10px;
}

.roteiro-titulo {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sobre-palco-2);
}

.roteiro-progresso {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--sobre-palco);
}

.roteiro-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.roteiro-passo button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  border: 0;
  border-radius: var(--raio);
  background: transparent;
  color: var(--sobre-palco);
  font: inherit;
  font-size: 0.97rem;
  text-align: left;
  cursor: pointer;
}

.roteiro-passo button:hover {
  background: var(--palco-realce);
}

.roteiro-num {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--sobre-palco-2);
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 700;
}

.roteiro-passo .roteiro-seta {
  margin-left: auto;
  opacity: 0.6;
}

.roteiro-feito .roteiro-num {
  border-color: var(--rosa-500);
  background: var(--rosa-500);
  color: var(--verde-800);
}

.roteiro-feito .roteiro-texto {
  color: var(--sobre-palco-2);
}

.roteiro-feito .roteiro-seta {
  visibility: hidden;
}

.roteiro-fim {
  margin: 8px 4px 4px;
  padding-top: 12px;
  border-top: 1px solid var(--palco-linha);
  display: grid;
  gap: 10px;
  font-size: 0.95rem;
}

.roteiro-fim .botao {
  justify-self: start;
  background: var(--creme);
  border-color: var(--creme);
  color: var(--verde-800);
}

.roteiro-fim .botao:hover {
  background: var(--branco);
  border-color: var(--branco);
  color: var(--verde-800);
}

/* ------------------------------------------------------------------ Grade da demonstração */

.demo-alternar {
  display: none;
}

.demo-grade {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}

.aparelho-area {
  position: sticky;
  top: calc(var(--topo-altura) + 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.aparelho-legenda {
  text-align: center;
  font-size: 0.86rem;
  color: var(--sobre-palco-2);
}

.aparelho-legenda strong {
  display: block;
  color: var(--sobre-palco);
  font-weight: 650;
}

@media (max-width: 1099px) {
  .demo-alternar {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 14px;
    border: 1px solid var(--palco-linha);
    border-radius: 12px;
    background: var(--palco-realce);
  }
  .demo-alternar button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--sobre-palco-2);
    font: inherit;
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
  }
  .demo-alternar button[aria-selected="true"] {
    background: var(--sobre-palco);
    color: var(--verde-800);
  }
  .rotulo-curto {
    display: none;
  }
  .demo-grade {
    grid-template-columns: minmax(0, 1fr);
  }
  .demo-grade[data-vista-movel="painel"] .aparelho-area {
    display: none;
  }
  .demo-grade[data-vista-movel="aparelho"] .janela-painel {
    display: none;
  }
  .aparelho-area {
    position: static;
  }
}

@media (max-width: 480px) {
  .rotulo-longo {
    display: none;
  }
  .rotulo-curto {
    display: inline;
  }
}


/* Avisos (toast) */
.app-avisos {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  width: min(560px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.aviso {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--tinta);
  color: var(--creme);
  box-shadow: var(--sombra-forte);
  font-size: 0.9rem;
  pointer-events: auto;
  animation: subir 0.25s ease-out;
}

.aviso > .icone {
  color: var(--verde-100);
}

.aviso span {
  flex: 1;
}

.aviso-acao {
  flex: none;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 251, 233, 0.5);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
}

@keyframes subir {
  from {
    transform: translateY(8px);
  }
  to {
    transform: none;
  }
}


/* ------------------------------------------------------------------ Relógio de ponto */

.relogio {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 14px 16px 22px;
  border-radius: 24px;
  background: var(--relogio-corpo);
  border: 1px solid var(--linha);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--tinta);
}

.relogio-cabeca {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 0 2px 10px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tinta-3);
}

.relogio-tela {
  display: grid;
  gap: 4px;
  min-height: 148px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--tinta);
  color: var(--verde-100);
  font-family: var(--mono);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.rt-hora {
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--creme);
  font-variant-numeric: tabular-nums;
}

.rt-data {
  font-size: 0.78rem;
}

.rt-msg {
  margin-top: 6px;
  font-size: 0.84rem;
  color: var(--verde-100);
}

.rt-entrada {
  font-size: 1.35rem;
  letter-spacing: 0.18em;
  color: var(--creme);
  min-height: 1.6em;
}

.rt-entrada::after {
  content: "_";
  animation: piscar-cursor 1s steps(1) infinite;
}

@keyframes piscar-cursor {
  50% {
    opacity: 0;
  }
}

.rt-ok {
  color: var(--creme);
  font-weight: 600;
}

.rt-erro {
  color: var(--rosa-500);
}

.relogio-teclado {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.tecla {
  min-height: 44px;
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  background: var(--branco);
  color: var(--tinta);
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--linha);
}

.tecla:active {
  transform: translateY(1px);
  box-shadow: none;
}

.tecla-ok {
  background: var(--verde-700);
  border-color: var(--verde-700);
  color: var(--branco);
  box-shadow: 0 2px 0 var(--verde-800);
}

.tecla-limpar {
  color: var(--rosa-600);
  font-size: 0.9rem;
}

.relogio-leitor {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.cracha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px dashed var(--tinta-3);
  border-radius: var(--raio);
  background: transparent;
  color: var(--verde-800);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
}

.cracha:hover {
  background: rgba(255, 255, 255, 0.6);
}

.biometria {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #cfc9b3 0 30%, #bdb69c 31% 60%, #a9a287 61%);
  border: 1px solid var(--linha);
}

.relogio-fenda {
  height: 6px;
  margin: 16px 34px 0;
  border-radius: 3px;
  background: var(--relogio-fenda);
}

.relogio-papel {
  position: relative;
  width: calc(100% - 64px);
  max-width: 256px;
  margin: -2px auto 8px;
  padding: 12px 12px 14px;
  background: var(--branco);
  border: 1px solid var(--linha-2);
  border-top: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.5;
  color: var(--tinta-2);
  box-shadow: var(--sombra-media);
  animation: imprimir 0.6s ease-out;
}

.relogio-papel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 8px;
  background: linear-gradient(135deg, var(--branco) 50%, transparent 50%) 0 0 / 12px 8px repeat-x, linear-gradient(225deg, var(--branco) 50%, transparent 50%) 0 0 / 12px 8px repeat-x;
}

@keyframes imprimir {
  from {
    transform: translateY(-16px);
  }
  to {
    transform: none;
  }
}

.papel-titulo {
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--linha);
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  color: var(--tinta);
}

.papel-dados {
  display: grid;
  gap: 3px;
  margin: 0;
}

.papel-dados div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.papel-dados dt {
  color: var(--tinta-3);
  flex: none;
}

.papel-dados dd {
  margin: 0;
  font-weight: 600;
  color: var(--tinta);
  text-align: right;
  overflow-wrap: anywhere;
}

.relogio-dica {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  width: 100%;
  max-width: 320px;
  font-size: 0.84rem;
  color: var(--sobre-palco-2);
  text-align: center;
}

.relogio-dica b {
  font-family: var(--mono);
  color: var(--sobre-palco);
}

.relogio-dica button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--palco-linha);
  border-radius: 8px;
  background: var(--palco-realce);
  color: var(--sobre-palco);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

/* ------------------------------------------------------------------ Coletor (mesmo desenho da página do programa) */

.coletor {
  width: 100%;
  max-width: 320px;
  padding: 14px 16px 16px;
  border: 1px solid var(--linha-2);
  border-radius: var(--raio-g);
  background: var(--branco);
  color: var(--tinta);
  box-shadow: 0 1px 2px rgba(21, 68, 59, 0.05);
}

.coletor-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.coletor-nome {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--verde-800);
}

.coletor-dica {
  margin: 4px 0 10px;
  font-size: 0.78rem;
  color: var(--tinta-2);
}

.coletor-sit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.coletor-item {
  padding: 8px 10px;
  border-radius: var(--raio);
  background: var(--creme-2);
}

.coletor-rotulo {
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tinta-3);
}

.coletor-valor {
  font-size: 1rem;
  font-weight: 650;
  color: var(--verde-800);
  font-variant-numeric: tabular-nums;
}

.coletor-log {
  margin: 0;
  max-height: 128px;
  padding: 10px 12px;
  overflow: auto;
  border-radius: var(--raio);
  background: var(--tinta);
  color: var(--verde-100);
  font: 0.7rem/1.55 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.coletor-log .log-novo {
  color: var(--creme);
  font-weight: 600;
}

/* Chamar atenção para um botão do roteiro */
.piscar {
  animation: chamar 1.2s ease-out 2;
}

@keyframes chamar {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 95, 161, 0.8);
  }
  100% {
    box-shadow: 0 0 0 16px rgba(255, 95, 161, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vivo,
  .relogio-papel,
  .rt-entrada::after,
  .aviso,
  .piscar {
    animation: none;
  }
}


/* ------------------------------------------------------------------ Janela com o painel de verdade */

.janela-painel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--creme);
  border: 1px solid rgba(255, 251, 233, 0.22);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.janela-barra {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  background: #ebe6d4;
  color: var(--tinta-2);
  font-size: 0.8rem;
}

.janela-bolinhas {
  display: inline-flex;
  gap: 6px;
  flex: none;
}

.janela-bolinhas i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d2ccb5;
}

.janela-endereco {
  flex: 1;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.75);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--tinta-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.janela-acao {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--verde-800);
  font-weight: 650;
  font-size: 0.8rem;
  text-decoration: none;
}

.janela-acao:hover {
  background: rgba(255, 255, 255, 0.7);
}

.janela-tela {
  position: relative;
  overflow: hidden;
  height: 640px;
  background: var(--creme);
}

.janela-painel iframe {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--creme);
  transform-origin: 0 0;
}

.janela-carregando {
  display: grid;
  place-items: center;
  height: 240px;
  color: var(--tinta-3);
  font-size: 0.9rem;
}

@media (max-width: 560px) {
  .janela-endereco {
    display: none;
  }
  .janela-barra {
    justify-content: space-between;
  }
}

/* O que o relógio ainda não mandou: aparece no cartão do Coletor */
.coletor-pendente {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: var(--raio);
  background: var(--rosa-050, #fff2f7);
  color: var(--rosa-700, #a81450);
  font-size: 0.78rem;
  font-weight: 600;
}

.coletor-pendente button {
  margin-left: 6px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
