/* Base compartilhada: tokens, reset e componentes. Páginas estendem em lp.css / painel.css / agendar.css. */
:root {
  --c-bg: #f6f8f7;
  --c-surface: #ffffff;
  --c-surface-2: #eef3f1;
  --c-text: #14211d;
  --c-muted: #56665f;
  --c-border: #dde5e1;
  --c-primary: #0e7c66;
  --c-primary-600: #0a6452;
  --c-primary-50: #e7f4f0;
  --c-accent: #f2a93b;
  --c-danger: #c2413a;
  --c-danger-50: #fbecea;
  --c-success: #1f8a4c;
  --c-success-50: #e8f5ed;
  --c-warning-50: #fdf4e3;

  /* cor da marca do negócio (página pública) — sobrescrita por applyBrand() */
  --brand: var(--c-primary);
  --brand-ink: #ffffff;
  --brand-soft: #0e7c661a;

  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(20 33 29 / 6%), 0 1px 3px rgb(20 33 29 / 8%);
  --shadow: 0 4px 16px rgb(20 33 29 / 8%), 0 1px 3px rgb(20 33 29 / 6%);
  --shadow-lg: 0 18px 48px rgb(20 33 29 / 14%);
  --focus: 0 0 0 3px rgb(14 124 102 / 35%);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 72px;
  --container: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 var(--space-3); letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 var(--space-4); }
a { color: var(--c-primary); text-underline-offset: 3px; }
a:hover { color: var(--c-primary-600); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--space-4); }
.muted { color: var(--c-muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.stack > * + * { margin-top: var(--space-4); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ------------------------------------------------------------ botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 10px 18px;
  font: 600 0.975rem/1.2 var(--font-body);
  border: 1px solid transparent; border-radius: var(--radius-pill);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-600); color: #fff; }
.btn-brand { background: var(--brand); color: var(--brand-ink); }
.btn-brand:hover { filter: brightness(0.93); color: var(--brand-ink); }
.btn-outline { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn-outline:hover { border-color: var(--c-muted); color: var(--c-text); }
.btn-ghost { background: transparent; color: var(--c-text); }
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn-danger { background: var(--c-surface); color: var(--c-danger); border-color: #efc9c5; }
.btn-danger:hover { background: var(--c-danger-50); color: var(--c-danger); }
.btn-whatsapp { background: #1fa855; color: #fff; }
.btn-whatsapp:hover { background: #178a45; color: #fff; }
.btn-lg { min-height: 52px; padding: 14px 26px; font-size: 1.05rem; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ formulários */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: var(--space-4); }
.field label, .label { font-weight: 600; font-size: 0.925rem; }
.field .hint { font-size: 0.825rem; color: var(--c-muted); }
.field .error-text { font-size: 0.825rem; color: var(--c-danger); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  font: 400 1rem/1.4 var(--font-body); color: var(--c-text);
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--focus); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--c-danger); }
.checkbox { display: flex; gap: var(--space-2); align-items: flex-start; font-size: 0.95rem; }
.checkbox input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--c-primary); }

/* interruptor (checkbox role=switch) */
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: #c9d3cf; position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked { background: var(--c-primary); }
.switch input:checked::after { transform: translateX(18px); }

/* ------------------------------------------------------------ superfícies */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.card-flat { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--space-4); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 600; background: var(--c-surface-2); color: var(--c-muted); }
.badge-success { background: var(--c-success-50); color: var(--c-success); }
.badge-danger { background: var(--c-danger-50); color: var(--c-danger); }
.badge-warning { background: var(--c-warning-50); color: #9a6212; }

.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--c-border); background: var(--c-surface-2); font-size: 0.95rem; }
.alert-danger { background: var(--c-danger-50); border-color: #efc9c5; color: #8e2a24; }
.alert-success { background: var(--c-success-50); border-color: #bfe2cc; color: #17663a; }
.alert-warning { background: var(--c-warning-50); border-color: #f1d7a6; color: #7a4d0e; }

/* ------------------------------------------------------------ carregamento e aviso flutuante */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #e9efec 25%, #f4f7f6 37%, #e9efec 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.toast-region { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { background: #14211d; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 0.95rem; animation: toast-in .2s ease-out; }
.toast-danger { background: var(--c-danger); }
.toast-success { background: var(--c-success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
