:root {
  /* Cores da página de referência */
  --bg: #fdf8f2;
  --surface: #ffffff;
  --surface-2: #f6efe6;
  --border: rgba(0, 0, 0, 0.08);
  --text: #1a1f36;
  --muted: #6b7280;
  --primary: #e8823a;
  --primary-ink: #ffffff;
  --gradient-brand: linear-gradient(90deg, #f0a050, #d96b2c);
  --gradient-faded: linear-gradient(90deg, #f5b878, #e89252);
  --danger: #d64545;
  --ok: #1f9d63;
  --warn: #b7791f;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
img, video { max-width: 100%; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: rgba(253, 248, 242, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.navlink { color: var(--text); font-size: 0.95rem; }

main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 20px 16px 40px; }
.footer { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; padding: 20px 16px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--border); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.narrow { max-width: 460px; margin: 0 auto; }
.narrow-wide { max-width: 640px; margin: 0 auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.warn { color: var(--warn); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.grow { flex: 1; min-width: 0; }
.loading { color: var(--muted); text-align: center; padding: 60px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--gradient-brand); border-color: transparent; color: var(--primary-ink); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }

form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.field-label { font-weight: 600; font-size: 0.92rem; }
.hint { color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=datetime-local], input[type=time], input[type=number], textarea, select {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit;
}
.row select, .row input[type=search] { width: auto; flex: 1; min-width: 160px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.check input { margin-top: 4px; }

.notice { padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; border: 1px solid; font-size: 0.95rem; }
.notice-error { border-color: rgba(214, 69, 69, 0.4); background: rgba(214, 69, 69, 0.07); }
.notice-ok { border-color: rgba(31, 157, 99, 0.4); background: rgba(31, 157, 99, 0.07); }
.notice-info { border-color: var(--border); background: var(--surface-2); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: 0.2s; z-index: 50;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { border-color: var(--danger); }

/* Avatar no admin */
.avatar { display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-2); font-weight: 700; }
.avatar-lg { width: 80px; height: 80px; object-fit: cover; }
.cover-preview { width: 100%; max-height: 160px; object-fit: cover; border-radius: 10px; }

/* Pix */
.pix { display: flex; flex-direction: column; gap: 12px; }
.qr { width: 240px; height: 240px; margin: 0 auto; background: #fff; padding: 10px; border-radius: 12px; image-rendering: pixelated; }
.pix-code { font-family: ui-monospace, monospace; font-size: 0.8rem; resize: none; }
.pix-status { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); margin: 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Conteúdo */
.post-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.caption { white-space: pre-line; margin: 0 0 12px; }
.media-grid { display: grid; gap: 6px; }
.media-grid.n2 { grid-template-columns: 1fr 1fr; }
.media { width: 100%; border-radius: 10px; display: block; background: #000; }
.media-grid.n2 .media { aspect-ratio: 1; object-fit: cover; }
.media.missing { padding: 30px; text-align: center; color: var(--muted); }
img.media { user-select: none; -webkit-user-drag: none; }

/* Listas e selos */
.list { list-style: none; padding: 0; margin: 0 0 12px; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.badge { font-size: 0.78rem; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.badge-paid { color: var(--ok); border-color: rgba(31, 157, 99, 0.35); }
.badge-pending, .badge-creating { color: var(--warn); border-color: rgba(183, 121, 31, 0.35); }
.badge-failed, .badge-refunded { color: var(--danger); border-color: rgba(214, 69, 69, 0.35); }
.badge-expired { color: var(--muted); }

/* Admin */
.row.between { justify-content: space-between; }
.row .field { flex: 1; min-width: 120px; margin: 0; }
.row select, .row input[type=datetime-local], .row input[type=time], .row input[type=number] { width: auto; flex: 1; min-width: 140px; }
.thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.thumb-video { display: grid; place-items: center; color: var(--muted); }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.tab { padding: 8px 14px; border-radius: 999px; color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.tab.active { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats-grid .card { margin: 0; }
.stat-value { font-size: 1.5rem; font-weight: 800; }
.stat-label { color: var(--muted); font-size: 0.9rem; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; border-bottom: 1px solid var(--border); }
.bar-wrap { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar { width: 100%; min-height: 2px; background: var(--primary); border-radius: 4px 4px 0 0; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 6px; }
.terms section { margin-bottom: 14px; }
.terms p { color: var(--text); }

@media (max-width: 560px) {
  .nav { gap: 10px; }
  .navlink { font-size: 0.88rem; }
  .card { padding: 16px; }
}

/* ===== Página da modelo: copiada da página de referência (escopo .pv) ===== */
.pv { max-width: 42rem; margin: 0 auto; }
.pv-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); color: var(--text); }
.pv a.pv-card:hover { text-decoration: none; }
.pv .cover { height: 11rem; overflow: hidden; background: var(--gradient-faded); }
.pv .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv .avatar-row { padding: 0 1.25rem; margin-top: -3rem; display: flex; align-items: flex-end; justify-content: space-between; position: relative; }
.pv .avatar { width: 6rem; height: 6rem; border-radius: 9999px; border: 4px solid var(--surface); object-fit: cover; display: block; }
.pv .avatar-fallback { display: grid; place-items: center; background: var(--gradient-brand); color: #fff; font-size: 2.2rem; font-weight: 700; }
.pv .stats { display: flex; align-items: center; gap: 1rem; padding-bottom: 0.5rem; margin: 0; }
.pv .stat { display: flex; align-items: center; gap: 0.375rem; font-size: 0.875rem; color: var(--muted); }
.pv .stat svg { width: 1rem; height: 1rem; }
.pv .stat span { font-weight: 500; color: var(--text); }
.pv .profile-info { padding: 1rem 1.25rem 0; }
.pv .name-row { display: flex; align-items: center; gap: 0.375rem; }
.pv .name-row h2 { font-size: 1.125rem; font-weight: 700; margin: 0; }
.pv .verified { width: 1rem; height: 1rem; color: var(--primary); flex: none; }
.pv .verified-sm { width: 0.875rem; height: 0.875rem; color: var(--primary); display: inline-block; vertical-align: middle; }
.pv .handle { font-size: 0.875rem; color: var(--muted); margin: 0; }
.pv .bio { font-size: 0.875rem; line-height: 1.5; margin: 0.75rem 0 0; white-space: pre-line; text-align: left; }
.pv .bio.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pv .link-btn { color: var(--primary); font-weight: 500; background: none; border: 0; padding: 0; font: inherit; font-size: 0.875rem; cursor: pointer; }
.pv .section { padding: 1rem 1.25rem 0; display: flex; flex-direction: column; gap: 0.625rem; }
.pv .section h3 { font-size: 0.875rem; font-weight: 600; margin: 0; }
.pv .section.promos { padding-bottom: 1.25rem; }
.price-bar { width: 100%; display: flex; align-items: center; justify-content: space-between; border-radius: 9999px; padding: 0.875rem 1.25rem;
  color: #fff; font-weight: 600; font-size: 0.875rem; background: var(--gradient-brand); box-shadow: 0 1px 2px rgba(0,0,0,0.05); transition: transform 0.15s; border: 0; cursor: pointer; }
.price-bar:hover { transform: scale(1.01); text-decoration: none; }
.price-bar:active { transform: scale(0.99); }
.price-bar.faded { background: var(--gradient-faded); }
.pv .promo-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; font: inherit; font-size: 0.875rem; font-weight: 600;
  background: none; border: 0; padding: 0; color: inherit; cursor: pointer; }
.pv .promo-toggle svg { width: 1rem; height: 1rem; transition: transform 0.2s; }
.pv .promo-toggle.collapsed svg { transform: rotate(180deg); }
.pv .promo-list { display: flex; flex-direction: column; gap: 0.625rem; }
.pv .promo-list.hidden { display: none; }
.pv .tabs { border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; font-size: 0.875rem; font-weight: 500; margin: 0; padding: 0; overflow: visible; }
.pv .tab { padding: 0.875rem 0; display: flex; align-items: center; justify-content: center; gap: 0.5rem; color: var(--muted);
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer; }
.pv .tab svg { width: 1rem; height: 1rem; }
.pv .tab.active { color: var(--primary); border-bottom-color: var(--primary); background: none; }
.pv-locked-post { margin-top: 1.25rem; }
.pv .post-header { padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.pv .post-author { display: flex; align-items: center; gap: 0.75rem; }
.pv .post-avatar { width: 2.5rem; height: 2.5rem; border-radius: 9999px; object-fit: cover; display: grid; place-items: center; }
.pv .post-avatar.avatar-fallback { font-size: 1rem; }
.pv .post-name { display: flex; align-items: center; gap: 0.25rem; font-size: 0.875rem; font-weight: 600; }
.pv .icon-btn-plain { color: var(--muted); display: flex; }
.pv .icon-btn-plain svg { width: 1.25rem; height: 1.25rem; }
.pv .locked-media { margin: 0 1rem 1rem; aspect-ratio: 4 / 3; border-radius: 0.5rem; overflow: hidden; position: relative; background: var(--gradient-faded); }
.pv .locked-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(20px); transform: scale(1.1); }
.pv .lock-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem;
  background: rgba(0,0,0,0.2); color: #fff; text-align: center; padding: 0 1rem; }
.pv .lock-overlay svg { width: 2rem; height: 2rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }
.pv .lock-overlay p { font-size: 0.875rem; font-weight: 500; text-shadow: 0 1px 2px rgba(0,0,0,0.4); margin: 0; }
.pv .lock-overlay small { font-size: 0.78rem; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.pv .grid { margin-top: 1.25rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.375rem; }
.pv .tile { position: relative; aspect-ratio: 1 / 1; border-radius: 0.375rem; overflow: hidden; background: var(--gradient-faded); display: block; }
.pv .tile img { width: 100%; height: 100%; object-fit: cover; filter: blur(8px); transform: scale(1.1); }
.pv .tile-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.1); color: #fff; }
.pv .tile-lock svg { width: 1.5rem; height: 1.5rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }
.pv-empty { text-align: center; color: var(--muted); margin-top: 1.25rem; }

/* Escolha de plano na tela de assinar */
.plan-list { display: flex; flex-direction: column; gap: 0.625rem; margin-bottom: 16px; }
.price-bar.selected { outline: 3px solid rgba(232, 130, 58, 0.35); outline-offset: 2px; }
