/* ============================
   Otmow — Estilos Gerais
   ============================ */

:root {
  --primary:       #2e72f0;
  --primary-dark:  #1a5ce0;
  --primary-light: #eef4ff;
  --secondary:     #0f172a;
  --accent:        #06b6d4;
  --green:         #10b981;
  --red:           #ef4444;
  --orange:        #f97316;
  --yellow:        #eab308;
  --purple:        #8b5cf6;
  --teal:          #14b8a6;
  --gray-50:       #f8fafc;
  --gray-100:      #f1f5f9;
  --gray-200:      #e2e8f0;
  --gray-300:      #cbd5e1;
  --gray-400:      #94a3b8;
  --gray-500:      #64748b;
  --gray-600:      #475569;
  --gray-700:      #334155;
  --gray-800:      #1e293b;
  --gray-900:      #0f172a;
  --white:         #ffffff;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.14);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --transition:    .2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  user-select: none;
}
.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--primary);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}
.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

.header-nav { display: flex; gap: 4px; }
.header-nav a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  font-size: .9rem;
  transition: background var(--transition), color var(--transition);
}
.header-nav a:hover { background: var(--primary-light); color: var(--primary); }

.btn-menu-mobile { display: none; background: none; border: none; cursor: pointer; font-size: 1.4rem; color: var(--gray-700); }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #060e1f 0%, #0d2360 50%, #1a5ce0 100%);
  color: #fff;
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}

.badge-hero {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  padding: 5px 14px;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #a5f3fc;
}

