/* Hesed Conceito — sistema de design.
   Para aplicar a identidade visual definitiva, troque os tokens abaixo. */

:root {
  /* Identidade visual Hesed Conceito (identidade-visual-hesed/design-tokens.css). */
  --bg: #f7f3ec;            /* marfim */
  --surface: #fefcf8;       /* branco quente */
  --surface-soft: #efe8dd;  /* areia */
  --line: #e5ddd1;
  --line-strong: #d3c8b8;
  --text: #252822;          /* carvão */
  --muted: #77736a;
  --primary: #2f362f;       /* oliva profundo: ações principais e estados ativos */
  --primary-ink: #fefcf8;
  --accent: #a1764a;        /* bronze fosco: destaques, links e detalhes */
  --accent-soft: #f1e7d9;
  --accent-ink: #765435;
  --success: #526a55;
  --success-soft: #e4ebe2;
  --danger: #a34f3d;
  --danger-soft: #f6e6e1;
  --warn: #93691f;
  --warn-soft: #f6ecd6;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(37, 40, 34, 0.04), 0 8px 24px -12px rgba(37, 40, 34, 0.12);
  --shadow-lift: 0 2px 4px rgba(37, 40, 34, 0.05), 0 18px 36px -16px rgba(37, 40, 34, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar: 256px;
}

@view-transition { navigation: auto; }

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h1, h2, .display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 0.95rem; font-weight: 600; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
[x-cloak], [hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.eyebrow { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); }
.link { color: var(--accent-ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.link:hover { text-decoration-color: currentColor; }
button.link { background: none; border: 0; padding: 0; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nowrap { white-space: nowrap; }
.cap::first-letter { text-transform: uppercase; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Estrutura ---------- */

.shell { min-height: 100dvh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  display: none; flex-direction: column; gap: 28px;
  padding: 28px 18px 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

/* O arquivo da logo já traz a área de proteção em volta; as margens negativas alinham o desenho. */
.brandmark { display: block; }
.brandmark img { width: 232px; max-width: none; height: auto; margin: -14px 0 -14px -12px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label { padding: 16px 12px 6px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.nav a:hover { background: var(--surface-soft); color: var(--text); transform: translateX(2px); }
.nav a.is-active { background: var(--primary); color: var(--primary-ink); }

.sidebar__user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-soft); }
.sidebar__user form { margin-left: auto; }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 600; font-size: 0.85rem; letter-spacing: 0.02em;
}
.avatar--lg { width: 64px; height: 64px; font: 600 1.6rem var(--font-display); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar .brandmark { padding: 0; }
.topbar .brandmark img { width: 176px; margin: -12px 0 -12px -42px; }

.main { padding: 8px 18px 112px; max-width: 1180px; margin: 0 auto; }
.main--narrow { max-width: 760px; }

.tabbar {
  position: fixed; inset: auto 12px calc(12px + env(safe-area-inset-bottom)) 12px; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px; border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px; border: 0; background: none; border-radius: 16px;
  font-size: 0.66rem; font-weight: 500; color: var(--muted);
  transition: background 0.25s, color 0.25s;
}
.tabbar .is-active { background: var(--primary); color: var(--primary-ink); }

.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(37, 40, 34, 0.38); backdrop-filter: blur(2px); }
.sheet {
  position: fixed; inset: auto 0 0 0; z-index: 41;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  background: var(--surface); border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 50px -20px rgba(37, 40, 34, 0.35);
}
.sheet::before { content: ''; display: block; width: 40px; height: 4px; margin: 0 auto 14px; border-radius: 4px; background: var(--line-strong); }
.sheet .nav a { padding: 13px 12px; color: var(--text); }
.sheet-enter { transition: transform 0.35s var(--ease), opacity 0.25s; }
.sheet-from { transform: translateY(100%); }
.fade-enter { transition: opacity 0.25s; }
.fade-from { opacity: 0; }

@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .topbar, .tabbar, .sheet, .sheet-backdrop { display: none !important; }
  .shell { padding-left: var(--sidebar); }
  .main { padding: 44px 44px 72px; }
}

/* ---------- Cabeçalho de página ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 10px 0 26px; }
.page-head p { margin-top: 6px; color: var(--muted); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.back:hover { color: var(--text); }
.back .icon { width: 16px; height: 16px; }

/* ---------- Cartões e grades ---------- */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card--flush { padding: 0; overflow: hidden; }
.card--soft { background: var(--surface-soft); box-shadow: none; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card--flush .card__head { padding: 20px 22px 0; }
.card__head > :last-child:not(:only-child) { flex: none; }
a.card, .card--hover { transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.3s; }
a.card:hover, .card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }

/* minmax(0, 1fr): o conteúdo (inputs, tabelas) nunca alarga a coluna além da tela. */
.grid, .stack, .form, .doc__section, .clause, .day, .share { grid-template-columns: minmax(0, 1fr); }
.grid { display: grid; gap: 16px; }
.stack { display: grid; gap: 16px; align-content: start; }
.stack--lg { gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) {
  .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
}

.stat { display: grid; gap: 10px; padding: 18px; }
.stat__top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.stat__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); }
.stat__icon .icon { width: 18px; height: 18px; }
.stat__value { font: 600 clamp(1.7rem, 5vw, 2.2rem)/1 var(--font-display); font-variant-numeric: lining-nums; }
.stat__hint { font-size: 0.78rem; color: var(--muted); }

.list { display: grid; }
.list__item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px; border-top: 1px solid var(--line);
  transition: background 0.2s;
}
.list__item:first-child { border-top: 0; }
a.list__item:hover { background: var(--surface-soft); }
.list__item .icon.chev { width: 16px; height: 16px; color: var(--line-strong); transition: transform 0.25s var(--ease), color 0.2s; }
a.list__item:hover .chev { transform: translateX(3px); color: var(--accent); }
.list__title { font-weight: 500; }

.empty { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .icon { width: 30px; height: 30px; color: var(--line-strong); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; white-space: nowrap;
  background: var(--surface-soft); color: var(--muted);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--accent { background: var(--accent-soft); color: var(--accent-ink); }

.amount--in { color: var(--success); font-weight: 600; }
.amount--out { color: var(--danger); font-weight: 600; }

/* ---------- Botões ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.9rem; white-space: nowrap;
  background: var(--primary); color: var(--primary-ink);
  transition: transform 0.2s var(--ease), box-shadow 0.25s, background 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(37, 40, 34, 0.55); }
.btn:active { transform: scale(0.97); }
.btn .icon { width: 17px; height: 17px; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.btn--accent { background: var(--accent); }
.btn--whatsapp { background: #1f8f55; }
.btn--danger { background: none; color: var(--danger); border-color: transparent; padding-inline: 10px; }
.btn--danger:hover { background: var(--danger-soft); box-shadow: none; }
.btn--sm { padding: 7px 13px; font-size: 0.8rem; }
.btn--block { width: 100%; }
.btn--lg { padding: 15px 24px; font-size: 1rem; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); transition: color 0.2s, border-color 0.2s, transform 0.2s var(--ease); }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn .icon { width: 17px; height: 17px; }

/* ---------- Formulários ---------- */

.form { display: grid; gap: 18px; }
.fields { display: grid; gap: 16px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.field { grid-column: 1 / -1; display: grid; gap: 6px; align-content: start; min-width: 0; }
@media (min-width: 640px) {
  .field--half { grid-column: span 3; }
  .field--third { grid-column: span 2; }
}
.label { font-size: 0.82rem; font-weight: 600; }
.label small { font-weight: 400; color: var(--muted); }
.req { color: var(--accent); }
.hint { font-size: 0.78rem; color: var(--muted); }
.error { font-size: 0.8rem; font-weight: 500; color: var(--danger); }

.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px; /* evita zoom no iPhone */
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}
select.input {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2377736a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
textarea.input { min-height: 96px; resize: vertical; }
.input::placeholder { color: #b3ab9d; }
.input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.field.has-error .input { border-color: var(--danger); }
.input--color { padding: 4px; height: 46px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); font-size: 0.88rem; font-weight: 500; cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.choice span:hover { border-color: var(--accent); }
.choice input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.choice input:active + span { transform: scale(0.96); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.check input {
  appearance: none; flex: none; width: 22px; height: 22px; margin: 1px 0 0;
  border: 1.5px solid var(--line-strong); border-radius: 7px; background: var(--surface);
  display: grid; place-items: center; cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.check input::after {
  content: ''; width: 11px; height: 6px; margin-top: -2px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0); transition: transform 0.25s var(--ease);
}
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }

/* Campo complementar do Sim/Não: aparece quando a resposta é "Sim". */
.detail { display: none; }
.field:has(input[value='sim']:checked) .detail, .field--radio .detail { display: block; animation: rise 0.35s var(--ease); }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th { padding: 10px 12px; text-align: left; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .input { padding: 8px 10px; font-size: 15px; min-width: 76px; }

/* ---------- Avisos ---------- */

.toast {
  position: fixed; z-index: 60; left: 50%; top: 18px; translate: -50% 0;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 0.88rem; font-weight: 500;
  box-shadow: var(--shadow-lift);
  animation: toast-in 0.5s var(--ease), toast-out 0.4s 4.2s forwards;
}
.toast--error { background: var(--danger); }
.toast .icon { width: 18px; height: 18px; }

.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--warn-soft); color: #6b4a10; font-size: 0.88rem; }
.notice--danger { background: var(--danger-soft); color: #7c3526; }
.notice--info { background: var(--accent-soft); color: #5e4827; }
.notice .icon { margin-top: 1px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Gráficos simples ---------- */

.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 10px; height: 150px; }
.bars__col { display: grid; grid-template-rows: 1fr auto; gap: 8px; height: 100%; justify-items: center; font-size: 0.7rem; color: var(--muted); text-transform: capitalize; }
.bars__bar {
  align-self: end; width: 100%; max-width: 44px; min-height: 4px; border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--surface)));
  transform-origin: bottom; animation: grow 0.9s var(--ease) backwards;
}
.bars__col:last-child .bars__bar { background: var(--primary); }

.meter { height: 6px; border-radius: 6px; background: var(--surface-soft); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; animation: grow-x 0.9s var(--ease) backwards; }
.meter--danger span { background: var(--danger); }
.meter--success span { background: var(--success); }

/* ---------- Agenda ---------- */

.week { display: grid; gap: 14px; }
@media (min-width: 1024px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; } }
.day { display: grid; gap: 8px; align-content: start; }
.day__head { display: flex; align-items: baseline; gap: 8px; padding: 0 4px; }
.day__head strong { font: 600 1.35rem var(--font-display); }
.day__head span { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.day.is-today .day__head strong { color: var(--accent-ink); }
.day.is-today .day__head::after { content: 'hoje'; margin-left: auto; font-size: 0.68rem; font-weight: 600; color: var(--accent-ink); }
.day__empty { padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); text-align: center; font-size: 0.78rem; color: var(--muted); transition: border-color 0.2s, color 0.2s; }
.day__empty:hover { border-color: var(--accent); color: var(--accent-ink); }

.slot {
  display: grid; gap: 4px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.slot:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.slot--concluido { border-left-color: var(--success); }
.slot--cancelado, .slot--faltou { border-left-color: var(--line-strong); opacity: 0.7; }
.slot__time { font-size: 0.74rem; font-weight: 600; color: var(--accent-ink); }
.slot__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---------- Login ---------- */

.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(60% 50% at 85% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(50% 45% at 0% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--bg);
}
.auth__card { width: min(420px, 100%); padding: 36px 30px; animation: rise 0.8s var(--ease) backwards; }
.auth .brandmark { margin-bottom: 26px; padding: 0; }
.auth .brandmark img { width: 300px; max-width: 100%; margin: -16px auto -8px; }

/* ---------- Documentos (ficha e contrato) ---------- */

.doc-page {
  --primary: var(--brand-primary, #2f362f);
  --accent: var(--brand-accent, #a1764a);
  --bg: var(--brand-bg, #f7f3ec);
  background: var(--bg);
}
.doc-progress { position: fixed; z-index: 50; inset: 0 0 auto 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.doc { max-width: 760px; margin: 0 auto; padding: 28px 18px 80px; }
.doc__head { display: grid; justify-items: center; gap: 14px; padding: 20px 0 30px; text-align: center; }
.doc__logo { max-height: 84px; max-width: 220px; object-fit: contain; }
.doc__name { font: 600 1.6rem var(--font-display); letter-spacing: 0.02em; }
.doc__head h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); text-wrap: balance; }
.doc__head p { color: var(--muted); max-width: 46ch; }
.doc__section { display: grid; gap: 18px; }
.doc__section > header { display: grid; gap: 4px; }
.doc__section > header p { color: var(--muted); font-size: 0.88rem; }
.doc__foot { margin-top: 28px; text-align: center; font-size: 0.78rem; color: var(--muted); }

.clause { display: grid; gap: 12px; }
.clause h2 { font-size: 1.25rem; }
.clause h2 span { color: var(--accent-ink); margin-right: 6px; }
.clause p, .clause li { font-size: 0.93rem; line-height: 1.7; color: color-mix(in srgb, var(--text) 86%, transparent); text-align: justify; hyphens: auto; }
.clause ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.clause__ack { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-soft); font-weight: 500; font-size: 0.88rem; transition: background 0.3s; }
.clause__ack:has(input:checked) { background: var(--success-soft); color: var(--success); }
.clause__ack.is-done { display: flex; align-items: center; gap: 8px; background: var(--success-soft); color: var(--success); }

.parties { display: grid; gap: 14px; }
.party dt { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 6px; }
.party dd { margin: 0; font-size: 0.92rem; }
.data { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.data div { min-width: 0; }
.data dt { font-size: 0.74rem; color: var(--muted); margin-bottom: 2px; }
.data dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.data .full { grid-column: 1 / -1; }
@media (min-width: 720px) { .data--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.signature-box { position: relative; height: 190px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); touch-action: none; transition: border-color 0.2s; }
.signature-box:hover, .signature-box.is-signed { border-color: var(--accent); border-style: solid; }
.signature-box canvas { width: 100%; height: 100%; border-radius: inherit; cursor: crosshair; }
.signature-box__hint { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: #b3ab9d; font-size: 0.9rem; }
.signature-box__line { position: absolute; inset: auto 28px 44px 28px; border-bottom: 1px solid var(--line-strong); pointer-events: none; }
.signature-img { max-height: 110px; margin: 0 auto; }
.signed { display: grid; justify-items: center; gap: 4px; padding-top: 10px; border-top: 1px solid var(--text); text-align: center; font-size: 0.85rem; }
.audit { font-size: 0.76rem; color: var(--muted); overflow-wrap: anywhere; }

.share { display: grid; gap: 12px; }
.share__link { display: flex; gap: 8px; }
.share__link .input { font-size: 0.84rem; color: var(--muted); background: var(--surface-soft); }

.success-mark { width: 84px; height: 84px; }
.success-mark circle { fill: none; stroke: var(--success); stroke-width: 2; stroke-dasharray: 252; stroke-dashoffset: 252; animation: draw 0.9s 0.2s var(--ease) forwards; }
.success-mark path { fill: none; stroke: var(--success); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw 0.5s 0.9s var(--ease) forwards; }

.sticky-submit { position: sticky; bottom: 14px; z-index: 5; }

/* ---------- Movimento ---------- */

.reveal > * { animation: rise 0.7s var(--ease) backwards; }
.reveal > *:nth-child(2) { animation-delay: 0.06s; }
.reveal > *:nth-child(3) { animation-delay: 0.12s; }
.reveal > *:nth-child(4) { animation-delay: 0.18s; }
.reveal > *:nth-child(5) { animation-delay: 0.24s; }
.reveal > *:nth-child(n + 6) { animation-delay: 0.3s; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-16px); visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  @view-transition { navigation: none; }
}

/* ---------- Impressão / salvar em PDF ---------- */

@media print {
  .sidebar, .topbar, .tabbar, .toast, .no-print, .doc-progress { display: none !important; }
  .shell { padding: 0; }
  .main, .doc { max-width: none; padding: 0; }
  body, .doc-page { background: #fff; font-size: 11pt; }
  .card { border: 0; box-shadow: none; padding: 0; break-inside: auto; }
  .stack--lg { gap: 18px; }
  .clause, .signed, .party { break-inside: avoid; }
  .clause p, .clause li { font-size: 10.5pt; line-height: 1.5; }
  .reveal > * { animation: none; }
}
