/* Valores do design: design/canvas/Main.dc.html e DesignSystem.dc.html */

@font-face {
  font-family: "Space Grotesk";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/fontes/space-grotesk-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  src: url("/fontes/inter.woff2") format("woff2");
}

:root {
  --fundo: #0E0E10;
  --superficie: #18181C;
  --esqueleto: #222228;
  --linha: #2A2A31;
  --linha-forte: #3A3A42;
  --texto: #F4F4F0;
  --texto-claro: #D4D4D8;
  --texto-erro: #E4E4E7;
  --apoio: #A1A1AA;
  --icone: #71717A;
  --acento: #D4FF3A;
  --sobre-acento: #0E0E10;
  --erro: #FF6B5A;
  --erro-fundo: #1F1414;
  --erro-borda: #5A2A26;
  --titulo: 44px;
  --pad-raiz: 48px 24px;
  --pad-pin: 40px;
  --display: "Space Grotesk", system-ui, sans-serif;
  --corpo: Inter, system-ui, sans-serif;
  color-scheme: dark;
}

@media (max-width: 767px) {
  :root {
    --titulo: 34px;
    --pad-raiz: 16px 18px 24px;
    --pad-pin: 64px;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--corpo);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }

.raiz {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: var(--pad-raiz);
}
.coluna { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 28px; }

.titulo {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--titulo);
  line-height: 1.05;
  letter-spacing: -1px;
}
.titulo-erro { color: var(--erro); }
.apoio { margin: 0; font-size: 14px; color: var(--apoio); }

/* PIN */
.tela-pin { display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: var(--pad-pin); }
.pontos { display: flex; gap: 14px; min-height: 20px; }
.pontos span {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--linha-forte); background: transparent;
}
.pontos span.cheio { border-color: var(--acento); background: var(--acento); }
.pontos.errado span { border-color: var(--erro); background: transparent; }
.msg-pin { margin: 0; min-height: 21px; font-size: 14px; color: var(--erro); }
.teclado {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  width: 100%; max-width: 320px;
}
.tecla {
  height: 72px; background: var(--superficie); color: var(--texto);
  border: 1px solid var(--linha); border-radius: 18px;
  font: 700 28px var(--display);
}
.tecla:active { background: var(--esqueleto); }
.tecla-apagar {
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--texto-claro); border: 0;
}

/* Bloqueado */
.tela-bloqueado { display: flex; flex-direction: column; gap: 12px; padding-top: var(--pad-pin); }
.tela-bloqueado p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--apoio); }

/* App */
.tela-app { display: flex; flex-direction: column; gap: 28px; }
.form { display: flex; flex-direction: column; gap: 12px; padding-top: 72px; }
.linha-campo { display: flex; gap: 8px; }
.campo {
  flex: 1 1 auto; min-width: 0; height: 56px; padding: 0 16px;
  background: var(--superficie); color: var(--texto);
  border: 2px solid var(--linha); border-radius: 14px;
  font: 500 16px var(--corpo);
}
.campo::placeholder { color: var(--icone); }
.campo:focus { border-color: var(--linha-forte); outline: none; }
.campo:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.botao-colar {
  flex: 0 0 auto; height: 56px; padding: 0 18px;
  display: flex; align-items: center; gap: 8px;
  background: var(--acento); color: var(--sobre-acento); border: 0; border-radius: 14px;
  font: 700 16px var(--display);
}
.selo { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--texto-claro); }
.selo .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--acento); flex: 0 0 auto; }

.vazio {
  display: flex; flex-direction: column; gap: 10px; padding: 20px;
  border: 1px dashed var(--linha); border-radius: 16px;
  color: var(--apoio); font-size: 15px; line-height: 1.5;
}
.vazio p { margin: 0; }

.cartao { display: flex; flex-direction: column; padding: 16px; background: var(--superficie); border-radius: 18px; }
.carregando { gap: 14px; }
.previa { gap: 16px; }
.esqueleto { background: var(--esqueleto); border-radius: 6px; }
.esqueleto-mini { aspect-ratio: 16 / 9; border-radius: 12px; }
.esqueleto-titulo { height: 18px; width: 75%; }
.esqueleto-autor { height: 14px; width: 40%; }
.barra-fina { height: 6px; background: var(--linha); border-radius: 3px; overflow: hidden; }
.barra-fina div { height: 6px; width: 0; background: var(--acento); transition: width .15s linear; }

.miniatura {
  position: relative; aspect-ratio: 16 / 9; background: var(--esqueleto); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; color: var(--icone); overflow: hidden;
}
.miniatura img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.duracao {
  position: absolute; right: 10px; bottom: 10px; padding: 3px 8px;
  background: var(--fundo); color: var(--texto); border-radius: 6px;
  font: 600 13px var(--corpo);
}
.duracao:empty { display: none; }
.cabeca { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.titulo-video { font: 700 19px/1.25 var(--display); overflow-wrap: anywhere; }

.seletor {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
  padding: 4px; background: var(--fundo); border-radius: 12px;
}
.seletor button {
  height: 44px; border: 0; border-radius: 9px; font: 600 15px var(--corpo);
  background: transparent; color: var(--texto-claro);
}
.seletor button[aria-pressed="true"] { background: var(--acento); color: var(--sobre-acento); }
.seletor button:disabled { opacity: 1; }

.acoes { display: flex; gap: 8px; }
.principal {
  flex: 1 1 auto; height: 60px; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--acento); color: var(--sobre-acento); border: 0; border-radius: 14px;
  font: 700 20px var(--display);
}
.icone {
  flex: 0 0 60px; height: 60px; display: flex; align-items: center; justify-content: center;
  background: var(--esqueleto); color: var(--texto); border: 1px solid var(--linha); border-radius: 14px;
}

.baixando, .pronto { display: flex; flex-direction: column; gap: 8px; }
.barra-grossa { height: 60px; position: relative; background: var(--esqueleto); border-radius: 14px; overflow: hidden; }
.barra-grossa > div { height: 60px; width: 0; background: var(--acento); transition: width .3s linear; }
.barra-grossa span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font: 700 18px var(--display); color: var(--texto); mix-blend-mode: difference;
}
.nota { margin: 0; font-size: 13px; color: var(--apoio); }
.pronto-status { display: flex; align-items: center; gap: 8px; font: 700 18px var(--display); color: var(--acento); }

.cartao-erro {
  display: flex; flex-direction: column; gap: 12px; padding: 18px;
  background: var(--erro-fundo); border: 1px solid var(--erro-borda); border-radius: 18px;
}
.erro-titulo { font: 700 19px var(--display); color: var(--erro); }
.cartao-erro p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--texto-erro); }
.cartao-erro button {
  height: 48px; background: var(--texto); color: var(--fundo); border: 0; border-radius: 12px;
  font: 700 16px var(--display);
}

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

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
