/* Layout: faixa de topo em degradê magenta → ameixa (cores da logomarca) com a logo num "adesivo" branco, cartões que sobem sobre a faixa, grade de artes e painel de decisão ao lado da arte ampliada. */
:root {
  color-scheme: light;
  --bg: #FBF5FA;
  --surface: #FFFFFF;
  --ink: #1D0A1B;
  --muted: #6B5568;
  --line: #EADCE8;
  --magenta: #C213B4;
  --magenta-deep: #A30E97;
  --plum: #6E0A68;
  --night: #16021A;
  --cream: #FFF3EA;
  --stage: #F4EAF3;
  --ok: #0F7B4B;
  --on-ok: #FFFFFF;
  --ok-soft: #DDF3E7;
  --chg: #B45309;
  --chg-soft: #FFEBD2;
  --pend-soft: #F6E4F4;
  --pend-ink: #7A0E70;
  --shadow: 0 8px 28px rgba(110, 10, 104, .10);
  --hero: linear-gradient(105deg, #C213B4 0%, #7B0B72 48%, #1A0319 100%);
  --display: "Gloock", Georgia, "Times New Roman", serif;
  --script: "Caveat Brush", "Segoe Print", "Comic Sans MS", cursive;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; }
body.locked { overflow: hidden; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; }

/* ---------- Faixa de topo ---------- */
.hero { position: relative; background: var(--hero); color: #fff; overflow: hidden; border-radius: 0 0 32px 32px; padding-top: env(safe-area-inset-top, 0px); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .2) 1.6px, transparent 1.9px); background-size: 15px 15px;
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 100%); mask-image: linear-gradient(100deg, transparent 30%, #000 100%); }
.hero-in { position: relative; max-width: 1120px; margin: 0 auto; padding: 34px var(--gutter-r) 68px var(--gutter-l); display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.logo-card { background: #fff; border-radius: 22px; padding: 14px 20px; box-shadow: 0 18px 42px rgba(0, 0, 0, .35); transform: rotate(-1.5deg); width: min(100%, 400px); justify-self: center; }
.logo-card img { display: block; width: 100%; height: auto; }
.hero-copy { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kicker { margin: 0; font-family: var(--script); font-size: 26px; line-height: 1; color: #FFC9F4; }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(34px, 6.4vw, 58px); line-height: 1.04; overflow-wrap: anywhere; }
.greet { margin: 4px 0 0; font-family: var(--script); font-size: clamp(26px, 4.4vw, 34px); line-height: 1.1; overflow-wrap: anywhere; }
.intro { margin: 0; max-width: 56ch; color: #F8E2F4; white-space: pre-wrap; overflow-wrap: anywhere; }
.bolt { position: absolute; pointer-events: none; fill: #FF63EA; opacity: .32; }
.bolt.b1 { width: 78px; left: 3%; bottom: -14px; transform: rotate(-14deg); }
.bolt.b2 { width: 54px; right: 5%; top: 14px; transform: rotate(20deg); }
.brandrow { grid-column: 1 / -1; display: flex; align-items: center; }
.brandrow img { display: block; height: 44px; width: auto; max-width: 70%; }
@media (min-width: 820px) {
  .hero-in { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; padding-block: 44px 76px; }
  .hero-in .logo-card { order: 2; justify-self: end; }
}

/* ---------- Corpo da página ---------- */
.wrap { position: relative; max-width: 1120px; margin: -34px auto 0; padding: 0 var(--gutter-r) max(56px, env(safe-area-inset-bottom, 0px)) var(--gutter-l); display: flex; flex-direction: column; gap: 22px; }
.wrap.plain { margin-top: 0; padding-top: 28px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow); min-width: 0; }
.step .n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--magenta); color: #fff; display: grid; place-items: center; font-family: var(--display); font-size: 18px; }
.step b { display: block; font-weight: 700; }
.step span { color: var(--muted); font-size: 14.5px; }

.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.pcard h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(22px, 4vw, 28px); line-height: 1.1; }
.pmsg { margin: 0; color: var(--muted); }
.bar { display: flex; height: 12px; border-radius: 6px; background: var(--pend-soft); overflow: hidden; }
.seg { display: block; height: 100%; width: 0; transition: width .4s ease; }
.seg.ok { background: var(--ok); }
.seg.chg { background: var(--chg); }
.counts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: 14px; }
.counts b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; }
.counts i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot-ok { background: var(--ok); } .dot-chg { background: var(--chg); } .dot-pend { background: var(--magenta); }
.pcard.done { background: var(--hero); border-color: transparent; color: #fff; }
.pcard.done .pmsg, .pcard.done .counts, .pcard.done .counts b { color: #fff; }
.pcard.done .bar { background: rgba(255, 255, 255, .25); }
.pcard.done .seg.ok { background: #fff; }

/* ---------- Botões e campos ---------- */
.btn { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 18px; font-weight: 700; min-height: 44px; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { border-color: var(--magenta); }
.btn.primary { background: var(--magenta); color: #fff; border-color: transparent; }
.btn.primary:hover { background: var(--magenta-deep); }
.btn.ok { background: var(--ok); color: var(--on-ok); border-color: transparent; }
.btn.ok:hover { filter: brightness(1.08); }
.btn.chg { background: var(--magenta); color: #fff; border-color: transparent; }
.btn.chg:hover { background: var(--magenta-deep); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.small { min-height: 36px; padding: 6px 13px; font-size: 13.5px; border-radius: 10px; }
.btn.light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn.light:hover { border-color: #fff; }
.danger { color: var(--chg); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
label, .lbl { font-size: 13px; font-weight: 700; color: var(--muted); }
.hintline { font-size: 12.5px; color: var(--muted); font-weight: 400; }
input[type="text"], input[type="password"], textarea { width: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; }
input:focus, textarea:focus { border-color: var(--magenta); outline: none; box-shadow: 0 0 0 3px rgba(194, 19, 180, .18); }
textarea { resize: vertical; min-height: 110px; }

/* ---------- Filtros e grade ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 15px; font-size: 14px; color: var(--muted); font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--plum); color: #fff; border-color: var(--plum); }
.chip span { font-variant-numeric: tabular-nums; opacity: .8; margin-left: 5px; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.card { display: flex; flex-direction: column; text-align: left; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; min-width: 0; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
button.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(110, 10, 104, .18); }
.tile { aspect-ratio: 1 / 1; background-color: var(--stage); background-image: radial-gradient(rgba(194, 19, 180, .10) 1.4px, transparent 1.7px); background-size: 16px 16px; display: grid; place-items: center; max-width: 100%; }
.tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile .miss { color: var(--muted); font-size: 13px; padding: 12px; text-align: center; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.card-title { font-weight: 700; font-size: 16.5px; overflow-wrap: anywhere; }
.card-go { font-size: 13.5px; font-weight: 700; color: var(--magenta-deep); }
.pill { display: inline-flex; align-self: flex-start; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--pend-soft); color: var(--pend-ink); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.approved { background: var(--ok-soft); color: var(--ok); }
.pill.changes { background: var(--chg-soft); color: var(--chg); }
.empty { margin: 0; padding: 44px 18px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 18px; background: var(--surface); }
.note { margin: 0; font-size: 14px; color: var(--muted); padding: 12px 14px; background: var(--pend-soft); border-radius: 12px; }
.err { margin: 0; color: #B42318; font-size: 14px; font-weight: 600; }
.okmsg { margin: 0; color: var(--ok); font-size: 14.5px; font-weight: 700; }
.quote { margin: 0; padding: 2px 0 2px 12px; border-left: 4px solid var(--magenta); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.foot { text-align: center; color: var(--muted); font-size: 13.5px; padding-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.foot img { display: block; width: 150px; height: auto; opacity: .9; }
.foot p { margin: 0; }
.foot b { color: var(--plum); }

/* ---------- Tela ampliada ---------- */
.modal { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; overflow-y: auto; }
.sheet { display: grid; grid-template-columns: 1fr; min-height: 100%; }
.stage { position: relative; background-color: var(--stage); background-image: radial-gradient(rgba(194, 19, 180, .12) 1.5px, transparent 1.8px); background-size: 18px 18px; display: grid; place-items: center; min-height: 48vh; padding: max(14px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 14px max(14px, env(safe-area-inset-left, 0px)); }
.stage img { max-width: 100%; max-height: 78vh; object-fit: contain; display: block; border-radius: 6px; box-shadow: 0 12px 36px rgba(60, 5, 58, .25); background: #fff; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 56px; border-radius: 14px; border: 0; background: var(--plum); color: #fff; font-size: 28px; line-height: 1; display: grid; place-items: center; padding: 0 0 3px; box-shadow: 0 6px 16px rgba(60, 5, 58, .3); }
.nav.prev { left: max(8px, env(safe-area-inset-left, 0px)); }
.nav.next { right: max(8px, env(safe-area-inset-right, 0px)); }
.nav:disabled { opacity: .3; cursor: default; }
.panel { background: var(--surface); padding: 18px var(--gutter-r) max(28px, env(safe-area-inset-bottom, 0px)) var(--gutter-l); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.x { width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--line); background: transparent; font-size: 24px; line-height: 1; }
.panel h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.1; overflow-wrap: anywhere; }
.last { margin: 0; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.last .quote { color: var(--ink); }
.form { display: flex; flex-direction: column; gap: 13px; padding: 16px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.ask { margin: 0; font-family: var(--display); font-size: 22px; line-height: 1.1; }
.script-label { font-family: var(--script); font-size: 24px; line-height: 1; color: var(--magenta-deep); font-weight: 400; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hist h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hist ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hist li { font-size: 14px; display: flex; flex-direction: column; gap: 3px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hist li:last-child { border-bottom: 0; }
.hist .who { color: var(--muted); }
.hist .txt { white-space: pre-wrap; overflow-wrap: anywhere; }

@media (min-width: 880px) {
  .sheet { grid-template-columns: minmax(0, 1fr) 400px; height: 100%; }
  .stage { min-height: 0; height: 100%; }
  .stage img { max-height: calc(100vh - 56px); }
  .panel { overflow-y: auto; height: 100%; padding-top: max(18px, env(safe-area-inset-top, 0px)); border-left: 1px solid var(--line); }
  .modal { overflow: hidden; }
}

/* ---------- Painel da designer ---------- */
.adminbar { background: var(--hero); color: #fff; padding-top: env(safe-area-inset-top, 0px); position: relative; overflow: hidden; }
.adminbar::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255, 255, 255, .18) 1.5px, transparent 1.8px); background-size: 14px 14px; -webkit-mask-image: linear-gradient(100deg, transparent 40%, #000 100%); mask-image: linear-gradient(100deg, transparent 40%, #000 100%); }
.adminbar-in { position: relative; max-width: 1120px; margin: 0 auto; padding: 14px var(--gutter-r) 14px var(--gutter-l); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.adminbar .brand { display: block; line-height: 0; }
.adminbar .brand img { display: block; height: 40px; width: auto; }
.adminbar .who { font-family: var(--script); font-size: 22px; color: #FFC9F4; margin-right: auto; padding-left: 8px; }
.login-wrap { min-height: 100vh; background: var(--hero); display: grid; place-items: center; padding: 24px var(--gutter-r) 24px var(--gutter-l); position: relative; overflow: hidden; }
.login-wrap::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255, 255, 255, .16) 1.6px, transparent 1.9px); background-size: 15px 15px; }
.login { position: relative; width: min(100%, 400px); display: flex; flex-direction: column; gap: 14px; background: var(--surface); border-radius: 24px; padding: 26px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }
.login img { width: 72%; height: auto; display: block; margin: 4px auto 0; }
.login h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; text-align: center; }
.login p.sub { margin: 0; text-align: center; color: var(--muted); font-size: 14.5px; }
.pagehead h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 5vw, 44px); line-height: 1.05; overflow-wrap: anywhere; }
.pagehead p { margin: 4px 0 0; color: var(--muted); }
.wrap h2.sec { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; }
.panelbox { display: grid; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.panelbox .full { grid-column: 1 / -1; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.plist { display: flex; flex-direction: column; gap: 12px; }
.proj { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .18s ease; }
.proj:hover { transform: translateY(-2px); border-color: var(--magenta); }
.proj .t { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.proj .t b { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.proj .t span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.proj .c { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbox { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; background: var(--pend-soft); border-radius: 16px; }
.linkbox code { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; font-size: 14px; user-select: all; background: #fff; padding: 8px 12px; border-radius: 10px; }
.acard .card-body input[type="text"] { padding: 8px 11px; }
.acard details { font-size: 14px; }
.acard summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.acard .hist { margin-top: 8px; }
.acard .row { gap: 8px; }
.back { color: var(--plum); text-decoration: none; font-size: 14.5px; font-weight: 700; }
.back:hover { color: var(--magenta); }

@media (prefers-reduced-motion: reduce) { .seg, .card, .proj { transition: none; } button.card:hover, .proj:hover { transform: none; } }
