*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-y: scroll; }

:root {
  --bg: #ffffff;
  --bg2: #f7f7f5;
  --bg3: #eeeeed;
  --text: #1a1a18;
  --text2: #6b6b67;
  --border: rgba(0,0,0,0.08);
  --border2: rgba(0,0,0,0.18);
  --green: #1D9E75;
  --green-glow: rgba(29,158,117,0.15);
  --green-dark: #3B6D11;
  --blue: #185FA5;
  --amber: #BA7517;
  --red: #A32D2D;
  --purple: #534AB7;
  --purple-glow: rgba(83,74,183,0.1);
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
  --transition: 220ms ease-out;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151514;
    --bg2: #1e1e1c;
    --bg3: #282826;
    --text: #f0efea;
    --text2: #9a9a94;
    --border: rgba(255,255,255,0.08);
    --border2: rgba(255,255,255,0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.4);
  }
}

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

/* ---- Base ---- */

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 2rem 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Page layout (3 columns with ad rails) ---- */

.page-layout {
  display: flex;
  justify-content: center;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.container { max-width: 720px; width: 100%; flex: 1; min-width: 0; }

.ad-rail {
  width: 160px;
  flex-shrink: 0;
  padding-top: 60px;
}

.ad-rail--left { order: -1; }
.ad-rail--right { order: 1; }

.ad-slot--vertical {
  position: sticky;
  top: 2rem;
  width: 160px;
  min-height: 600px;
  border-radius: var(--radius-md);
  background: var(--bg2);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.ad-slot--vertical:hover { opacity: 0.7; }

/* Placeholder text for empty ad slots */
.ad-slot--vertical::after {
  content: 'Ad';
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ad-slot--inline {
  width: 100%;
  min-height: 90px;
  margin: 16px 0;
  border-radius: var(--radius-md);
  background: var(--bg2);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
}

.ad-slot--inline::after {
  content: 'Ad';
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Hide placeholder styling when ad is loaded (has children) */
.ad-slot:not(:empty)::after { display: none; }
.ad-slot:not(:empty) { opacity: 1; background: transparent; border-style: solid; }

/* Hide rails on smaller screens */
@media (max-width: 1100px) {
  .ad-rail { display: none; }
  .page-layout { gap: 0; }
}

/* On mobile, inline ad becomes smaller */
@media (max-width: 500px) {
  .ad-slot--inline { min-height: 100px; }
}

h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ---- Abas ---- */

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.tab-btn {
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  border-radius: 6px 6px 0 0;
  position: relative;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--bg2);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--green);
}

.tab-content {
  display: none;
  animation: fadeIn 300ms ease-out;
}

.tab-content.active { display: block; }

/* ---- Animações ---- */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-animated {
  animation: slideUp 350ms ease-out;
}

/* ---- Seções ---- */

.section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 24px 0 12px;
}

.section-title:first-child { margin-top: 0; }

.section-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ---- Formulário de dados ---- */

.data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.data-field { display: flex; flex-direction: column; gap: 5px; }

.data-field label {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
}

.data-field input[type=number],
.data-field input[type=text] {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  width: 100%;
  font-family: inherit;
  -moz-appearance: textfield;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.data-field input[type=number]::-webkit-outer-spin-button,
.data-field input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

.data-field input[type=number]:hover,
.data-field input[type=text]:hover {
  border-color: var(--text2);
}

.data-field input[type=number]:focus,
.data-field input[type=text]:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
  background: var(--bg);
}

.data-hint { font-size: 10px; color: var(--text2); line-height: 1.4; }
.data-hint a { color: var(--green); text-decoration: none; font-weight: 500; }
.data-hint a:hover { text-decoration: underline; }

.data-field select {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b67' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.data-field select:hover { border-color: var(--text2); }
.data-field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); background-color: var(--bg); }

.data-field input[type=range] { margin-top: 4px; }

.inline-currency {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  width: 120px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
  -moz-appearance: textfield;
}

.inline-currency:hover { border-color: var(--border2); background: var(--bg3); }
.inline-currency:focus { border-color: var(--green); background: var(--bg); }

.slider-value-row { display: flex; align-items: center; }

.acum-label {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 16px;
  background: var(--bg2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  border: 1px solid var(--border);
  transition: background var(--transition);
}

.acum-label strong { color: var(--text); font-weight: 600; }

/* ---- Intro text ---- */

.intro-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 16px;
}

.intro-updated {
  font-size: 11px;
  color: var(--green);
  font-weight: 500;
}

/* ---- Sliders (controles) ---- */

.ctrl { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }

.cg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg2);
  border: 1px solid var(--border);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.cg:hover { border-color: var(--border2); }

.cl { font-size: 11px; color: var(--text2); font-weight: 500; line-height: 1.3; }

.cv {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

input[type=range] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: var(--bg3);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
  transition: background var(--transition);
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  border: 3px solid var(--bg);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border2);
  cursor: grab;
  transition: transform var(--transition), box-shadow var(--transition);
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--green);
}

