/* Site (início, cadastro, painel e admin). */
:root {
  --cream: #f7f0e9;
  --paper: #ffffff;
  --ink: #3a2a22;
  --ink-soft: #6f5a4e;
  --line: #e6d9cd;
  --brand: #b8471a;
  --brand-dark: #8f3610;
  --brand-tint: #f6e3d8;
  --ok: #24663b;
  --ok-bg: #e3f2e8;
  --err: #9b2226;
  --err-bg: #fbe6e6;
  --info: #7a4a12;
  --info-bg: #fbefd9;
  --radius: 16px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body.site {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand-dark); text-underline-offset: 3px; }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid #e58a5c; outline-offset: 2px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 480px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 48px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; color: #7a2f12; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.center { text-align: center; }

/* Cabeçalho e rodapé */
.site-head { background: var(--paper); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; color: #7a2f12; text-decoration: none; letter-spacing: .01em; }
.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav form { margin: 0; }
.nav a.link { padding: 8px 12px; text-decoration: none; color: var(--ink); font-weight: 500; border-radius: 999px; }
.nav a.link:hover { background: var(--brand-tint); }

.site-foot { border-top: 1px solid var(--line); background: var(--paper); padding: 22px 0; font-size: .88rem; color: var(--ink-soft); }
.site-foot .wrap { display: flex; gap: 8px 20px; justify-content: space-between; flex-wrap: wrap; }
.site-foot a { color: var(--ink-soft); }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 2px solid var(--brand);
  background: var(--brand); color: #fff; font: 500 1rem var(--sans); text-decoration: none; cursor: pointer;
  min-height: 46px; line-height: 1.2;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand-dark); }
.btn-ghost:hover { background: var(--brand-tint); color: var(--brand-dark); }
.btn-danger { background: var(--err); border-color: var(--err); }
.btn-danger:hover { background: #7a1a1d; border-color: #7a1a1d; }
.btn-small { padding: 7px 14px; min-height: 36px; font-size: .9rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Mensagens */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--err-bg); color: var(--err); }
.flash-info { background: var(--info-bg); color: var(--info); }
ul.errors { margin: 0 0 16px; padding: 12px 16px 12px 34px; background: var(--err-bg); color: var(--err); border-radius: 12px; }

/* Formulários */
.box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field label, .field .lbl { display: block; font-weight: 500; margin-bottom: 6px; }
.field .hint { display: block; font-size: .85rem; color: var(--ink-soft); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid #d8c8ba; border-radius: 12px; background: #fff;
  font: 400 1rem var(--sans); color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 3px solid rgba(184, 71, 26, .2); }
