/* ========================================================
   taxa-juros.css — Página da Taxa CDI/Over
   ======================================================== */

.tj-period-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  margin-top: 1rem;
}

.tj-date-range {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.tj-date-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tj-date-field label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary, #555);
}

.tj-date-field input[type="date"] {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1.5px solid var(--border, #d1d5db);
  background: var(--card-bg, #fff);
  color: var(--text-primary, #1a1a2e);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: text;
  outline: none;
  transition: border-color 0.15s;
}

.tj-date-field input[type="date"]:focus {
  border-color: var(--accent, #2563eb);
}

.tj-period-desc {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent, #2563eb);
  white-space: nowrap;
  padding: 0.3rem 0.6rem;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 6px;
}

.taxa-juros-main {
  padding: 2rem 1rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* Hero */
.taxa-juros-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.taxa-juros-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary, #1a1a2e);
  margin-bottom: 0.5rem;
  min-width: 80%;
}

.taxa-juros-subtitle {
  font-size: 1rem;
  color: var(--text-secondary, #555);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Card principal */
.taxa-juros-card {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
}

/* Header do card */
.taxa-juros-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Bloco de valor atual */
.taxa-juros-current {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tj-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #888);
  font-weight: 600;
}

.tj-value {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--accent, #2563eb);
  line-height: 1;
}

.tj-date {
  font-size: 0.82rem;
  color: var(--text-muted, #888);
}


/* Wrapper do gráfico */
.taxa-juros-chart-wrapper {
  position: relative;
  width: 100%;
  height: 340px;
}

#tj-chart {
  width: 100% !important;
  height: 100% !important;
}

/* Loading */
.tj-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--card-bg, #fff);
  color: var(--text-secondary, #555);
  font-size: 0.9rem;
  border-radius: 8px;
}

.tj-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border, #d1d5db);
  border-top-color: var(--accent, #2563eb);
  border-radius: 50%;
  animation: tj-spin 0.8s linear infinite;
}

@keyframes tj-spin {
  to { transform: rotate(360deg); }
}

/* Error */
.tj-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--error, #dc2626);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.hidden {
  display: none !important;
}

/* Cards de informação */
.taxa-juros-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.tj-info-card {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
}

.tj-info-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a2e);
  margin-bottom: 0.75rem;
}

.tj-info-card p {
  font-size: 0.92rem;
  color: var(--text-secondary, #555);
  line-height: 1.7;
  margin: 0;
}

.tj-info-card code {
  background: var(--code-bg, #f3f4f6);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent, #2563eb);
}

/* Responsivo */
@media (max-width: 600px) {
  .taxa-juros-card {
    padding: 1.25rem 1rem;
  }

  .taxa-juros-chart-wrapper {
    height: 260px;
  }

  .taxa-juros-header {
    flex-direction: column;
  }
}
