/* Conta, assinatura, sugestões e painel admin. Usa as cores do app (index.html). */
html.gated body > main { visibility: hidden; }

.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; overflow: auto; background: var(--mat); }
.gate[hidden], .acct[hidden] { display: none; }
.gcard { width: min(420px, 100%); display: grid; gap: 16px; padding: 24px; background: var(--panel); border: 1px solid rgba(242, 201, 76, .45); border-radius: 12px; }
.gcard h2 { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.gcard .logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 750; }
.gcard .logo svg { width: 26px; height: 26px; }
.gcard p { color: var(--ink-dim); text-wrap: pretty; }
.gcard .bad { color: var(--danger); }
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 8px 16px; border: 0; border-radius: 8px; background: var(--yellow); color: var(--yellow-ink); font-weight: 700; font-size: 16px; }
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.alt { background: transparent; color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--field-line); }
.btn.sm { min-height: 44px; font-size: 14px; }
.price { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; background: var(--field); border: 1px solid rgba(242, 201, 76, .45); border-radius: 8px; }
.price b { font-size: 34px; line-height: 1; color: var(--yellow); letter-spacing: -.02em; }
.price span { color: var(--ink-dim); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-dim); min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pix { display: grid; gap: 12px; justify-items: center; }
.pix img { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; image-rendering: pixelated; }
.pix textarea { width: 100%; height: 64px; resize: none; font: 12px/1.3 ui-monospace, monospace; color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: 6px; padding: 8px; }
.wait { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); font-size: 13px; }
.wait i { width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.ava { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--yellow-ink); font-weight: 700; font-size: 14px; object-fit: cover; }

/* botão de conta + menu */
.acct { position: fixed; z-index: 20; top: 12px; right: 14px; }
.acct > button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 2px solid var(--field-line); border-radius: 50%; background: var(--field); }
.acct > button:hover { border-color: var(--yellow); }
.acct .ava { width: 36px; height: 36px; }
.menu { position: absolute; right: 0; top: 52px; width: 272px; display: grid; gap: 2px; padding: 8px; background: var(--panel); border: 1px solid var(--field-line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.menu[hidden] { display: none; }
.menu .head { padding: 8px 10px 10px; border-bottom: 1px solid var(--field-line); margin-bottom: 4px; display: grid; gap: 2px; }
.menu .head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu .head small { color: var(--ink-dim); }
.menu .head small.warn { color: var(--yellow); }
.menu button { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: none; border: 0; border-radius: 6px; color: var(--ink); text-align: left; }
.menu button:hover { background: rgba(242, 201, 76, .12); }
.menu .ico { color: var(--yellow); }
@media (max-width: 820px) { .acct { top: 8px; right: 8px; } .acct > button { width: 40px; height: 40px; } .acct .ava { width: 32px; height: 32px; } }

/* janelas (sugestões e admin) */
dialog.win { width: min(1080px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; color: var(--ink); background: var(--panel); border: 1px solid rgba(242, 201, 76, .45); border-radius: 12px; overflow: hidden; }
dialog.win.narrow { width: min(560px, calc(100% - 24px)); }
dialog.win::backdrop { background: rgba(5, 25, 19, .72); }
dialog.win[open] { display: flex; flex-direction: column; }
.wh { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--field-line); }
.wh h2 { font-size: 18px; font-weight: 700; }
.x { min-width: 44px; min-height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 6px; color: var(--ink-dim); font-size: 22px; }
.x:hover { color: var(--ink); background: rgba(242, 201, 76, .12); }
.wb { overflow: auto; padding: 16px; display: grid; gap: 16px; align-content: start; }
.tabs2 { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--field-line); overflow-x: auto; }
.tabs2 button { min-height: 44px; padding: 8px 14px; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--ink-dim); font-size: 14px; white-space: nowrap; }
.tabs2 button[aria-selected=true] { color: var(--yellow); border-bottom-color: var(--yellow); font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.stat { padding: 10px 12px; background: var(--field); border: 1px solid var(--field-line); border-radius: 8px; display: grid; gap: 2px; }
.stat b { font-size: 24px; line-height: 1.1; color: var(--yellow); letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--ink-dim); }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bar input, .bar select, .wb textarea, .wb input[type=text], .wb input[type=number], .wb input[type=date], .wb input[type=email] {
  font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: 6px; padding: 8px 10px; min-height: 44px; }
