@font-face { font-family: 'Fell'; src: url('/assets/fonts/im-fell-english-sc-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Plex'; font-weight: 400; src: url('/assets/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Plex'; font-weight: 500; src: url('/assets/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Plex'; font-weight: 600; src: url('/assets/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'PlexMono'; src: url('/assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-display: swap; }

:root {
  color-scheme: dark;
  --ink: #000;
  --bg: #050505;
  --panel: #0d0d0c;
  --panel-2: #151513;
  --line: #2a2926;
  --line-2: #45433d;
  --text: #ece8df;
  --muted: #9b968a;
  --faint: #6e6a60;
  --bone: #f3efe4;
  --ok: #8fbc8b;
  --warn: #d9b86a;
  --bad: #d9796a;
  --display: 'Fell', 'Times New Roman', serif;
  --sans: 'Plex', system-ui, sans-serif;
  --mono: 'PlexMono', ui-monospace, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; margin: 0; color: var(--bone); letter-spacing: .01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.stack-lg { display: grid; gap: 28px; }

/* Botões e formulários */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; background: transparent; border: 1px solid var(--line-2); color: var(--text); cursor: pointer; font-weight: 500; transition: background .15s, color .15s, border-color .15s; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--bone); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--bone); border-color: var(--bone); color: #0a0a09; }
.btn-primary:hover:not(:disabled) { background: #fff; }
.btn-danger { border-color: var(--bad); color: var(--bad); }
.btn-danger:hover:not(:disabled) { background: var(--bad); color: #140a08; border-color: var(--bad); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 17px; font-weight: 600; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; background: none; border: 0; color: var(--text); cursor: pointer; }
.icon-btn:hover { color: #fff; }
.badge { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; background: var(--bone); color: #000; font-size: 11px; font-weight: 600; line-height: 16px; text-align: center; border-radius: 8px; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; color: var(--muted); }
.field-hint { font-size: 12px; color: var(--faint); }
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) { width: 100%; min-height: 40px; padding: 8px 12px; background: var(--ink); border: 1px solid var(--line-2); color: var(--text); border-radius: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bone); }
textarea { min-height: 110px; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 8px; }
.check input { accent-color: var(--bone); width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* Selos */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--line-2); font-size: 12px; color: var(--muted); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--ok); border-color: #3e5240; }
.pill-warn { color: var(--warn); border-color: #5d5030; }
.pill-bad { color: var(--bad); border-color: #5e3a33; }

/* Estrutura da loja */
.site-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 10px var(--gutter); background: rgba(5, 5, 5, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 22px; color: var(--bone); }
.site-nav { display: flex; gap: 20px; }
.site-nav a { color: var(--muted); padding: 6px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a.on { color: var(--bone); border-bottom-color: var(--bone); }
.search { position: relative; flex: 1; max-width: 300px; margin-left: auto; }
.search svg { position: absolute; left: 10px; top: 10px; color: var(--faint); }
.search input { padding-left: 36px; }
.head-actions { display: flex; align-items: center; }
.menu-toggle { display: none; }
main { min-height: 62vh; }
.page { padding: 40px var(--gutter) 72px; max-width: 1240px; margin: 0 auto; }
.page-narrow { max-width: 760px; }
.page-title { font-size: clamp(32px, 5vw, 46px); margin-bottom: 8px; }
.site-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px var(--gutter); border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }

/* Abertura: a chamada vem primeiro; a ilustração é só fundo */
.hero { position: relative; display: flex; align-items: center; padding: 26px var(--gutter); overflow: hidden; background: #000; border-bottom: 1px solid var(--line); }
.hero-art { position: absolute; top: 0; right: 0; width: min(48%, 600px); height: 100%; object-fit: cover; object-position: 50% 14%; opacity: .38; pointer-events: none; -webkit-mask-image: linear-gradient(to right, transparent, #000 55%); mask-image: linear-gradient(to right, transparent, #000 55%); }
.hero-copy { position: relative; z-index: 1; width: 100%; max-width: 1144px; margin: 0 auto; }
.hero h1 { font-size: clamp(30px, 3.6vw, 44px); max-width: 26em; }
.hero-actions { margin-top: 16px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.hero-proof li { display: flex; align-items: center; gap: 6px; }

/* Catálogo */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 20px; flex-wrap: wrap; }
.section-head h2 { font-size: 30px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 32px; padding: 0 12px; background: none; border: 1px solid var(--line); color: var(--muted); cursor: pointer; }
.chip.on, .chip:hover { color: var(--bone); border-color: var(--bone); }
.grid-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.product { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.product:hover { border-color: var(--line-2); transform: translateY(-2px); }
.cover { position: relative; aspect-ratio: 16 / 6; overflow: hidden; background: #000; border-bottom: 1px solid var(--line); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-seal { position: absolute; inset: 0; display: grid; place-items: center; background-image: radial-gradient(#2c2b27 1px, transparent 1.2px); background-size: 6px 6px; }
.cover-seal span { display: grid; place-items: center; width: 58px; height: 58px; border: 1px solid var(--line-2); border-radius: 50%; background: #000; font: 26px var(--display); color: var(--muted); }
.cover-off { position: absolute; left: 10px; top: 10px; padding: 2px 8px; background: var(--bone); color: #000; font-size: 12px; font-weight: 600; }
.fav { position: absolute; right: 6px; top: 6px; z-index: 2; color: var(--muted); }
.row .fav { position: static; }
.fav.on { color: var(--bone); }
.fav.on svg { fill: currentColor; }
.product-body { display: flex; flex-direction: column; gap: 8px; padding: 14px; flex: 1; }
.product-name { font: 22px/1.15 var(--display); color: var(--bone); }
.product-tag { color: var(--muted); font-size: 14px; flex: 1; }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.price { font-size: 20px; font-weight: 600; color: var(--bone); }
.price-old { color: var(--faint); text-decoration: line-through; font-size: 13px; }
.price-from { color: var(--faint); font-size: 12px; width: 100%; }

/* Produto */
.detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 36px; align-items: start; }
.detail > .stack > .btn-lg { width: 100%; }
.detail-aside .cover { border: 1px solid var(--line); aspect-ratio: 16 / 7; }
.features { display: grid; gap: 8px; margin-top: 14px; }
.features li { display: flex; gap: 10px; align-items: flex-start; }
.features svg { flex: none; margin-top: 3px; }
.plans { display: grid; gap: 8px; }
.plan { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); cursor: pointer; }
.plan:has(input:checked) { border-color: var(--bone); background: var(--panel-2); }
.plan input { accent-color: var(--bone); }
.plan-main { flex: 1; min-width: 0; }

/* Painéis */
.card { background: var(--panel); border: 1px solid var(--line); padding: 18px; }
.card h2, .card h3 { font-size: 22px; margin-bottom: 10px; }
.auth-wrap { display: grid; place-items: center; padding: 56px 16px; }
.auth-card { width: min(420px, 100%); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--bone); border-bottom-color: var(--bone); }
.totals { display: grid; gap: 6px; margin: 12px 0; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 20px; color: var(--bone); font-weight: 600; padding-top: 8px; border-top: 1px solid var(--line); }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.cart-line { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cart-line input { width: 72px; }
.pix { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; }
.pix img { background: #fff; padding: 6px; width: 200px; height: 200px; }
.code-box { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: #000; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 13px; word-break: break-all; }
.code-box span { flex: 1; min-width: 0; }
.license { display: grid; gap: 10px; padding: 16px; background: var(--panel); border: 1px solid var(--line); }
.empty { padding: 44px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq p { margin-top: 8px; color: var(--muted); white-space: pre-wrap; }
.log-entry { padding: 18px 0; border-bottom: 1px solid var(--line); }
.log-entry h2 { font-size: 24px; }
.log-entry p { margin-top: 6px; color: var(--muted); white-space: pre-wrap; }
.messages { display: grid; gap: 10px; }
.msg { padding: 10px 14px; background: var(--panel-2); border-left: 2px solid var(--line-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-staff { border-left-color: var(--bone); }
.popover { position: absolute; right: var(--gutter); top: 60px; z-index: 30; width: min(340px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; background: var(--panel); border: 1px solid var(--line-2); padding: 12px; display: grid; gap: 10px; }

/* Tabelas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); background: var(--panel-2); white-space: nowrap; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }

/* Painel admin */
.admin { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.admin-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 16px 10px; background: #000; border-right: 1px solid var(--line); }
.admin-side .brand { padding: 4px 8px 14px; font-size: 20px; }
.admin-side a { padding: 7px 10px; color: var(--muted); border-left: 2px solid transparent; }
.admin-side a:hover { color: var(--bone); }
.admin-side a.on { color: var(--bone); border-left-color: var(--bone); background: var(--panel); }
.admin-main { padding: 26px clamp(16px, 3vw, 34px) 60px; min-width: 0; }
.admin-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-title h1 { font-size: 32px; flex: 1; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 180px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); padding: 14px; }
.kpi b { display: block; font: 30px/1.1 var(--display); color: var(--bone); margin-top: 4px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; }
.bars div { flex: 1; min-width: 3px; background: var(--bone); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--muted); }
.notice { padding: 12px 14px; border: 1px solid #5d5030; color: var(--warn); }
.plan-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto auto; gap: 8px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* Diálogos e avisos */
.modal { width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; background: var(--panel); border: 1px solid var(--line-2); color: var(--text); }
.modal-wide { width: min(860px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(0, 0, 0, .75); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 22px; }
.modal-body { padding: 18px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 10px 14px; background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--ok); }
.toast-err { border-left-color: var(--bad); }
.loading { padding: 60px; text-align: center; color: var(--faint); }

@media (max-width: 900px) {
  .hero-art { width: 72%; opacity: .22; }
  .btn-lg { width: 100%; }
  .detail, .cart-layout { grid-template-columns: 1fr; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line); }
  .site-nav.open { display: flex; }
  .menu-toggle { display: inline-grid; }
  .site-head { gap: 8px; flex-wrap: wrap; }
  .search { order: 5; flex: 1 0 100%; max-width: none; }
  .head-actions { margin-left: auto; }
  .admin { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-side .brand { width: 100%; padding-bottom: 6px; }
  .admin-side a { border-left: 0; }
  .plan-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .pix { grid-template-columns: 1fr; justify-items: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
#catalogo { padding-top: 24px; scroll-margin-top: 60px; }