input[type=range]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  border: 3px solid var(--bg);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border2);
  cursor: grab;
}

input[type=range]:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

/* ---- Total bar ---- */

.total-bar {
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.total-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.total-bar:hover {
  box-shadow: 0 0 20px var(--green-glow);
}

.total-label {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.total-value {
  font-size: 34px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.total-sub {
  font-size: 13px;
  color: var(--text2);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ---- Grids ---- */

.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }

/* ---- Cards (.bk) ---- */

.bk {
  background: var(--bg2);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  cursor: default;
}

.bk:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.bk-label { font-size: 11px; color: var(--text2); margin-bottom: 6px; line-height: 1.4; font-weight: 500; }

.bk-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: color var(--transition);
}

.bk-value.green { color: var(--green); }
.bk-value.teal  { color: var(--green-dark); }
.bk-value.blue  { color: var(--blue); }
.bk-value.red   { color: var(--red); }

.bk-sub { font-size: 11px; color: var(--text2); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---- Barra de composição ---- */

.stacked-bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  margin: 12px 0 8px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.stacked-bar > div {
  transition: width 500ms ease-out;
}

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 16px;
}

.leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* ---- Highlight (restituição) ---- */

.highlight {
  border-left: 3px solid var(--purple);
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--bg2);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  transition: background var(--transition), box-shadow var(--transition);
}

.highlight:hover {
  background: var(--bg3);
  box-shadow: inset 3px 0 0 var(--purple);
}

.highlight-label { font-size: 11px; color: var(--text2); margin-bottom: 8px; font-weight: 500; }
.highlight-row { display: flex; gap: 24px; flex-wrap: wrap; align-items: baseline; }
.highlight-item span:first-child { font-size: 12px; color: var(--text2); }

.highlight-val {
  font-size: 17px;
  font-weight: 600;
  color: var(--purple);
  font-variant-numeric: tabular-nums;
}

/* ---- Gráfico ---- */

.chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
  margin-bottom: 8px;
  padding: 8px;
  background: var(--bg2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* ---- Resumo compacto (aba Simulador) ---- */

.dados-resumo {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text2);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 20px;
  align-items: center;
  transition: border-color var(--transition);
}

.dados-resumo:hover { border-color: var(--border2); }

.dados-resumo strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dados-resumo .edit-link {
  margin-left: auto;
  color: var(--green);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  background: none;
  font-family: inherit;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}

.dados-resumo .edit-link:hover {
  background: var(--green-glow);
}

.dados-resumo .edit-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

/* ---- Botões de persistência ---- */

.persist-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.persist-row button {
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.persist-row button:hover {
  background: var(--bg3);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.persist-row button:active {
  transform: translateY(0);
}

.persist-row button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.persist-row .hint { font-size: 11px; color: var(--text2); }

/* ---- Glassmorphism (dark mode) ---- */

@media (prefers-color-scheme: dark) {
  .total-bar,
  .highlight,
  .chart-wrap {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(30,30,28,0.8);
  }
  .bk,
  .cg {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(30,30,28,0.7);
  }
}

/* ---- Disclaimer ---- */

.disclaimer {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.6;
  padding: 16px;
  background: var(--bg2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.disclaimer strong { color: var(--text2); font-weight: 500; }
.disclaimer + .disclaimer { margin-top: 8px; font-size: 10px; line-height: 1.5; }

/* ---- Aba Ajuda ---- */

.help-section { margin-bottom: 25px; }

.help-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text2);
}

.help-block p { margin-bottom: 10px; }
.help-block p:last-child { margin-bottom: 0; }
.help-block strong { color: var(--text); font-weight: 600; }
.help-block em { font-style: italic; }

.help-block ul {
  padding-left: 20px;
  margin: 10px 0;
}

.help-block ul li {
  margin-bottom: 6px;
  line-height: 1.6;
}
.help-block ul li:last-child { margin-bottom: 0; }

.help-block a {
  color: var(--green);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition);
}

.help-block a:hover { text-decoration: underline; color: var(--text); }

.help-block a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}

.help-formula {
  font-family: 'Courier New', monospace;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.help-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 8px 0;
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.help-table th,
.help-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.help-table th {
  font-weight: 600;
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  background: var(--bg2);
}

.help-table td { color: var(--text2); }
.help-table--wrap td { white-space: normal; min-width: 120px; }
.help-table--wrap td:first-child { font-weight: 500; color: var(--text); white-space: nowrap; }
.help-table tr:last-child td { border-bottom: none; }

.help-table tbody tr {
  transition: background var(--transition);
}

.help-table tbody tr:hover {
  background: var(--bg3);
}

.help-source {
  font-size: 10px;
  color: var(--text2);
  font-style: italic;
  margin-top: 6px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--green);
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color var(--transition);
}

.link-btn:hover { color: var(--text); }

.link-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- FAQ ---- */

.faq-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  transition: border-color var(--transition);
}

.faq-item:hover { border-color: var(--border2); }

.faq-item[open] { border-color: var(--green); }

