/* Belestim — identidade Vanessa Lorayne Clinic (creme, nude, serifa elegante) */
@font-face { font-family: 'Cormorant'; src: url('/assets/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('/assets/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('/assets/fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/assets/fonts/manrope-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/assets/fonts/manrope-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/assets/fonts/manrope-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/assets/fonts/manrope-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #F7F1EA;
  --surface: #FFFDF9;
  --surface-2: #F2E9DF;
  --ink: #2B211C;
  --ink-2: #4A3C33;
  --muted: #7A6A60;
  --line: #E8DDD2;
  --nude: #D9BFA9;
  --accent: #A9785A;
  --accent-ink: #8A5E43;
  --gold: #B8955A;
  --ok: #5E7D5A;
  --warn: #B07D2B;
  --danger: #B4533F;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(43, 33, 28, .04), 0 8px 24px rgba(43, 33, 28, .06);
  --serif: 'Cormorant', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .4em; letter-spacing: .01em; }
h1 { font-size: 34px; }
h2 { font-size: 26px; }
h3 { font-size: 21px; }
.eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- Estrutura ---------- */
#app { min-height: 100vh; min-height: 100dvh; }
.page { max-width: 560px; margin: 0 auto; padding: 20px 18px calc(110px + var(--safe-b)); }
.page.narrow { max-width: 440px; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; max-width: 560px; margin: 0 auto; }
.topbar .title { font-family: var(--serif); font-size: 22px; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.tint { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.card + .card { margin-top: 14px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ---------- Entrada ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 28px 20px; max-width: 440px; margin: 0 auto; }
.brand-logo { width: 220px; margin: 0 auto 6px; }
.brand-logo.sm { width: 150px; }
.brand-tag { text-align: center; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink-2); margin: 6px 0 22px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.tabs button { border: 0; background: transparent; padding: 10px; border-radius: 999px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Formulários ---------- */
label.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  padding: 13px 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; appearance: none;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(169, 120, 90, .18); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; padding: 8px; cursor: pointer; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); margin: 1px 0 0; flex: none; }
.error-box { background: #F7E4DF; color: #7E3526; border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14px; }
.ok-box { background: #E6EEE2; color: #3D5639; border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14px; }
.code-input { letter-spacing: .5em; text-align: center; font-size: 26px; font-weight: 600; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 13px 22px; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; transition: transform .05s, opacity .15s, background .15s; min-height: 48px; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--surface); }
.btn.primary:hover { background: #3A2D26; }
.btn.secondary { background: var(--surface); border-color: var(--ink); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.danger { background: transparent; color: var(--danger); border-color: #E7C3B9; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 14px; min-height: 36px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }
.link-btn { background: none; border: 0; color: var(--accent-ink); font-weight: 600; cursor: pointer; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#g-btn { display: flex; justify-content: center; min-height: 44px; }

/* ---------- Progresso do cadastro ---------- */
.steps { display: flex; gap: 6px; margin: 6px 0 20px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--accent); }

/* ---------- Início da cliente ---------- */
.hello { margin: 8px 0 18px; }
.hello h1 { font-size: 32px; }
.next-card { background: var(--ink); color: var(--surface); border-radius: var(--radius); padding: 22px; }
.next-card .eyebrow { color: var(--nude); }
.next-card h2 { color: var(--surface); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.quick a, .quick button { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 8px; text-align: center; text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.quick svg { width: 24px; height: 24px; color: var(--accent); }
.rating { display: flex; align-items: center; gap: 14px; }
.rating .score { font-family: var(--serif); font-size: 44px; line-height: 1; }
.stars { color: var(--gold); letter-spacing: 2px; }
.banner { display: flex; gap: 14px; align-items: center; }
.banner .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.banner .ico svg { width: 22px; height: 22px; color: var(--accent); }

/* ---------- Navegação inferior (cliente) ---------- */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 253, 249, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; justify-content: center; padding: 6px 8px calc(6px + var(--safe-b)); z-index: 20; }
.bottom-nav .inner { display: flex; width: 100%; max-width: 560px; }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.bottom-nav a svg { width: 23px; height: 23px; }
.bottom-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Perfil ---------- */
.avatar { width: 64px; height: 64px; border-radius: 999px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--serif); font-size: 26px; color: var(--accent-ink); overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 38px; height: 38px; font-size: 16px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 2px; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; text-decoration: none; color: inherit; }
.list-item .chev { color: var(--muted); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 8px; } }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.badge.ok { background: #E6EEE2; color: #3D5639; }
.badge.warn { background: #F6EAD3; color: #7A5418; }
.badge.danger { background: #F7E4DF; color: #7E3526; }
.badge.gold { background: #F1E7D3; color: #6E5323; }

/* ---------- Painel ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side .brand-logo { width: 150px; margin: 0 0 24px 8px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.side nav a svg { width: 20px; height: 20px; color: var(--muted); }
.side nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.side nav a[aria-current="page"] svg { color: var(--accent); }
.side .me { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px; border-top: 1px solid var(--line); }
.main { padding: 28px 32px 60px; max-width: 1180px; width: 100%; }
.main-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.main-head h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat .n { font-family: var(--serif); font-size: 40px; line-height: 1.05; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { max-width: 360px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #FBF7F2; }
.t-wrap { overflow-x: auto; }
.mobile-nav { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 18px 16px calc(96px + var(--safe-b)); }
  .mobile-nav { display: flex; }
  table.t .hide-m { display: none; }
}

/* ---------- Janela modal e avisos ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(43, 33, 28, .42); display: grid; place-items: center; padding: 18px; z-index: 50; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 20px; padding: 22px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
@media (max-width: 520px) { .modal-back { place-items: end center; padding: 0; } .modal { border-radius: 20px 20px 0 0; padding-bottom: calc(22px + var(--safe-b)); } }
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 999px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); animation: fade .2s; max-width: 92vw; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen { min-height: 100vh; display: grid; place-items: center; }
.loading-screen img { width: 160px; opacity: .9; }

.steps-list { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps-list li { counter-increment: s; position: relative; padding: 0 0 16px 46px; }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 999px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--accent-ink); }
.prose h2 { margin-top: 1.2em; }
.prose p, .prose li { color: var(--ink-2); }

/* ---------- Ajustes de ícones e espaçamentos ---------- */
svg:not([width]) { width: 22px; height: 22px; flex: none; }
.hero-ico { width: 64px; height: 64px; border-radius: 999px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto; color: var(--accent); }
.hero-ico svg { width: 30px; height: 30px; }
.list-item svg { color: var(--accent); }
.avatar svg { width: 28px; height: 28px; color: var(--accent); }
.banner, .banner:hover { text-decoration: none; color: inherit; }
.side .me { text-decoration: none; color: inherit; }
.main > * + * { margin-top: 16px; }
.page > section + section, .page > section + a, .page > a + section { margin-top: 14px; }
input.toggle { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
input.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
input.toggle:checked { background: var(--accent); }
input.toggle:checked::after { transform: translateX(18px); }
input.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quick { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }

@media (max-width: 520px) { .stats { grid-template-columns: 1fr 1fr; } .stats .stat:last-child { grid-column: span 2; } .stat .n { font-size: 34px; } }
