:root {
  color-scheme: light;

  /* Cores de tinta */
  --ink-950: #0e2830;
  --ink-800: #24404a;
  --ink-600: #58707a;
  --ink-400: #8ea3aa;

  /* Superficies */
  --surface:       #ffffff;
  --surface-soft:  #f6f9f9;
  --surface-muted: #eaf0f1;

  /* Marca (teal) */
  --brand-700: #174f5f;
  --brand-600: #23697a;
  --brand-500: #31849a;
  --brand-100: #e0f2f7;

  /* Acento ambar - somente CTA principal */
  --accent-500: #d49b48;
  --accent-100: #fff3da;

  /* Semantico */
  --success-600: #1d6b4e;
  --success-100: #e1f4ec;
  --danger-600:  #a03d3d;
  --danger-100:  #fceaea;
  --warning-600: #8a5b1a;
  --warning-100: #fff1d6;

  /* Bordas e sombras */
  --line:      #d4e1e3;
  --shadow-xs: 0 2px 8px rgba(14, 40, 48, 0.06);
  --shadow-sm: 0 6px 20px rgba(14, 40, 48, 0.09);
  --shadow-lg: 0 20px 60px rgba(14, 40, 48, 0.13);

  /* Raios - apenas 3 valores */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);

  /* Espacamento (escala de 4px) */
  --sp-1:  4px;  --sp-2:  8px;  --sp-3: 12px;
  --sp-4: 16px;  --sp-5: 20px;  --sp-6: 24px;
  --sp-8: 32px;  --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;

  /* Layout */
  --container: 1180px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; text-size-adjust: 100%; -webkit-text-size-adjust: 100%; touch-action: manipulation; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--surface-soft);
  color: var(--ink-950);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
input, select, textarea { font-size: 16px; }
a { color: inherit; }

/* Marca */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--brand-700); color: #fff; font-size: 0.78rem; letter-spacing: -0.02em; }

/* Foco acessivel */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible { outline: 2.5px solid rgba(49, 132, 154, 0.4); outline-offset: 3px; }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; translate: 0 -160%; border-radius: var(--r-sm); background: var(--ink-950); color: #fff; padding: 10px 14px; text-decoration: none; }
.skip-link:focus { translate: 0; }

/* Layout */
.container { width: min(var(--container), calc(100% - 32px)); margin-inline: auto; }
.section    { padding-block: clamp(56px, 8vw, 104px); }
.section-sm { padding-block: clamp(32px, 5vw, 64px); }

/* Eyebrow */
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--brand-600); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; }

/* Escala tipografica */
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.1; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.4rem); line-height: 1.15; letter-spacing: -0.03em; }
h3 { font-size: clamp(1.08rem, 1.8vw, 1.28rem); line-height: 1.25; letter-spacing: -0.015em; }
.lead  { max-width: 640px; color: var(--ink-600); font-size: clamp(1rem, 1.8vw, 1.1rem); line-height: 1.65; }
.muted { color: var(--ink-600); }
.small { font-size: 0.875rem; }
.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; }

/* Botoes */
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--r-sm); padding: 0.72rem 1.1rem; background: var(--brand-700); color: #fff; font-weight: 700; font-size: 0.95rem; line-height: 1.2; text-decoration: none; cursor: pointer; transition: translate 140ms ease, box-shadow 140ms ease, background-color 140ms ease; }
.button:hover { translate: 0 -1px; box-shadow: var(--shadow-sm); background: var(--brand-600); }
.button:active { translate: 0; box-shadow: none; }
.button-primary   { background: var(--accent-500); color: var(--ink-950); }
.button-primary:hover { background: #c98e3c; }
.button-secondary { background: var(--surface); border-color: var(--line); color: var(--ink-950); }
.button-secondary:hover { background: var(--surface-muted); }
.button-ghost  { background: transparent; border-color: transparent; color: var(--brand-700); }
.button-ghost:hover { background: var(--brand-100); }
.button-danger { background: var(--danger-600); }
.button-danger:hover { background: #8f3535; }
.button-small  { min-height: 38px; padding: 0.52rem 0.85rem; font-size: 0.875rem; }
.button-block  { width: 100%; }

/* Icon Box */
.icon-box { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: var(--r-sm); background: var(--surface-muted); color: var(--brand-700); }

/* Cards */
.card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-xs); }

/* Campos de formulario */
.field { display: grid; gap: 6px; }
.field label { color: var(--ink-800); font-size: 0.875rem; font-weight: 700; }
.field input,
.field select,
.field textarea,
.select { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink-950); padding: 0.7rem 0.8rem; transition: border-color 120ms ease; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.select:focus { border-color: var(--brand-500); outline: 2.5px solid rgba(49, 132, 154, 0.14); }
.field-error { min-height: 18px; color: var(--danger-600); font-size: 0.82rem; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; background: var(--surface-muted); color: var(--ink-800); padding: 4px 9px; font-size: 0.76rem; font-weight: 700; }
.badge-success { background: var(--success-100); color: var(--success-600); }
.badge-warning { background: var(--warning-100); color: var(--warning-600); }
.badge-danger  { background: var(--danger-100);  color: var(--danger-600); }

/* Toasts */
.toast-region { position: fixed; top: 16px; right: 16px; z-index: 999; display: grid; gap: 8px; width: min(340px, calc(100% - 32px)); }
.toast { border: 1px solid var(--line); border-left: 3px solid var(--brand-500); border-radius: var(--r-sm); background: #fff; box-shadow: var(--shadow-lg); padding: 12px 14px; animation: toast-in 160ms ease-out; }
.toast.error   { border-left-color: var(--danger-600); }
.toast.success { border-left-color: var(--success-600); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* Empty state */
.empty-state { display: grid; justify-items: center; gap: 10px; padding: clamp(28px, 5vw, 56px) 18px; text-align: center; }
.empty-state .icon-box { width: 54px; height: 54px; border-radius: var(--r-md); }

@media (max-width: 640px) {
  .container { width: min(100% - 20px, var(--container)); }
  .button { min-height: 48px; }
  .mobile-block { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* === TEMA ESCURO (Dark Mode) === */
[data-theme="dark"] {
  /* Cores de tinta (invertidas) */
  --ink-950: #fbfdfd;
  --ink-800: #eaf0f1;
  --ink-600: #9cb1b8;
  --ink-400: #58707a;

  /* Superficies (escuras) */
  --surface:       #152024;
  --surface-soft:  #0e1619;
  --surface-muted: #1d2c33;

  /* Marca (ajustada para contraste no escuro) */
  --brand-700: #4ab3ce;
  --brand-600: #3a9db7;
  --brand-500: #31849a;
  --brand-100: #1a3c46;

  /* Bordas */
  --line: #293e47;
  
  /* Badges */
  --success-100: #103323;
  --success-600: #42bd8c;
  --danger-100:  #451717;
  --danger-600:  #e06767;
  --warning-100: #452c0a;
  --warning-600: #dfa547;
  
  /* Ajustes gerais do dark mode */
  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.5);
  
  color-scheme: dark;
}

[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .select,
[data-theme="dark"] .toast {
  background: var(--surface);
  color: var(--ink-950);
}
