/* ==========================================================================
   FINANCASINTELIGENTES.COM.BR - UI Components & Interactive Styles
   ========================================================================== */

/* Hero Component */
.hero-section {
  padding: 4rem 0 3rem;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: var(--primary-glow);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  max-width: 680px;
  margin: 1.25rem auto 2.5rem;
  color: var(--text-muted);
}

/* Category Filter Tabs */
.category-filter-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* Search Bar */
.search-box-wrapper {
  max-width: 540px;
  margin: 0 auto 3rem;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3.2rem;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.search-icon-inside {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* Product Cards Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
  margin-bottom: 4rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  backdrop-filter: blur(10px);
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-color-glow);
  box-shadow: var(--shadow-md);
}

.product-card.popular-card {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.card-top-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.product-badge {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.product-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.product-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.highlights-list {
  list-style: none;
  margin-bottom: 1.5rem;
}

.highlights-list li {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.highlights-list li::before {
  content: '✓';
  color: var(--primary);
  font-weight: 800;
}

.tag-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.tag-pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-accent {
  background: var(--accent);
  color: #0F172A;
  font-weight: 700;
}

.btn-accent:hover {
  background: #E59000;
}

.btn-full {
  width: 100%;
}

/* Article Cards */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.article-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.article-img-wrapper {
  width: 100%;
  height: 190px;
  overflow: hidden;
  position: relative;
}

.article-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .article-img-wrapper img {
  transform: scale(1.06);
}

.article-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.article-title {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.article-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

/* Calculator Component */
.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
  box-shadow: var(--shadow-md);
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.input-field {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
}

.input-field:focus {
  border-color: var(--primary);
}

.calc-results {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.result-metric {
  margin-bottom: 1.5rem;
}

.result-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-value {
  font-size: 2.2rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--primary);
}

/* Article Details & Single Page */
.article-full-container {
  max-width: 840px;
  margin: 3rem auto;
}

.article-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.article-full-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-main);
}

.article-full-content h2 {
  margin: 2.5rem 0 1rem;
}

.article-full-content h3 {
  margin: 2rem 0 0.75rem;
}

.article-full-content p {
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.article-cta-box {
  background: var(--bg-secondary);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin: 3rem 0;
  text-align: center;
}

/* Redirect Page Styling */
.redirect-box {
  max-width: 500px;
  margin: 8rem auto;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 3rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.redirect-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 0 auto 2rem;
}

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

/* ==========================================================================
   Skeleton Loading Placeholders & Shimmer Animation (M3 - Refatoração CLS)
   ========================================================================== */

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    rgba(255, 255, 255, 0.08) 37%,
    var(--bg-secondary) 63%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
  border-radius: var(--radius-sm);
  display: block;
}

[data-theme="light"] .skeleton {
  background: linear-gradient(
    90deg,
    #E2E8F0 25%,
    #CBD5E1 37%,
    #E2E8F0 63%
  );
  background-size: 200% 100%;
}

/* Transição suave ao carregar conteúdo real */
.fade-in {
  animation: fadeIn 0.35s ease-in-out forwards;
}

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

/* Redefinição Resiliente de Imagens para Eliminação de CLS */
.article-img-wrapper {
  width: 100%;
  height: 190px;
  aspect-ratio: 16 / 9;
  min-height: 190px;
  overflow: hidden;
  position: relative;
  background: var(--bg-secondary);
}

.article-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  display: block;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

/* Main Article Image Container em artigo.html */
.article-main-img-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 260px;
  max-height: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  margin-bottom: 2.5rem;
  background: var(--bg-secondary);
}

.article-main-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  display: block;
}

/* ==========================================================================
   Calculadora Premium (Sliders, Donut SVG & Barra Empilhada)
   ========================================================================== */

.input-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.input-number-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
}

.currency-prefix, .currency-suffix {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.calc-num-input {
  width: 100px;
  border: none !important;
  background: transparent !important;
  text-align: right;
  padding: 0.2rem 0.3rem !important;
  font-weight: 700;
}

.calc-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border-color);
  outline: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.calc-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.calc-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Donut Chart & Metrics Layout */
.result-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.3rem 0.75rem;
  background: var(--primary-glow);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
}

.calc-chart-box {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.calc-svg-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.donut-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  border-radius: 50%;
}

.donut-segment {
  transition: stroke-dasharray 0.4s ease, stroke-dashoffset 0.4s ease;
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-pct {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.donut-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.calc-metrics-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.metric-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.dot-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.invested-dot { background: var(--secondary); }
.interest-dot { background: var(--primary); }

.text-invested { color: var(--text-main); font-weight: 700; }
.text-interest { color: var(--primary); font-weight: 800; }
.metric-pct { font-size: 0.78rem; color: var(--text-muted); }

/* Comparative Stacked Progress Bar */
.calc-progress-wrapper {
  margin-top: 1rem;
}

.calc-progress-bar {
  display: flex;
  height: 10px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-card);
}

.calc-bar-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.calc-bar-segment.invested { background: var(--secondary); }
.calc-bar-segment.interest { background: var(--primary); }

/* Premium 3D Elevation & Glassmorphism Hover */
.product-card, .article-card, .calculator-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.product-card:hover, .article-card:hover, .calculator-card:hover {
  transform: translateY(-4px) scale(1.008);
  border-color: var(--border-color-glow);
  box-shadow: 0 14px 28px -6px rgba(0, 0, 0, 0.25), 0 0 20px var(--primary-glow);
}

/* Button Ripple & Tactile Active Feedback */
.btn, .filter-btn, .theme-toggle-btn {
  position: relative;
  overflow: hidden;
  user-select: none;
}

.btn:active, .filter-btn:active, .theme-toggle-btn:active {
  transform: scale(0.97);
}

.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: btn-ripple-anim 0.6s linear;
  pointer-events: none;
}

@keyframes btn-ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