.bar input[type=search] { flex: 1; min-width: 160px; }
.wb textarea { width: 100%; min-height: 110px; resize: vertical; }
.tw { overflow-x: auto; border: 1px solid var(--field-line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid rgba(61, 151, 121, .35); }
th { color: var(--ink-dim); font-weight: 600; font-size: 12px; background: var(--field); position: sticky; top: 0; }
td.n, th.n { text-align: right; }
tr.urow { cursor: pointer; }
tr.urow:hover td { background: rgba(242, 201, 76, .07); }
tr.det td { white-space: normal; background: var(--field); }
.det .acts { align-items: center; }
.det label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-dim); }
.det input { width: 110px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; border: 1px solid var(--field-line); color: var(--ink-dim); }
.tag.ok { color: #8be0b0; border-color: #3d9779; }
.tag.late { color: var(--yellow); border-color: rgba(242, 201, 76, .6); }
.tag.off { color: var(--danger); border-color: var(--danger); }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #8be0b0; }
.mini { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mini .ava { width: 26px; height: 26px; font-size: 12px; }
.mini span { overflow: hidden; text-overflow: ellipsis; }
.hbar { height: 10px; min-width: 2px; border-radius: 3px; background: var(--yellow); }
.sug { padding: 12px; background: var(--field); border: 1px solid var(--field-line); border-radius: 8px; display: grid; gap: 8px; }
.sug p { color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.sug small { color: var(--ink-dim); }
.sug .acts { align-items: center; }
.empty { padding: 24px; text-align: center; color: var(--ink-dim); }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 84px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 8px; background: var(--yellow); color: var(--yellow-ink); font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.bar select { width: auto; }
.gcard .legal { font-size: 12px; text-align: center; }
.gcard .legal a { color: var(--yellow); }
.wh, .tabs2 { flex: none; }   /* cabeçalho e abas nunca encolhem; só o conteúdo rola */
.tabs2 button { flex: none; }
.wb { grid-auto-rows: max-content; }   /* as tabelas mantêm a altura natural; quem rola é a janela */

/* pagamento: estados */
.pix .hint { text-align: center; }
.pix .btn { width: 100%; }
.pix .bad, #pixbox > .bad { text-align: center; }
#pixbox { display: grid; gap: 12px; }
.done { display: grid; justify-items: center; gap: 10px; padding: 12px 0; text-align: center; }
.done svg { width: 56px; height: 56px; fill: none; stroke: var(--yellow); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.done circle { stroke-dasharray: 63; stroke-dashoffset: 63; animation: draw .5s cubic-bezier(.16, 1, .3, 1) forwards; }
.done path { stroke-dasharray: 16; stroke-dashoffset: 16; animation: draw .35s .3s cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.gcard h2:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { .wait i { animation: none; } .done circle, .done path { animation: none; stroke-dashoffset: 0; } }

/* celular: o caminho é copiar e colar no app do banco; o QR só serve para outro aparelho */
.gate { display: flex; min-height: 100dvh; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
.gcard { margin: auto; }   /* centraliza sem cortar o topo quando o cartão passa da altura da tela */
.pix textarea { height: 88px; overflow-wrap: anywhere; font-size: 13px; }
.pix img { width: 200px; height: 200px; }
.gcard .legal { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 4px; margin-top: -8px; }
.gcard .legal a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
@media (pointer: coarse) { .pix img, .qrhint { display: none; } }
@media (max-width: 480px) {
  .gate { padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  .gcard { padding: 18px 16px; gap: 12px; }
  .gcard h2 { font-size: 20px; }
  .pix { gap: 10px; }
  .pix img { width: 160px; height: 160px; }
  .price b { font-size: 30px; }
}

/* ---------- porta de entrada: a mesa de corte do app ---------- */
.gate {   /* grade da base de corte: o mesmo instrumento do app, 1 cm = 24 px */
  background:
    linear-gradient(var(--mat-major) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, var(--mat-major) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(var(--mat-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--mat-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--mat);
}
.stage { width: min(1060px, 100%); margin: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: clamp(24px, 5vw, 72px); align-items: center; }
.sheetbox { margin: 0; display: grid; gap: 10px; justify-items: center; }
.sheetbox svg { width: min(100%, 440px); max-height: 82dvh; height: auto; overflow: visible; }
.sheetbox .now { display: none; }
.sheet { fill: #fff; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .35)); }
.edge { fill: none; stroke: #1b2a24; stroke-width: .6; }
.cota { fill: none; stroke: var(--yellow); stroke-width: 1.1; stroke-linecap: round; stroke-dasharray: 1; }
.dt { fill: var(--yellow); font: 700 10px ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-anchor: middle; letter-spacing: .02em; }

/* cenas: só a ativa aparece; ao ativar, as animações recomeçam do zero */
.sc { display: none; }
.sc.on { display: inline; animation: cena .25s ease-out both; }
@keyframes cena { from { opacity: 0; } }
.sc.on .cota { animation: trace .8s cubic-bezier(.16, 1, .3, 1) both; }
.sc.on .dt { animation: fade .5s .3s both; }
@keyframes trace { from { stroke-dashoffset: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.94); } }
@keyframes gone { to { opacity: 0; } }

/* 1: a arte vira a folha cheia, depois redonda */
.stamp { animation: stamp .6s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(.9s + var(--i) * .09s); }
@keyframes stamp { from { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(1.5); } }
.sc.on .src { animation: fade .5s both, gone .35s .85s forwards; }
.sc.on .srct { animation: fade .3s .2s both, gone .3s .8s forwards; }
.sc.on .rv { animation: gone .4s 2.5s forwards; }
.sc.on .ro { animation: fade .45s 2.55s both; }
.sc.on .ta { animation: fade .3s .2s both, gone .3s 2.4s forwards; }
.sc.on .tb { animation: fade .3s 2.6s both; }
.sc.on .late { animation-delay: 2s; }

/* 2: fotos em ordem */
.sc.on .pop { animation: rise .45s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(.2s + var(--i) * .38s); }
.num { fill: #fff; stroke: #1b2a24; stroke-width: .6; }
.nt { fill: #1b2a24; font: 700 10px ui-monospace, Menlo, Consolas, monospace; text-anchor: middle; }

/* 3: polaroids */
.sc.on .fly { animation: fly .7s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(.15s + var(--i) * .16s); }
@keyframes fly { from { opacity: 0; transform: translateY(-90px) rotate(-14deg); } }
.pcard { fill: #fff; stroke: #1b2a24; stroke-width: .7; }
.sc.on .pcard { animation: tint .5s both; animation-delay: calc(1.9s + var(--i) * .22s); }
@keyframes tint { to { fill: var(--c); } }

/* 4 e 5: molde de caixa */
.flap { fill: #eef2ef; stroke: #1b2a24; stroke-width: .8; }
.cut { fill: none; stroke: #1b2a24; stroke-width: .9; }
.fold { fill: none; stroke: #1b2a24; stroke-width: .8; stroke-dasharray: 1; opacity: .75; }
.sc.on .fold { animation: trace .9s .3s cubic-bezier(.16, 1, .3, 1) both; }
.sc.on .npanel { animation: rise .5s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(.3s + var(--i) * .3s); }
.margem { fill: none; stroke: var(--mat); stroke-width: 1; stroke-dasharray: 5 4; opacity: .85; }
.sc.on .grow { animation: grow 1.5s .6s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes grow { from { transform: scale(.82); } to { transform: scale(1.14); } }
.sc[data-s="5"].on .npanel { animation: none; }
.sc.on .ta5 { animation: fade .3s .1s both, gone .3s 1.5s forwards; }
.sc.on .tb5 { animation: fade .4s 2.1s both; }

/* 6: PDF */
.sc.on .lq { animation: rise .4s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(.05s + var(--i) * .05s); }
.reg { fill: none; stroke: var(--yellow); stroke-width: 1; stroke-dasharray: 1; }
.sc.on .reg { animation: trace 1.2s .8s cubic-bezier(.16, 1, .3, 1) both; }
.badge rect { fill: var(--yellow); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); }
.badge path { fill: none; stroke: var(--yellow-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.badge text { fill: var(--yellow-ink); font: 800 17px system-ui, sans-serif; text-anchor: middle; }
.sc.on .badge { animation: badge .6s 1.7s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes badge { from { opacity: 0; transform: translateY(24px) scale(.9); } }

/* legendas sincronizadas com as cenas */
.gate.wide .gcard { background: none; border: 0; padding: 0; gap: 16px; width: 100%; }
.gate.wide .gcard h2 { font-size: clamp(30px, 4.2vw, 44px); line-height: 1.04; font-weight: 800; letter-spacing: -.03em; text-wrap: balance; }
.caps { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.caps li { position: relative; padding: 6px 0 8px 28px; color: var(--ink-dim); font-size: 16px; line-height: 1.25; transition: color .3s; }
.caps li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 16px; height: 2px; background: rgba(242, 201, 76, .35); transition: background .3s, width .3s; }
.caps li::after { content: ""; position: absolute; left: 28px; right: 0; bottom: 2px; height: 2px; background: var(--yellow); transform: scaleX(0); transform-origin: left; opacity: .7; }
.caps li.on { color: var(--ink); font-weight: 600; }
.caps li.on::before { background: var(--yellow); width: 20px; }
.caps li.on::after { animation: prog 4.8s linear forwards; }
@keyframes prog { to { transform: scaleX(1); } }
.buy { display: grid; gap: 12px; padding: 14px; background: rgba(12, 47, 36, .78); border: 1px solid rgba(242, 201, 76, .45); border-radius: 12px; }
.buy .price { padding: 0; background: none; border: 0; }
.buy .price b { font-size: 26px; }
@media (max-width: 820px) {
  .stage { grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
  .sheetbox svg { width: auto; height: 236px; max-height: none; }
  .sheetbox .now { display: block; min-height: 1.4em; font: 700 13px system-ui, sans-serif; color: var(--ink); text-align: center; }
  .caps { display: none; }
  .gate.wide .gcard h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .sc.on, .sc.on * { animation: none !important; }
  .sc .cota, .sc .fold, .sc .reg { stroke-dashoffset: 0; }
  .sc .pop, .sc .fly, .sc .npanel, .sc .lq, .sc .badge, .sc .ro, .sc .tb, .sc .tb5 { opacity: 1; }
  .caps li.on::after { display: none; }
}

/* etapa 4: hierarquia e textos */
.gcard .logo { font-size: 16px; }
.gcard .logo svg { width: 22px; height: 22px; }
.gcard h2 { font-size: 24px; }   /* o título manda; a marca é secundária */
.gate.wide .gcard h2 { font-size: clamp(30px, 4.2vw, 46px); }
.who span { white-space: normal; overflow-wrap: anywhere; }   /* e-mail longo quebra em vez de perder o domínio */
.gcard .wait { justify-content: center; padding: 8px 0; }
.btn.quiet { min-height: 44px; background: none; box-shadow: none; color: var(--ink-dim); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn.quiet:hover { color: var(--ink); filter: none; }
.pix .hint a, .gcard a:not(.btn) { color: var(--yellow); }
a.btn { text-decoration: none; }
@media (max-width: 820px) { .gate.wide .gcard h2 { font-size: 28px; } }

@media (max-width: 820px) { .sheetbox .dt { display: none; } }   /* texto monoespaçado fica ilegível em tela pequena; a legenda abaixo já diz o que acontece */