input[type="file"] { width: 100%; font: 400 .95rem var(--sans); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; }
.checkbox input { margin-top: 5px; width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.inline-form { display: inline; margin: 0; }
.row { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .row.two { grid-template-columns: 1fr 1fr; } }
.slug-input { display: flex; align-items: stretch; }
.slug-input span { display: inline-flex; align-items: center; padding: 0 12px; background: var(--brand-tint); border: 1.5px solid #d8c8ba; border-right: 0; border-radius: 12px 0 0 12px; color: var(--ink-soft); font-size: .88rem; white-space: nowrap; }
.slug-input input { border-radius: 0 12px 12px 0; }
.slug-msg { margin: 7px 0 0; min-height: 1.3em; font-size: .88rem; }
.slug-msg.ok { color: var(--ok); }
.slug-msg.bad { color: var(--err); }

/* Landing */
.hero { display: grid; gap: 32px; align-items: center; padding: 8px 0 32px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.1fr .9fr; } }
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 34em; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.hero-slugcheck { margin-top: 16px; max-width: 380px; }
.hero-slugcheck .slug-input input { text-transform: lowercase; }
.hero-slugcheck-msg { margin: 7px 0 0; min-height: 1.3em; font-size: .88rem; }
.hero-slugcheck-msg.ok { color: var(--ok); }
.hero-slugcheck-msg.bad { color: var(--err); }
.hero-slugcheck-cta { margin-top: 10px; }
.phone { width: 100%; max-width: 300px; margin: 0 auto; border: 9px solid #2b201b; border-radius: 38px; overflow: hidden; box-shadow: 0 22px 44px rgba(60, 30, 15, .28); }
.phone .lp-demo { padding: 24px 12px 18px; background-color: var(--bg2); background-image: linear-gradient(170deg, var(--bg1), var(--bg2)); color: var(--title); font-family: var(--sans); }
.mini-demo { font-size: .8rem; }
.mini-demo .lp-name { font-size: 1.6rem; }
.mini-demo .lp-prof { font-size: .68rem; margin-top: 6px; }
.mini-demo .lp-head { margin-bottom: 16px; }
.mini-demo .lp-card { min-height: 78px; border-radius: 16px; }
.mini-demo .lp-title { font-size: 1.15rem; }
.mini-demo .lp-desc { font-size: .68rem; }
.mini-demo .lp-label { font-size: .55rem; }
.mini-demo .lp-card-text { padding: 12px 14px; }
.mini-demo .lp-cards { gap: 9px; }
.mini-demo .lp-media .shape { position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.55), rgba(0,0,0,.08)); }
.features { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 12px 0 36px; }
@media (min-width: 720px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature h3 { margin-bottom: .3em; }
.plans { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 36px; }
@media (min-width: 720px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px; }
.plan.featured { border-color: var(--brand); box-shadow: 0 10px 28px rgba(184, 71, 26, .14); }
.plan ul { padding-left: 1.2em; margin: 12px 0 0; }
.plan li { margin-bottom: 6px; }
.tag { display: inline-block; background: var(--brand-tint); color: var(--brand-dark); font-weight: 500; font-size: .8rem; padding: 3px 12px; border-radius: 999px; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq details p { margin: 10px 0 0; color: var(--ink-soft); }

/* Painel */
.panel-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.plan-banner { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; justify-content: space-between; }
.plan-banner.paid { background: var(--ok-bg); border-color: #b8dcc4; }
.plan-banner.free { background: var(--info-bg); border-color: #efd7a8; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { flex: 1 1 130px; background: var(--brand-tint); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-family: var(--serif); font-size: 1.9rem; color: #7a2f12; line-height: 1; }
.linkbox { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.linkbox code { background: var(--brand-tint); padding: 8px 12px; border-radius: 10px; overflow-wrap: anywhere; flex: 1 1 220px; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.theme-opt { position: relative; }
.theme-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.theme-opt .sw { display: block; border: 2.5px solid transparent; border-radius: 14px; padding: 8px; background: #fff; text-align: center; font-size: .85rem; font-weight: 500; }
.theme-opt .sw i { display: block; height: 44px; border-radius: 9px; margin-bottom: 6px; }
.theme-opt input:checked + .sw { border-color: var(--brand); background: var(--brand-tint); }
.theme-opt input:focus-visible + .sw { outline: 3px solid #e58a5c; outline-offset: 2px; }

.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.style-opt { position: relative; }
.style-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.style-opt .sw { display: block; border: 2.5px solid transparent; border-radius: 14px; padding: 8px; background: #fff; text-align: center; font-size: .8rem; font-weight: 500; }
.style-opt .sw i { display: block; height: 34px; border-radius: 9px; margin-bottom: 6px; border: 1px solid rgba(0,0,0,.08); }
.style-opt input:checked + .sw { border-color: var(--brand); background: var(--brand-tint); }
.style-opt input:focus-visible + .sw { outline: 3px solid #e58a5c; outline-offset: 2px; }
.font-preview {
  margin-bottom: 10px;
  padding: 22px 14px;
  border-radius: 14px;
  background: var(--brand-tint);
  text-align: center;
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #4a2f1f;
  overflow-wrap: anywhere;
}
.fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.font-opt { position: relative; }
.font-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.font-opt .sw { display: block; border: 2.5px solid transparent; border-radius: 12px; padding: 14px 10px; background: #fff; text-align: center; font-size: 1.05rem; }
.font-opt input:checked + .sw { border-color: var(--brand); background: var(--brand-tint); }
.font-opt input:focus-visible + .sw { outline: 3px solid #e58a5c; outline-offset: 2px; }

.avatar-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar-row img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }

/* Recorte e zoom de imagem (perfil e cards)
   Importante: .crop-preview e .crop-overlay começam escondidos com o atributo HTML
   `hidden`. Se a regra normal (`.crop-preview { display:flex }`) declarasse `display`
   incondicionalmente, ela venceria da regra padrão do navegador pra `[hidden]` (mesmo
   com a mesma especificidade, regra de autor sempre vence regra do navegador) e o
   elemento apareceria mesmo escondido — por isso o `display` só é aplicado com
   `:not([hidden])` abaixo. */
.crop-preview { align-items: center; gap: 10px; margin-top: 10px; }
.crop-preview:not([hidden]) { display: flex; }
.crop-preview img { width: 56px; height: 56px; object-fit: cover; border: 1.5px solid var(--line); background: #eee; }
.crop-preview--round img { border-radius: 50%; }
.crop-preview--rect img { border-radius: 8px; width: 84px; height: 56px; }
.crop-overlay {
  position: fixed; inset: 0; background: rgba(40, 24, 16, .58); z-index: 1000;
  align-items: center; justify-content: center; padding: 18px;
}
.crop-overlay:not([hidden]) { display: flex; }
.crop-modal { background: var(--paper); border-radius: var(--radius); padding: 20px; width: 100%; max-width: 380px; }
.crop-modal-title { margin: 0 0 14px; text-align: center; }
.crop-frame { position: relative; margin: 0 auto; overflow: hidden; background: #e7dccd; touch-action: none; }
.crop-frame:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.crop-frame--round { width: min(72vw, 240px); border-radius: 50%; }
.crop-frame--round::before { content: ""; display: block; padding-top: 100%; }
.crop-frame--rect { width: min(84vw, 320px); border-radius: 14px; }
.crop-frame--rect::before { content: ""; display: block; padding-top: 66.6667%; }
.crop-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.crop-canvas:active { cursor: grabbing; }
.crop-zoom { width: 100%; margin-top: 14px; }
.crop-modal-hint { margin: 8px 0 0; }
.crop-modal-actions { justify-content: space-between; }

.card-item { border: 1.5px solid var(--line); border-radius: 14px; background: #fff; margin-bottom: 12px; overflow: hidden; }
.card-item.hidden-plan { border-style: dashed; background: #faf5ef; }
.card-item summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.card-item summary::-webkit-details-marker { display: none; }
.card-item .sum-title { font-weight: 500; }
.card-item .sum-meta { font-size: .85rem; color: var(--ink-soft); }
.card-item .body { padding: 4px 16px 18px; border-top: 1px solid var(--line); }

.card-ghost {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: rgba(184, 71, 26, .05);
  color: var(--ink-soft);
  text-decoration: none;
  opacity: .78;
  transition: opacity .15s ease, background .15s ease;
}
.card-ghost:hover, .card-ghost:focus-visible { opacity: 1; background: var(--brand-tint); outline: none; }
.card-ghost-plus {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--ink-soft);
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
}

.sub-discreet { margin-top: 16px; font-size: .88rem; color: var(--ink-soft); }
.sub-discreet.box-empty { list-style: none; }
details.sub-discreet summary { cursor: pointer; color: var(--brand-dark); list-style: none; }
details.sub-discreet summary::-webkit-details-marker { display: none; }
details.sub-discreet summary::before { content: '›'; display: inline-block; margin-right: 6px; transition: transform .15s ease; }
details.sub-discreet[open] summary::before { transform: rotate(90deg); }
.link-btn {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}
.link-btn:hover { color: var(--brand); }
.sub-discreet form.inline-form { display: inline; margin-left: 4px; }
.badge { display: inline-block; font-size: .75rem; font-weight: 500; padding: 2px 10px; border-radius: 999px; background: #eee3d8; color: var(--ink-soft); }
.badge.warn { background: var(--info-bg); color: var(--info); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.err { background: var(--err-bg); color: var(--err); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.thumb { width: 96px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #eee; }

/* Admin */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 8px 16px; border-radius: 999px; text-decoration: none; background: var(--paper); border: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--brand-tint); font-weight: 500; white-space: nowrap; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 20px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.kpi b { display: block; font-family: var(--serif); font-size: 2rem; color: #7a2f12; line-height: 1; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
