/* Site e painel do Tudo na Bio. A página pública usa só bio.css. */
:root {
  --ink: #1b1a22;
  --muted: #62607a;
  --line: #e4e2ec;
  --paper: #ffffff;
  --ground: #f7f6fb;
  --brand: #5b3df5;
  --brand-dark: #4429d6;
  --brand-soft: #eeeaff;
  --sun: #ffd23f;
  --ok: #17764b;
  --ok-soft: #e4f6ec;
  --bad: #b3261e;
  --bad-soft: #fdecea;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
a { color: var(--brand-dark); }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.inline { display: inline; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Marca e cabeçalhos */
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.logo-mark { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(var(--paper) 0 0) 50% 28% / 58% 3px no-repeat, linear-gradient(var(--paper) 0 0) 50% 50% / 58% 3px no-repeat, linear-gradient(var(--sun) 0 0) 50% 72% / 58% 3px no-repeat, var(--brand); }
.site-head, .topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.quiet { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: none; cursor: pointer; }
.quiet:hover { color: var(--ink); text-decoration: underline; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--brand-dark); border-bottom-color: var(--brand); }
.site-foot { border-top: 1px solid var(--line); background: var(--paper); padding: 18px 0; color: var(--muted); font-size: .9rem; margin-top: 48px; }
.foot-row { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* Botões e formulários */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 2px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: .9rem; border-radius: 10px; }
.btn-ghost { background: var(--paper); color: var(--brand-dark); border-color: var(--line); }
.btn-ghost:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: #8f1d17; border-color: #8f1d17; }
.danger-link { background: none; border: 0; padding: 8px 0; font: inherit; font-size: .9rem; color: var(--bad); cursor: pointer; text-decoration: underline; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span:first-child { font-weight: 600; font-size: .9rem; }
.field small { color: var(--muted); }
.field small.is-ok, .claim-hint.is-ok { color: var(--ok); font-weight: 600; }
.field small.is-bad, .claim-hint.is-bad { color: var(--bad); font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); font: inherit; color: var(--ink); }
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="color"] { width: 100%; height: 46px; padding: 4px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); }
input[type="file"] { font: inherit; max-width: 100%; }
.claim-field { display: flex; align-items: center; min-height: 46px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); overflow: hidden; }
.claim-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.claim-prefix { padding-left: 12px; color: var(--muted); white-space: nowrap; font-size: .95rem; }
.claim-field input { border: 0; min-height: 43px; padding-left: 2px; box-shadow: none !important; background: transparent; font-weight: 600; min-width: 0; }
.row { display: flex; gap: 12px; }
.field-grow { flex: 1; }
.field-emoji { width: 76px; flex: none; }
.field-emoji input { text-align: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.is-locked { opacity: .6; }
.fine { font-size: .85rem; color: var(--muted); margin-top: 12px; }
.form .btn { width: 100%; }

/* Avisos */
.flash { padding: 12px 14px; border-radius: 10px; margin: 16px 0; font-weight: 600; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--bad-soft); color: var(--bad); }
.notice-pro { background: var(--brand-soft); border-radius: 10px; padding: 12px 14px; margin: 0; }
.empty { color: var(--muted); padding: 20px; border: 1.5px dashed var(--line); border-radius: var(--radius); text-align: center; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: .72rem; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.tag-off { background: #ececf1; color: var(--muted); }

/* Landing */
.hero { background: var(--paper); border-bottom: 1px solid var(--line); padding: 40px 0 48px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.2rem); letter-spacing: -.03em; margin-bottom: 16px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.claim { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; max-width: 560px; margin-top: 24px; }
.claim-hint { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .9rem; }
.features, .pricing { padding-top: 48px; }
.features h2, .pricing h2 { font-size: 1.5rem; margin-bottom: 20px; }
.feature-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.feature-grid li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.feature-grid p { margin: 0; color: var(--muted); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; max-width: 760px; }
.plan { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; }
.plan-pro { border-color: var(--brand); box-shadow: 0 10px 30px -18px var(--brand); }
.plan-price { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.plan-price small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.plan-alt { color: var(--muted); margin: 0 0 8px; }
.plan ul { list-style: none; padding: 0; margin: 12px 0 20px; flex: 1; }
.plan li { padding: 5px 0 5px 24px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.plan .btn, .plan form, .plan form .btn { width: 100%; }

/* Celular de demonstração e prévia */
.phone { width: 100%; max-width: 300px; margin: 0 auto; aspect-ratio: 9 / 18; border-radius: 38px; padding: 10px; background: var(--ink); box-shadow: 0 30px 60px -30px rgba(27, 26, 34, .5); }
.phone-screen { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; height: 100%; border: 0; border-radius: 28px; background: #f6f5f2; padding: 34px 18px; overflow: hidden; }
iframe.phone-screen { padding: 0; }
.demo-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; }
.demo-bio { color: var(--muted); font-size: .85rem; text-align: center; margin-bottom: 6px; }
.demo-link { width: 100%; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid #e3e1da; text-align: center; font-weight: 600; font-size: .9rem; }

/* Páginas de texto e de acesso */
.auth { max-width: 460px; padding-top: 40px; }
.auth .form { margin: 20px 0; }
.prose { max-width: 720px; padding-top: 40px; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: .4em; }

/* Painel */
.panel { padding-top: 24px; padding-bottom: 64px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; min-width: 0; }
fieldset.card legend { font-weight: 700; font-size: 1.05rem; padding: 0 6px; }
.stack { display: block; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.editor-preview { position: sticky; top: 16px; }
.address { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--brand-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; }
.address-url { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.link-item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.link-item.is-off summary { opacity: .6; }
.link-item.is-dragging { opacity: .4; }
.link-item summary { display: flex; align-items: center; gap: 10px; padding: 12px; cursor: pointer; list-style: none; }
.link-item summary::-webkit-details-marker { display: none; }
.grip { cursor: grab; color: var(--muted); font-size: 1.2rem; padding: 6px 4px; touch-action: none; user-select: none; }
.link-emoji { font-size: 1.3rem; width: 1.6em; text-align: center; flex: none; }
.link-emoji:empty { display: none; }
.link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.link-text strong, .link-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-text small { color: var(--muted); }
.clicks { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.chev { color: var(--brand-dark); font-weight: 600; font-size: .9rem; }
.link-item details[open] .chev { visibility: hidden; }
.link-form { padding: 4px 12px 0; border-top: 1px solid var(--line); margin-top: 0; padding-top: 14px; }
.link-item .danger-link { margin: 0 12px 8px; }
.actions { display: flex; gap: 10px; }
.avatar-row { display: flex; align-items: center; gap: 16px; }
.avatar-preview { width: 72px; height: 72px; flex: none; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; overflow: hidden; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-bottom: 14px; }
.theme { display: flex; flex-direction: column; gap: 6px; cursor: pointer; font-size: .85rem; font-weight: 600; }
.theme input { position: absolute; opacity: 0; pointer-events: none; }
.theme-swatch { height: 84px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 0 16px; }
.theme-swatch i { height: 13px; border-radius: 6px; background: var(--btn); border: 1px solid var(--btn-border); }
.theme input:checked + .theme-swatch { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.theme input:focus-visible + .theme-swatch { outline: 3px solid var(--brand); outline-offset: 2px; }
.theme.is-locked { cursor: not-allowed; }
.colors .field { flex: 1; }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--ground) 30%); }

/* Estatísticas e admin */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi span { display: block; color: var(--muted); font-size: .85rem; }
.kpi strong { font-size: 1.7rem; letter-spacing: -.02em; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; }
.chart-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-col span { font-size: .65rem; color: var(--muted); }
.chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 1px; border-bottom: 1px solid var(--line); }
.bar { display: block; flex: 1; max-width: 12px; min-height: 1px; border-radius: 3px 3px 0 0; }
.bar-views, .dot-views { background: #c9bfff; }
.bar-clicks, .dot-clicks { background: var(--brand); }
.legend { margin: 12px 0 0; color: var(--muted); font-size: .85rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; }
.dot:first-child { margin-left: 0; }
.rank { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.rank li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.rank-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rank-bar { height: 10px; background: var(--brand-soft); border-radius: 5px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--brand); border-radius: 5px; }
.rank-count { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3ch; text-align: right; }
.table-scroll { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; white-space: nowrap; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; }
.table-actions { display: flex; gap: 12px; }
.danger-zone { border-color: #f1c6c2; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero .phone { max-width: 240px; }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor-preview { position: static; }
  .editor-preview .phone { max-width: 260px; }
}
@media (max-width: 520px) {
  .claim { grid-template-columns: 1fr; }
  .chev, .clicks { display: none; }
  .colors { flex-direction: column; gap: 0; }
  .rank li { grid-template-columns: minmax(0, 1fr) auto; }
  .rank-bar { grid-column: 1 / -1; order: 3; }
}

/* Rodada 2: seções, imagem no link, QR code, pausar com um toque, FAQ */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 600; font-size: .9rem; background: var(--paper); }
.segmented input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.segmented input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.field > span small { font-weight: 400; color: var(--muted); }
input[type="datetime-local"] { width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); font: inherit; color: var(--ink); }
[hidden] { display: none !important; }
.share summary { cursor: pointer; font-weight: 700; }
.share-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 14px; }
.qr { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.actions { flex-wrap: wrap; }
.link-thumb { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; flex: none; }
.link-item.is-header { background: var(--ground); border-style: dashed; }
.toggle { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--muted); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.toggle.is-on { border-color: #bfe5cf; background: var(--ok-soft); color: var(--ok); }
.toggle:hover { border-color: var(--brand); }
.link-item.is-off summary { opacity: 1; }
.link-item.is-off .link-text, .link-item.is-off .link-emoji, .link-item.is-off .link-thumb { opacity: .5; }
.link-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 0 12px 10px; }
.link-extra .danger-link { margin: 0 0 0 auto; }
.link-extra .quiet { font-size: .9rem; text-decoration: underline; padding: 8px 0; }
.faq { padding-top: 48px; max-width: 760px; margin-left: auto; margin-right: auto; }
.faq h2 { font-size: 1.5rem; margin-bottom: 16px; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 16px 0; }
.faq details p { color: var(--muted); margin: 0 0 16px; }

/* Rodada 3: importar, contatos, domínio próprio */
.import-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.import-form:first-of-type { border-top: 0; padding-top: 0; }
code { background: var(--brand-soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; overflow-wrap: anywhere; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card .table-scroll { border: 0; }
.card > .check { margin-bottom: 12px; }