.hero-text h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 18px;
}
.gradient-text {
  background: linear-gradient(90deg, #38bdf8, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-text p { color: #93c5fd; font-size: 1.05rem; margin-bottom: 28px; max-width: 520px; }

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  padding: 14px 20px;
  min-width: 200px;
  backdrop-filter: blur(8px);
}
.stat-icon { font-size: 1.6rem; }
.stat-icon.green { color: #34d399; }
.stat-icon.blue  { color: #60a5fa; }
.stat-icon.yellow{ color: #fbbf24; }
.stat-label { display: block; font-size: .78rem; color: #93c5fd; }
.stat-value { display: block; font-size: 1.1rem; font-weight: 700; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(46,114,240,.35); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-200); }

.btn-sm { padding: 7px 14px; font-size: .82rem; }

/* ===== SECTIONS ===== */
.section { padding: 72px 0; }
.section-dark { background: var(--gray-900); color: #fff; }
.section-alt  { background: var(--gray-100); }

.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.section-header h2 i { color: var(--primary); }
.section-header p { color: var(--gray-500); font-size: 1rem; }
.section-header.light h2 { color: #fff; }
.section-header.light h2 i { color: #60a5fa; }
.section-header.light p { color: var(--gray-400); }

/* ===== SIMULATOR LAYOUT ===== */
.simulator-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

/* ===== FORM CARD ===== */
.form-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.form-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gray-100);
}
.form-section-title i { color: var(--primary); }
.optional-tag {
  font-size: .72rem;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-500);
  padding: 2px 8px;
  border-radius: 100px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-group:last-child { margin-bottom: 0; }

label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46,114,240,.12);
}
input.invalid, select.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
input.valid { border-color: var(--green); }

.input-prefix, .input-suffix {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-prefix:focus-within, .input-suffix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46,114,240,.12);
}
.input-prefix span, .input-suffix span {
  padding: 10px 12px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: .88rem;
  font-weight: 600;
  border: none;
  white-space: nowrap;
}
.input-prefix input, .input-suffix input {
  flex: 1;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.field-error {
  font-size: .78rem;
  color: var(--red);
  display: none;
}
.field-error.show { display: block; }

/* Checkbox */
input[type="checkbox"] {
  width: auto;
  margin-right: 6px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Tooltip */
.tooltip-wrap { position: relative; cursor: pointer; }
.tooltip-wrap i { color: var(--gray-400); font-size: .85rem; }
.tooltip-text {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: #fff;
  font-size: .75rem;
  font-weight: 400;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 10;
}
.tooltip-wrap:hover .tooltip-text { opacity: 1; }

/* Aportes adicionais */
.aporte-item {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
  padding: 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}
.btn-remove-aporte {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--red);
  font-size: 1.1rem;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.btn-remove-aporte:hover { background: #fee2e2; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

/* ===== QUICK SUMMARY ===== */
.quick-summary {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 80px;
  overflow: hidden;
}
.qs-header {
  background: linear-gradient(135deg, var(--primary), #1a5ce0);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.qs-header i { font-size: 1.3rem; }
.qs-body { padding: 16px 20px; }
.qs-placeholder { color: var(--gray-400); font-size: .85rem; text-align: center; padding: 16px 0; }

.qs-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .85rem;
}
.qs-item:last-child { border-bottom: none; }
.qs-item span:first-child { color: var(--gray-500); }
.qs-item strong { color: var(--gray-800); font-weight: 600; }

.tax-table-mini { padding: 16px 20px; border-top: 1px solid var(--gray-100); }
.tax-table-mini h4 { font-size: .82rem; font-weight: 700; margin-bottom: 10px; color: var(--gray-600); display: flex; align-items: center; gap: 6px; }
.tax-table-mini table { width: 100%; font-size: .78rem; border-collapse: collapse; }
.tax-table-mini td { padding: 4px 0; }
.tax-table-mini .rate { text-align: right; font-weight: 700; }
.tax-table-mini .rate.red    { color: var(--red); }
.tax-table-mini .rate.orange { color: var(--orange); }
.tax-table-mini .rate.yellow { color: var(--yellow); }
.tax-table-mini .rate.green  { color: var(--green); }

/* ===== RESULT CARDS ===== */
.result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.res-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition);
}
.res-card:hover { transform: translateY(-3px); }
.res-card.primary { border-top: 3px solid var(--primary); }
.res-card.green   { border-top: 3px solid var(--green); }
.res-card.red     { border-top: 3px solid var(--red); }
.res-card.blue    { border-top: 3px solid var(--accent); }
.res-card.purple  { border-top: 3px solid var(--purple); }
.res-card.teal    { border-top: 3px solid var(--teal); }
.res-card-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.res-card.primary .res-card-icon { color: #93c5fd; }
.res-card.green   .res-card-icon { color: #6ee7b7; }
.res-card.red     .res-card-icon { color: #fca5a5; }
.res-card.blue    .res-card-icon { color: #67e8f9; }
.res-card.purple  .res-card-icon { color: #c4b5fd; }
.res-card.teal    .res-card-icon { color: #5eead4; }
.res-label { display: block; font-size: .75rem; color: var(--gray-400); margin-bottom: 3px; }
.res-value { display: block; font-size: 1.05rem; font-weight: 700; color: #fff; }

/* ===== CHARTS GRID ===== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.chart-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 24px;
}
.chart-card h3 {
  font-size: .95rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-card h3 i { color: #60a5fa; }
.chart-card.span-full { grid-column: 1 / -1; }

/* ===== TABLE CARD ===== */
.table-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}
.table-header h3 { font-size: .95rem; font-weight: 700; color: #e2e8f0; display: flex; align-items: center; gap: 8px; }
.table-header h3 i { color: #60a5fa; }
.export-btns { display: flex; gap: 8px; }

.table-responsive { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.data-table th {
  background: rgba(255,255,255,.08);
  color: var(--gray-300);
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  color: #e2e8f0;
}
.data-table tr:hover td { background: rgba(255,255,255,.04); }
.data-table .positive { color: #34d399; font-weight: 600; }
.data-table .negative { color: #f87171; font-weight: 600; }

/* ===== COMPARE CARD ===== */
.compare-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.compare-card h3 { font-size: .95rem; font-weight: 700; color: #e2e8f0; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.compare-card h3 i { color: #60a5fa; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.compare-item {
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-sm);
  padding: 18px;
  border-left: 4px solid var(--primary);
}
.compare-item h4 { color: #93c5fd; font-size: .9rem; margin-bottom: 12px; }
.compare-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: .82rem;
  color: #94a3b8;
}
.compare-row strong { color: #e2e8f0; }

/* ===== ALERTS ===== */
.alert-section { margin-top: 8px; display: flex; flex-direction: column; gap: 12px; }
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  line-height: 1.5;
}
.alert i { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert-info { background: rgba(37,99,235,.15); border: 1px solid rgba(37,99,235,.25); color: #93c5fd; }
.alert-warning { background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.25); color: #fbbf24; }

/* ===== IR TABLE PAGE ===== */
.ir-table-wrapper { overflow-x: auto; }
.ir-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.ir-table th {
  background: var(--primary);
  color: #fff;
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
}
.ir-table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-200); }
.ir-table tr:hover td { background: var(--gray-50); }
.row-red    td { border-left: 4px solid var(--red); }
.row-orange td { border-left: 4px solid var(--orange); }
.row-yellow td { border-left: 4px solid var(--yellow); }
.row-green  td { border-left: 4px solid var(--green); }
.ir-note { margin-top: 12px; font-size: .8rem; color: var(--gray-500); }

/* ===== CDI CARD ===== */
.cdi-card {
  border-left: 4px solid var(--primary);
  background: linear-gradient(to right, var(--primary-light), #fff);
}
.cdi-info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(46,114,240,.08);
  border: 1px solid rgba(46,114,240,.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 12px;
  font-size: .85rem;
  color: var(--primary-dark);
  font-weight: 500;
}
.cdi-info-banner i { color: var(--primary); font-size: 1rem; }

.chart-cdi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.chart-cdi-sub {
  font-size: .8rem;
  color: var(--gray-400);
  margin-top: 4px;
  font-weight: 400;
}
.cdi-legend-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.cdi-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid;
}
.cdi-badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== ABOUT ===== */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.about-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}
.about-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.about-icon {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 14px;
  display: block;
}
.about-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.about-card p { font-size: .88rem; color: var(--gray-600); line-height: 1.6; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 32px 0;
}
.footer-inner { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.footer-logo { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; font-weight: 700; color: #fff; }
.footer-copy { font-size: .85rem; }
.footer-disclaimer { font-size: .78rem; color: var(--gray-600); }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp .4s ease forwards; }

/* ===== LOADING SPINNER ===== */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== CDI CHART DARK (seção resultados) ===== */
.section-dark .chart-cdi-header h3 {
  font-size: .95rem;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-dark .chart-cdi-header h3 i { color: #60a5fa; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .simulator-layout { grid-template-columns: 1fr; }
  .quick-summary { position: static; }
  .hero-content { grid-template-columns: 1fr; }
  .hero-cards { flex-direction: row; flex-wrap: wrap; }
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-nav { display: none; }
  .btn-menu-mobile { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .result-cards { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 48px 0 40px; }
  .hero-ctas { flex-direction: column; }
  .section { padding: 48px 0; }
  .table-header { flex-direction: column; align-items: flex-start; }
  .aporte-item { grid-template-columns: 1fr 1fr; }
  .aporte-item .btn-remove-aporte { grid-column: span 2; justify-self: end; }
  .chart-cdi-header { flex-direction: column; }
  .cdi-legend-badges { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 400px) {
  .result-cards { grid-template-columns: 1fr; }
}