.faq-item summary {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color var(--transition);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 18px;
  font-weight: 400;
  color: var(--text2);
  flex-shrink: 0;
  transition: transform var(--transition), color var(--transition);
}

.faq-item[open] summary::after {
  content: '-';
  color: var(--green);
}

.faq-item summary:hover { color: var(--green); }

.faq-item summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
  border-radius: var(--radius-md);
}

.faq-answer {
  padding: 0 16px 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text2);
}

.faq-answer p { margin-bottom: 8px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer strong { color: var(--text); }
.faq-answer ul { padding-left: 20px; margin: 8px 0; }
.faq-answer ul li { margin-bottom: 4px; }

/* ---- Wizard ---- */

.wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 300ms ease-out;
}

.wizard-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.25);
  overflow: hidden;
  animation: slideUp 350ms ease-out;
}

.wizard-progress {
  height: 3px;
  background: var(--bg3);
}

.wizard-progress-bar {
  height: 100%;
  background: var(--green);
  transition: width 400ms ease-out;
  border-radius: 0 3px 3px 0;
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px 0;
}

.wizard-step-label {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wizard-skip {
  font-size: 12px;
  color: var(--text2);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.wizard-skip:hover { color: var(--text); background: var(--bg2); }

.wizard-step {
  display: none;
  padding: 20px 24px;
}

.wizard-step.active { display: block; animation: fadeIn 250ms ease-out; }

.wizard-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.wizard-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 20px;
}

.wizard-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wizard-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wizard-field label {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
}

.wizard-field input,
.wizard-field select {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  width: 100%;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  -moz-appearance: textfield;
}

.wizard-field input::-webkit-outer-spin-button,
.wizard-field input::-webkit-inner-spin-button { -webkit-appearance: none; }

.wizard-field input:focus,
.wizard-field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.wizard-field select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b67' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* Profile cards */
.wizard-profiles {
  display: flex;
  gap: 10px;
}

.wizard-profile {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--bg2);
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.wizard-profile:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

.wizard-profile.selected {
  border-color: var(--green);
  background: var(--green-glow);
}

.wizard-profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.wizard-profile-desc {
  font-size: 11px;
  color: var(--text2);
  text-align: center;
  line-height: 1.3;
}

.wizard-profile-ret {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}

.wizard-welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.wizard-welcome-actions .wizard-btn {
  width: 100%;
  text-align: center;
}

/* Actions */
.wizard-actions {
  display: flex;
  gap: 10px;
  padding: 0 24px 24px;
  justify-content: flex-end;
}

.wizard-btn {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.wizard-btn--back {
  background: var(--bg2);
  border: 1px solid var(--border2);
  color: var(--text);
}

.wizard-btn--back:hover { background: var(--bg3); }

.wizard-btn--next {
  background: var(--green);
  border: none;
  color: #fff;
}

.wizard-btn--next:hover {
  box-shadow: 0 4px 12px var(--green-glow);
  transform: translateY(-1px);
}

.wizard-btn:active { transform: translateY(0); }

.wizard-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

@media (max-width: 500px) {
  .wizard-card { border-radius: 12px; }
  .wizard-step { padding: 16px 18px; }
  .wizard-actions { padding: 0 18px 18px; }
  .wizard-fields { grid-template-columns: 1fr; }
  .wizard-profiles { flex-direction: column; }
  .wizard-title { font-size: 16px; }
}

/* ---- Share ---- */

.share-row {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.share-btn {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.share-btn:hover {
  background: var(--bg3);
  border-color: var(--green);
  transform: translateY(-1px);
}

.share-btn:active { transform: translateY(0); }

.share-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ---- Back link ---- */

.back-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--green);
  text-decoration: none;
  padding: 8px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg2);
  transition: background var(--transition), border-color var(--transition);
}

.back-link:hover {
  background: var(--bg3);
  border-color: var(--green);
}

.back-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ---- Footer ---- */

.site-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px 0 8px;
  font-size: 11px;
  color: var(--text2);
}

.site-footer a {
  color: var(--text2);
  text-decoration: none;
  transition: color var(--transition);
}

.site-footer a:hover { color: var(--green); }
.footer-sep { opacity: 0.4; }

/* ---- Toast ---- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  z-index: 2000;
  opacity: 0;
  transition: opacity 300ms ease, transform 300ms ease;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--success {
  background: var(--green);
  color: #fff;
}

.toast--error {
  background: var(--red);
  color: #fff;
}

/* ---- Responsivo ---- */

@media (max-width: 500px) {
  body { padding: 1.25rem 0.75rem; }
  .ctrl { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .data-grid { grid-template-columns: 1fr; }
  .dados-resumo { font-size: 11px; gap: 8px; padding: 8px 12px; }
  .total-value { font-size: 28px; }
  .highlight-row { gap: 12px; }
  h1 { font-size: 20px; }
  .help-block { padding: 14px; font-size: 12px; }
  .help-table th, .help-table td { padding: 8px 8px; font-size: 11px; }
  .help-formula { font-size: 12px; padding: 8px 10px; }
}
