/* ------------------------------------------------------------------
   Reset enxuto, tipografia e estrutura (header, nav, grid de conteudo).
   ------------------------------------------------------------------ */

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.25; }
p { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }
.is-positive { color: var(--positive); }
.is-negative { color: var(--negative); }
.is-accent { color: var(--accent); }
.is-right { text-align: right; }

/* --------------------------------------------------------------- Header */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: var(--header-height);
  padding: 0 var(--space-5);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: var(--space-3); }

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: var(--accent-text);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .02em;
}

.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__text strong { font-size: 15px; letter-spacing: -.01em; }
.brand__text small { color: var(--text-faint); font-size: 11px; }

.nav {
  display: flex;
  gap: var(--space-1);
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav__item {
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav__item:hover { background: var(--surface-hover); color: var(--text); }
.nav__item.is-active { background: var(--accent); color: var(--accent-text); }

.header__actions { display: flex; gap: var(--space-2); }

/* -------------------------------------------------------------- Conteudo */

.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-5);
}

.view { display: flex; flex-direction: column; gap: var(--space-4); }

.layout-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: var(--space-4);
  align-items: start;
}

.form-column,
.results,
.results-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.results-column { position: sticky; top: calc(var(--header-height) + var(--space-5)); }

@media (max-width: 1080px) {
  .layout-split { grid-template-columns: minmax(0, 1fr); }
  .results-column { position: static; }
}

@media (max-width: 640px) {
  .header { height: auto; flex-wrap: wrap; padding: var(--space-3); gap: var(--space-3); }
  .nav { order: 3; width: 100%; }
  .content { padding: var(--space-3); }
}
