@font-face { font-family: "CDG Inter Tight"; src: url("fontes/cdg-inter-tight.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "CDG Inter"; src: url("fontes/cdg-inter.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
/* CDG Estúdio · mesma camada visual do tema da loja: branco, cinza neutro, magenta da marca nos CTAs */
:root {
  --m: #c92c93; --m-dark: #8e1b66; --m-soft: #f9e4f1; --ink: #111; --bg: #fff; --surface: #f5f5f5;
  --line: #e5e5e5; --muted: #707070; --ok: #1d7a4b; --warn: #b4232c;
  --font: "CDG Inter", "Inter", system-ui, -apple-system, sans-serif; --font-head: "CDG Inter Tight", "Inter Tight", "CDG Inter", system-ui, sans-serif;
  --r: 6px; --pad: 16px; --ease: cubic-bezier(.22, .8, .24, 1);
}
@media (min-width: 750px) { :root { --pad: 24px; } }
* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased; overflow-x: clip; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--m); outline-offset: 3px; border-radius: 6px; }
h1, h2, p { margin: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.topo { position: sticky; top: 0; z-index: 10; background: var(--m); color: #fff; padding-top: env(safe-area-inset-top); }
.topo__in { max-width: 1100px; margin: 0 auto; padding: 0 var(--pad); height: 60px; display: flex; align-items: center; gap: 12px; }
.topo__logo { width: 64px; height: auto; filter: brightness(0) invert(1); }
.topo__nome { font-family: var(--font-head); font-weight: 500; font-size: 15px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .45); line-height: 1.2; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 var(--pad); }
.intro { padding: 32px 0 8px; max-width: 640px; }
.intro h1 { font-family: var(--font-head); font-weight: 600; font-size: clamp(26px, 6.4vw, 40px); line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; }
.intro p { margin-top: 12px; color: #3a3a3a; text-wrap: pretty; }

.passo { margin-top: 36px; }
.passo h2 { font-family: var(--font-head); font-weight: 600; font-size: 19px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.passo__n { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; display: grid; place-items: center; flex: none; letter-spacing: 0; }
.passo__cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.passo__cab h2 { margin-bottom: 4px; }
.passo__dica { color: var(--muted); font-size: 14px; margin-bottom: 14px; text-wrap: pretty; }
.lnk { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.lnk:hover { color: var(--ink); }

/* fundos */
.fundos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 750px) { .fundos { grid-template-columns: repeat(5, 1fr); } }
.fundo { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; background: var(--surface); outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .2s var(--ease); }
.fundo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fundo[aria-checked="true"] { outline-color: var(--m); }
.fundo__nome { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 7px; font-size: 12px; font-weight: 500; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); line-height: 1.25; }
.fundo__ok { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--m); color: #fff; display: none; place-items: center; }
.fundo__ok svg { width: 14px; height: 14px; stroke-width: 2.4; }
.fundo[aria-checked="true"] .fundo__ok { display: grid; }
.fundo--novo { display: grid; place-items: center; align-content: center; gap: 6px; border: 1.5px dashed #cfcfcf; background: #fff; color: var(--muted); font-size: 13px; padding: 8px; text-align: center; line-height: 1.3; }
.fundo--novo svg { width: 22px; height: 22px; }
.fundo--novo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* upload */
.drop { position: relative; display: grid; justify-items: center; gap: 4px; padding: 36px 20px; border: 1.5px dashed #cfcfcf; border-radius: var(--r); background: var(--surface); text-align: center; cursor: pointer; transition: border-color .2s var(--ease), background .2s var(--ease); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop__i { width: 30px; height: 30px; color: var(--m); margin-bottom: 6px; }
.drop strong { font-weight: 600; }
.drop__dica { color: var(--muted); font-size: 14px; text-wrap: balance; }
.drop.is-over { border-color: var(--m); background: var(--m-soft); }
.aviso { margin-top: 12px; padding: 12px 14px; border-radius: var(--r); background: #fff6e0; color: #6b4b00; font-size: 14px; }

/* resultados */
.grade { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 750px) { .grade { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.item { display: grid; gap: 8px; }
.item__foto { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; background: #2b2b2d; width: 100%; display: block; }
.item__foto canvas, .item__foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item__estado { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; color: #fff; font-size: 13px; text-align: center; padding: 12px; background: rgba(20, 20, 22, .55); }
.item__barra { width: 70%; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.item__barra i { display: block; height: 100%; width: 0; background: var(--m); transition: width .3s var(--ease); }
.item__erro { background: rgba(120, 10, 20, .75); }
.item__rodape { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.item__nome { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.item__acoes { display: flex; gap: 2px; flex: none; }
.ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
.ico:hover { background: var(--surface); }
.ico svg { width: 19px; height: 19px; }
.ico:disabled { opacity: .3; cursor: default; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--r); background: var(--m); color: #fff; font-weight: 600; font-size: 15px; transition: background .2s var(--ease), transform .12s var(--ease); }
.btn:hover { background: var(--m-dark); }
.btn:active { transform: scale(.98); }
.btn:disabled { background: #d9d9d9; color: #888; cursor: default; transform: none; }
.btn--linha { background: #fff; color: var(--m); box-shadow: inset 0 0 0 1.5px var(--m); }
.btn--linha:hover { background: var(--m-soft); }

.barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(8px); }
.barra__in { max-width: 1100px; margin: 0 auto; padding: 12px var(--pad); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.barra__txt { font-size: 14px; color: var(--muted); }
.barra .btn { flex: none; }

/* editor */
.editor { border: 0; padding: 0; margin: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; background: #fff; color: var(--ink); }
.editor::backdrop { background: rgba(0, 0, 0, .5); }
.editor__in { height: 100%; display: flex; flex-direction: column; }
.editor__cab { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px var(--pad); border-bottom: 1px solid var(--line); padding-top: calc(8px + env(safe-area-inset-top)); }
.editor__cab h2 { font-family: var(--font-head); font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.fechar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.fechar:hover { background: var(--surface); }
.fechar svg { width: 22px; height: 22px; }
.editor__corpo { flex: 1; min-height: 0; overflow: auto; display: grid; gap: 16px; padding: 16px var(--pad) calc(16px + env(safe-area-inset-bottom)); align-content: start; }
.editor__palco { display: grid; justify-items: center; gap: 6px; }
.editor__palco canvas { width: auto; height: auto; max-width: 100%; max-height: 50vh; aspect-ratio: 3 / 4; border-radius: var(--r); touch-action: none; cursor: grab; background: #2b2b2d; }
.editor__palco canvas.is-drag { cursor: grabbing; }
.editor__dica { font-size: 13px; color: var(--muted); }
.editor__ctrl { display: grid; gap: 18px; align-content: start; }
.ctrl { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.ctrl input[type=range] { width: 100%; accent-color: var(--m); height: 28px; }
.ctrl--check { display: flex; align-items: center; gap: 10px; }
.ctrl--check input { width: 20px; height: 20px; accent-color: var(--m); }
.editor__acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.editor__acoes .btn { padding: 0 12px; font-size: 14px; }
@media (min-width: 900px) {
  .editor { width: min(1040px, 94vw); height: min(760px, 92vh); border-radius: 10px; margin: auto; }
  .editor__corpo { grid-template-columns: 1fr 300px; overflow: hidden; }
  .editor__palco canvas { max-height: calc(min(760px, 92vh) - 130px); }
}
