/* ===== Reset + base ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ===== Header ===== */
.header {
  padding: 1.5rem 2rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand__logo {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.brand__name { margin: 0; font-size: 1.25rem; font-weight: 700; }
.brand__tagline { margin: 0; font-size: 0.875rem; color: #64748b; }
.header__whats {
  background: #25d366;
  color: white;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.header__whats:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* ===== Layout principal ===== */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(380px, 1.4fr);
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

/* ===== Chat (esquerda) ===== */
.chat {
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 600px;
}
.chat__header {
  padding: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.chat__header h2 { margin: 0 0 0.25rem 0; font-size: 1.125rem; }
.chat__hint { margin: 0; color: #64748b; font-size: 0.8125rem; }
.chat__counter {
  background: #f1f5f9;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}
.chat__counter.warn { background: #fef3c7; color: #92400e; }
.chat__counter.full { background: #fee2e2; color: #991b1b; }

.chat__log {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 60vh;
}
.msg {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  max-width: 85%;
  font-size: 0.9375rem;
}
.msg--bot {
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}
.msg--user {
  background: #10b981;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg--typing {
  background: #f1f5f9;
  color: #64748b;
  font-style: italic;
}
.msg--err {
  background: #fee2e2;
  color: #991b1b;
}
.msg strong { font-weight: 700; }

.chat__form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
#chatInput {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
}
#chatInput:focus { outline: 2px solid #10b981; outline-offset: 1px; }
#chatSend {
  background: #10b981;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  transition: background 0.15s;
}
#chatSend:hover { background: #059669; }
#chatSend:disabled { background: #94a3b8; cursor: not-allowed; }

.chat__disclaimer {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: #94a3b8;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

/* ===== Sidebar (direita) ===== */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

/* ===== 3 blocos de tópicos ===== */
.topics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 640px) {
  .topics { grid-template-columns: 1fr; }
}
.topic {
  padding: 1.25rem;
  border-radius: 14px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.topic:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
.topic h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.topic p { margin: 0; font-size: 0.8125rem; opacity: 0.95; flex: 1; }
.topic__icon { font-size: 1.75rem; line-height: 1; }
.topic__cta { font-weight: 600; font-size: 0.8125rem; margin-top: 0.5rem; }

.topic--green  { background: linear-gradient(135deg, #10b981, #047857); }
.topic--blue   { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.topic--purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

/* ===== Calculadora ===== */
.calc {
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.calc__header h2 { margin: 0 0 0.25rem 0; font-size: 1.25rem; }
.calc__header p { margin: 0; color: #64748b; font-size: 0.9375rem; }

.calc__input-row { display: flex; flex-direction: column; gap: 0.5rem; }
.calc__input-row label { font-weight: 600; font-size: 0.9375rem; }
.calc__input-group {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.25rem 0.75rem;
  transition: border-color 0.15s;
}
.calc__input-group:focus-within { border-color: #10b981; }
.calc__currency {
  font-weight: 700;
  color: #475569;
  padding: 0.5rem 0.5rem 0.5rem 0;
}
#betAmount {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  padding: 0.5rem 0;
  width: 100%;
}
#betAmount:focus { outline: none; }

/* ===== Blocos de resultado ===== */
.block {
  padding: 1.5rem;
  border-radius: 14px;
}
.block__title { margin: 0 0 0.75rem 0; font-size: 1.0625rem; font-weight: 700; }
.block p { margin: 0 0 0.75rem 0; font-size: 0.9375rem; }
.block p:last-child { margin-bottom: 0; }
.block__source {
  font-size: 0.75rem !important;
  opacity: 0.7;
  margin-top: 1rem !important;
  font-style: italic;
}

.block--dark {
  background: #0f172a;
  color: #e2e8f0;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.3);
}
.block--dark .hl {
  background: #fbbf24;
  color: #0f172a;
  padding: 0.0625rem 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.block--blue {
  background: linear-gradient(135deg, #1e40af, #1e3a8a);
  color: #e0e7ff;
  box-shadow: 0 10px 30px rgba(30, 64, 175, 0.3);
}
.block--blue .hl {
  background: #fbbf24;
  color: #1e3a8a;
  padding: 0.0625rem 0.5rem;
  border-radius: 6px;
  font-weight: 700;
}
.block__intro { margin-bottom: 1.25rem !important; }

.invest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 640px) {
  .invest-grid { grid-template-columns: 1fr; }
}
.invest-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.invest-card__years {
  font-weight: 800;
  font-size: 1.125rem;
  color: #fbbf24;
  margin-bottom: 0.375rem;
}
.invest-card__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
  margin-top: 0.375rem;
}
.invest-card__contrib { font-size: 0.9375rem; font-weight: 600; }
.invest-card__final {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
}

/* ===== Footer ===== */
.footer {
  padding: 1.5rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.8125rem;
  border-top: 1px solid #e2e8f0;
  background: white;
}
.footer a { color: #10b981; font-weight: 600; }
