/* Demonstração guiada do Credencia: mesma paleta do produto (globals.css). */
@font-face { font-family: "Geist"; font-weight: 100 900; src: url("/demo/fontes/geist-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-weight: 100 900; src: url("/demo/fontes/geist-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-weight: 100 900; src: url("/demo/fontes/geist-mono-latin.woff2") format("woff2"); }

:root {
  --ink: #0f172a; --muted: #5d6b7f; --border: #e2e8f0; --bg: #f5f7f9;
  --teal: #0f766e; --teal-bright: #2dd4bf; --teal-soft: #e7f6f3; --dark: #0b2a2e; --dark-2: #071a1c;
  --rose: #e11d48; --amber: #f59e0b;
  --barra: 172px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--dark-2); color: #fff; font-family: "Geist", "Segoe UI", system-ui, sans-serif; font-size: 14px; }
button { font: inherit; }
.mono { font-family: "Geist Mono", Consolas, monospace; }

.demo { display: grid; grid-template-rows: 1fr var(--barra); height: 100dvh; }

/* ------------------------------------------------------------ palco */
.palco { position: relative; background: var(--bg); overflow: hidden; }
#quadro { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

.cursor { position: absolute; left: 0; top: 0; z-index: 38; pointer-events: none; transform: translate(-6px, -4px); transition: transform 420ms cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.cursor svg { display: block; position: relative; z-index: 1; }
.cursor .onda { position: absolute; left: 4px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: rgba(45,212,191,.55); transform: scale(0); opacity: 0; }
.cursor.clicando .onda { animation: onda 520ms ease-out; }
@keyframes onda { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }

.legenda { position: absolute; left: 50%; bottom: 22px; z-index: 36; transform: translateX(-50%); max-width: min(720px, calc(100% - 48px)); padding: 10px 16px; border-radius: 12px; background: rgba(11,42,46,.92); color: #fff; font-size: 15px; line-height: 1.4; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); backdrop-filter: blur(6px); transition: opacity 200ms; }
.legenda[hidden] { display: none; }
.legenda.topo { bottom: auto; top: 22px; }
.legenda b { color: var(--teal-bright); font-weight: 600; }

/* ------------------------------------------------------------ abertura */
.abertura { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(900px 500px at 15% -10%, rgba(45,212,191,.28), transparent 60%), radial-gradient(700px 500px at 110% 110%, rgba(14,165,233,.18), transparent 60%), var(--dark); }
.abertura[hidden] { display: none; }
.abertura::before { content: ""; position: absolute; inset: 0; opacity: .12; background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%); pointer-events: none; }
.cartao { position: relative; width: min(640px, 100%); max-height: 100%; overflow: auto; padding: 32px 36px; border-radius: 20px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.marca { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.marca .selo { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--teal-bright); color: #06201f; font-weight: 800; font-size: 18px; box-shadow: 0 8px 20px rgba(45,212,191,.35); }
.marca b { display: block; font-size: 14px; }
.marca small { display: block; color: rgba(159,214,206,.9); font-size: 12px; margin-top: 2px; }
.cartao h1 { margin: 0 0 10px; font-size: 32px; letter-spacing: -.01em; }
.cartao .texto { margin: 0 0 20px; color: #c9e2de; font-size: 15px; line-height: 1.5; }
.atos { margin: 0 0 24px; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.atos li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #e6f0ee; }
.atos .n { flex: none; width: 22px; height: 22px; border-radius: 7px; background: rgba(45,212,191,.18); color: var(--teal-bright); font-family: "Geist Mono", Consolas, monospace; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.atos small { display: block; color: rgba(201,226,222,.7); font-size: 12px; margin-top: 1px; }
.acoes { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.duracao { color: rgba(201,226,222,.8); font-size: 13px; }
.nota { margin: 18px 0 0; color: rgba(201,226,222,.6); font-size: 12px; }

/* ------------------------------------------------------------ botões */
.botao { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; text-decoration: none; transition: background 150ms, transform 120ms; }
.botao:hover { background: rgba(255,255,255,.12); }
.botao:active { transform: translateY(1px); }
.botao:disabled { opacity: .4; cursor: default; }
.botao.primario { background: var(--teal-bright); color: #06201f; border-color: transparent; font-weight: 600; }
.botao.primario:hover { background: #5eead4; }
.botao.grande { height: 46px; padding: 0 22px; font-size: 15px; }
.botao.icone { width: 40px; padding: 0; }
.botao.icone .ic-pause { display: none; }
.botao.icone.tocando .ic-pause { display: block; }
.botao.icone.tocando .ic-play { display: none; }
.botao.icone#btn-play { width: 46px; background: var(--teal-bright); color: #06201f; border-color: transparent; }
.botao.icone#btn-play:hover { background: #5eead4; }

/* ------------------------------------------------------------ barra */
.barra { display: grid; grid-template-rows: 5px 58px 1fr; background: var(--dark); border-top: 1px solid rgba(255,255,255,.1); }
.progresso-trilho { background: rgba(255,255,255,.08); }
.progresso-feito { height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--teal-bright)); box-shadow: 0 0 12px rgba(45,212,191,.55); transition: width 600ms cubic-bezier(.2,.8,.2,1); }

.etapas { display: flex; gap: 6px; padding: 10px 16px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; scroll-behavior: smooth; }
.etapa { flex: none; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 8px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); color: rgba(201,226,222,.8); font: inherit; font-size: 12.5px; white-space: nowrap; cursor: pointer; transition: background 150ms, border-color 150ms; }
.etapa:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; }
.etapa:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 2px; }
.etapa .n { width: 22px; height: 22px; border-radius: 7px; background: rgba(255,255,255,.08); font-family: "Geist Mono", Consolas, monospace; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7); }
.etapa .ato { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: rgba(45,212,191,.75); margin-right: 2px; }
.etapa.feita { color: rgba(201,226,222,.55); }
.etapa.feita .n { background: rgba(45,212,191,.2); color: var(--teal-bright); }
.etapa.atual { background: rgba(45,212,191,.16); border-color: rgba(45,212,191,.5); color: #fff; box-shadow: 0 0 0 3px rgba(45,212,191,.12); }
.etapa.atual .n { background: var(--teal-bright); color: #06201f; }
.etapa.erro { border-color: rgba(225,29,72,.6); background: rgba(225,29,72,.14); color: #fff; }
.etapa.erro .n { background: var(--rose); color: #fff; }

.controles { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 10px 16px 14px; }
.botoes { display: flex; align-items: center; gap: 8px; }
.velocidade { display: inline-flex; margin-left: 8px; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.velocidade button { height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: rgba(201,226,222,.75); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.velocidade button.ativo { background: rgba(255,255,255,.14); color: #fff; }

.narracao { min-width: 0; }
.narracao .titulo { margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.narracao .detalhe { margin: 3px 0 0; font-size: 13px; color: rgba(201,226,222,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.narracao.erro .titulo { color: #fda4af; }

.situacao { text-align: right; }
.situacao p { margin: 0; }
.situacao .progresso { font-size: 13px; font-weight: 600; }
.situacao .perfil { font-size: 12px; color: rgba(201,226,222,.8); margin-top: 2px; }
.situacao .tempo { font-family: "Geist Mono", Consolas, monospace; font-size: 11.5px; color: rgba(201,226,222,.55); margin-top: 2px; }

/* ------------------------------------------------------------ estados */
.demo.pausada .legenda { opacity: .55; }
.demo.pausada .cursor { opacity: .6; }

@media (max-width: 900px) {
  .controles { grid-template-columns: auto 1fr; }
  .situacao { display: none; }
  .atos { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ visualizador */
.visor { position: absolute; inset: 0; z-index: 34; display: flex; align-items: center; justify-content: center; padding: 28px; background: rgba(7,26,28,.62); backdrop-filter: blur(3px); }
.visor[hidden] { display: none; }
.visor-caixa { display: grid; grid-template-rows: auto 1fr; width: min(1180px, 100%); height: 100%; border-radius: 16px; overflow: hidden; background: #fff; color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.45); animation: visor-entra 220ms ease-out; }
@keyframes visor-entra { from { transform: translateY(12px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.visor-cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fff; }
.visor-titulo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.visor-titulo b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visor-titulo small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.visor-tipo { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.visor-tipo:empty { display: none; }
.visor-acoes { display: flex; align-items: center; gap: 8px; }
.visor-acoes .botao { color: var(--ink); background: #fff; border-color: var(--border); }
.visor-acoes .botao:hover { background: var(--bg); }
.visor-acoes #visor-baixar { color: var(--teal); border-color: #99e6dc; background: var(--teal-soft); font-weight: 600; }
.visor-acoes #visor-baixar:hover { background: #d3f1ec; }
.visor-corpo { position: relative; background: #e9edf1; overflow: auto; display: flex; align-items: stretch; justify-content: center; }
.visor-corpo iframe { display: block; width: 100%; height: 100%; border: 0; background: #e9edf1; }
.visor-corpo img { max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; }
.visor-corpo pre { margin: 0; width: 100%; padding: 20px 24px; font-family: "Geist Mono", Consolas, monospace; font-size: 12.5px; line-height: 1.5; background: #fff; overflow: auto; }
.visor-aviso { margin: auto; max-width: 420px; padding: 28px; text-align: center; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.visor-aviso b { color: var(--ink); font-size: 15px; }
