/* Fontes servidas pelo próprio site: nenhuma requisição a terceiros (privacidade). */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 500; font-display: swap; src: url('fonts/fraunces-500.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 600; font-display: swap; src: url('fonts/fraunces-600.woff2') format('woff2'); }

:root {
  --bg: #faf6f3;
  --surface: #ffffff;
  --ink: #2a2025;
  --muted: #7d6e74;
  --line: #ece3de;
  --brand: #9c4f68;
  --brand-dark: #7e3c53;
  --brand-soft: #f6e9ed;
  --gold: #b8925a;
  --ok: #2f7d5b;
  --ok-soft: #e4f3ec;
  --warn: #9a6210;
  --warn-soft: #fbf0dc;
  --danger: #b33a3a;
  --danger-soft: #fbe7e7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(42, 32, 37, 0.04), 0 8px 24px rgba(42, 32, 37, 0.06);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 0.4em; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; font-family: var(--sans); font-weight: 650; }
p { margin: 0 0 0.8em; }
a { color: var(--brand); }
small, .muted { color: var(--muted); }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  padding: 0.62em 1.1em; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { border-color: #d9ccc5; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.btn-whats { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn-whats:hover { background: #188647; border-color: #188647; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 0.38em 0.8em; font-size: 0.86rem; }
.btn-lg { padding: 0.85em 1.5em; font-size: 1.05rem; }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }

label { display: block; font-size: 0.85rem; font-weight: 600; color: #4e4247; margin-bottom: 0.3em; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #e2d7d1; border-radius: 10px; padding: 0.6em 0.75em; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(156, 79, 104, 0.15); }
input[type='checkbox'], input[type='radio'] { width: auto; accent-color: var(--brand); }
textarea { min-height: 84px; resize: vertical; }
.field { margin-bottom: 0.9rem; }
.row { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.check { display: flex; gap: 0.55em; align-items: flex-start; font-weight: 500; font-size: 0.92rem; color: var(--ink); }
.check input { margin-top: 0.25em; }

/* ---------- blocos ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stat { padding: 1rem 1.1rem; }
.stat .label { font-size: 0.8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat .value { font-family: var(--serif); font-size: 1.65rem; font-weight: 600; margin-top: 0.15rem; white-space: nowrap; }
.stat .hint { font-size: 0.82rem; color: var(--muted); }
.stat.highlight { background: linear-gradient(135deg, #9c4f68, #b56b7f); color: #fff; border: 0; }
.stat.highlight .label, .stat.highlight .hint { color: rgba(255, 255, 255, 0.85); }

.chip { display: inline-flex; align-items: center; gap: 0.3em; padding: 0.15em 0.6em; border-radius: 999px; font-size: 0.76rem; font-weight: 650; background: #f1ebe8; color: #5c5055; white-space: nowrap; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-brand { background: var(--brand-soft); color: var(--brand); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1 1 200px; min-width: 0; }
.list .title { font-weight: 650; }
.list .sub { font-size: 0.86rem; color: var(--muted); }
.list .actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
a.list-link { color: inherit; text-decoration: none; }
a.list-link:hover .title { color: var(--brand); }

.time { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; min-width: 3.2rem; color: var(--brand); }
.empty { text-align: center; padding: 1.8rem 1rem; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 0.25rem; }

table.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 650; padding: 0.5rem; border-bottom: 1px solid var(--line); }
.table td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 0.7em 1.2em; border-radius: 999px; font-weight: 600; z-index: 100; box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}
.toast.error { background: var(--danger); }
.alert { padding: 0.75rem 1rem; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-weight: 550; margin-bottom: 1rem; }
.alert-error { background: var(--danger-soft); color: var(--danger); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(42, 32, 37, 0.45); display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 16px; overflow-y: auto; z-index: 50;
}
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 560px; padding: 1.4rem; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; }
.modal-head h2 { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.2rem; flex-wrap: wrap; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--gold)); display: grid; place-items: center; color: #fff; font-size: 1rem; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 1.2rem 0.9rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.2rem; }
.nav { display: flex; flex-direction: column; gap: 0.15rem; }
.nav a { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.75rem; border-radius: 10px; color: #4e4247; text-decoration: none; font-weight: 550; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: #f7f1ee; }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav .badge { margin-left: auto; background: var(--brand); color: #fff; border-radius: 999px; font-size: 0.72rem; padding: 0.05em 0.5em; font-weight: 700; }
.sidebar-foot { margin-top: auto; font-size: 0.84rem; color: var(--muted); padding: 0 0.5rem; }
.main { padding: 1.6rem 2rem 3rem; max-width: 1180px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 0.2rem 0 0; color: var(--muted); }
.trial-bar { background: var(--brand-soft); color: var(--brand-dark); padding: 0.6rem 1rem; border-radius: 12px; margin-bottom: 1.2rem; display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; font-weight: 550; }

.date-nav { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.4rem; margin-bottom: 1rem; }
.week a { text-align: center; padding: 0.5rem 0.2rem; border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.week a .d { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; font-weight: 650; }
.week a .n { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.week a .c { font-size: 0.72rem; color: var(--brand); font-weight: 700; min-height: 1em; }
.week a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.week a.active .d, .week a.active .c { color: rgba(255, 255, 255, 0.85); }
.week a.today:not(.active) { border-color: var(--brand); }

.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 0.6rem 0.9rem; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--brand); border-color: var(--brand); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.7rem; }
.photo { position: relative; border-radius: 12px; overflow: hidden; background: #f1ebe8; aspect-ratio: 3 / 4; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo .chip { position: absolute; left: 8px; top: 8px; }
.photo .del { position: absolute; right: 6px; top: 6px; }

.face-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: start; }
.face { width: 100%; background: #fcf8f6; border: 1px solid var(--line); border-radius: 14px; cursor: crosshair; touch-action: manipulation; }
.face-thumb { width: 74px; flex: none; background: #fcf8f6; border-radius: 10px; border: 1px solid var(--line); }
.points { max-height: 260px; overflow-y: auto; }
.points .pt { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.points .pt b { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 0.75rem; flex: none; }
.points .pt input { width: 90px; }
.item-row { display: grid; grid-template-columns: 1fr 110px auto; gap: 0.5rem; margin-bottom: 0.5rem; }

.signature { border: 1.5px dashed #d6c6bf; border-radius: 14px; background: #fff; width: 100%; height: 190px; touch-action: none; display: block; }
.term { white-space: pre-wrap; background: #fcf8f6; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; font-size: 0.9rem; max-height: 300px; overflow-y: auto; }
.answer { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.answer:first-child { border-top: 0; }
.answer .yes { color: var(--danger); font-weight: 700; }

.paywall { max-width: 560px; margin: 6vh auto; text-align: center; }

/* ---------- entrada (login, nova senha, código) ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 420px; padding: 1.8rem; }
.auth .logo { margin-bottom: 1.2rem; }
.auth .switch { text-align: center; margin-top: 1rem; font-size: 0.92rem; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
.code-input { font-size: 1.6rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: block; width: 200px; height: 200px; margin: 0.6rem auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.secret { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-all; background: #fcf8f6; border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.6rem; font-size: 0.85rem; }

/* ---------- avisos fixos ---------- */
.offline-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 60; background: var(--warn); color: #fff; text-align: center; padding: 0.4rem 1rem; font-weight: 600; font-size: 0.9rem; }
.install-card { background: var(--brand-soft); border-radius: 12px; padding: 0.7rem 0.8rem; font-size: 0.86rem; color: var(--brand-dark); }
.install-card strong { display: block; margin-bottom: 0.2rem; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.price { font-family: var(--serif); font-size: 2.6rem; font-weight: 600; }
.price small { font-family: var(--sans); font-size: 1rem; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .shell > * { min-width: 0; }
  .nav { flex: 1; min-width: 0; }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 0.6rem 16px; gap: 0.8rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .logo span:last-child { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 0.2rem; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 0.5rem 0.65rem; white-space: nowrap; font-size: 0.9rem; }
  .nav a svg { display: none; }
  .sidebar-foot { display: none; }
  .main { padding: 1.1rem 16px 3rem; }
  .face-wrap { grid-template-columns: 1fr; }
  .face { max-width: 260px; margin: 0 auto; display: block; }
  .item-row { grid-template-columns: 1fr 90px auto; }
  h1 { font-size: 1.5rem; }
}

@media print {
  .no-print, .sidebar, .modal-foot, .trial-bar { display: none !important; }
  body { background: #fff; }
  .modal-backdrop { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; max-width: none; padding: 0; }
  body.has-modal > :not(.modal-backdrop) { display: none !important; }
  .term { max-height: none; border: 0; padding: 0; }
}
