/* ==========================================================
   DEXCONT — Calculadora Fator R
   Reaproveita o design system de css/style.css (cores, fontes,
   botões, espaçamentos). Este arquivo cobre apenas o que é
   específico desta página.

   PALETA: azul-marinho profundo como cor principal (fundos
   estruturais escuros) + teal/turquesa já existente no projeto
   como cor de destaque (botões, ícones, links, estados
   selecionados). Não usa verde-petróleo como fundo principal.
   Esta variável e estas regras existem apenas neste arquivo —
   não alteram css/style.css nem index.html.
   ========================================================== */
:root {
  --dex-navy: #0A1B31;
  --dex-navy-2: #13294a;
}

/* ---------- Header / Hero desta página ---------- */
.hero-wrapper.cfr-hero {
  background: linear-gradient(160deg, var(--dex-navy) 0%, var(--dex-navy-2) 55%, var(--dex-navy) 100%);
}
.cfr-hero .dropdown a:hover { color: var(--dex-navy); }
.cfr-hero .btn-primary { color: var(--dex-navy); }
.cfr-hero-ctas { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
.cfr-hero .hero-media { align-self: center; }
.cfr-hero .hero-photo { aspect-ratio: 3/4; }

/* ==========================================================
   SEÇÃO PRINCIPAL DA CALCULADORA
   ========================================================== */
.cfr-calc-section { padding: 100px 0; background: var(--gray-50); }
.cfr-calc-header { max-width: 640px; margin: 0 auto 50px; }

.cfr-calc-section [hidden] { display: none !important; }

.cfr-form-card {
  max-width: 680px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  padding: 44px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.cfr-question { display: flex; flex-direction: column; gap: 14px; animation: cfrFadeIn 0.3s ease; }
.cfr-reveal { animation: cfrFadeIn 0.35s ease; }
@keyframes cfrFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.cfr-label { font-weight: 700; font-size: 15.5px; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.cfr-optional { font-weight: 500; color: var(--gray-500); font-size: 13px; }
.cfr-help { font-size: 13px; color: var(--gray-500); display: flex; align-items: center; gap: 6px; }
.cfr-help i { color: var(--green-vibrant-dark); }

.cfr-input {
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.2s ease;
  width: 100%;
}
.cfr-input:focus { outline: none; border-color: var(--green-vibrant-dark); }

/* Check discreto em teal quando o campo é preenchido */
.cfr-question.is-filled .cfr-label::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--green-vibrant-dark);
  font-size: 12px;
  margin-left: 4px;
}
.cfr-question.is-filled .cfr-currency-field,
.cfr-question.is-filled .cfr-input { border-color: var(--green-vibrant-dark); }

/* Toggle SIM / NÃO */
.cfr-toggle-pair { display: flex; gap: 12px; }
.cfr-toggle-btn {
  flex: 1;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.cfr-toggle-btn:hover { border-color: var(--green-vibrant-dark); }
.cfr-toggle-btn.selected { background: var(--green-vibrant-dark); border-color: var(--green-vibrant-dark); color: var(--white); }

/* Campo moeda */
.cfr-currency-field {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.cfr-currency-field:focus-within { border-color: var(--green-vibrant-dark); }
.cfr-currency-field span {
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 700;
  font-size: 14px;
  padding: 14px 14px;
  border-right: 1.5px solid var(--gray-300);
}
.cfr-currency-field input {
  border: none;
  flex: 1;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
}
.cfr-currency-field input:focus { outline: none; }

/* Autocomplete de atividade */
.cfr-autocomplete { position: relative; }
.cfr-autocomplete-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
  z-index: 30;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cfr-autocomplete-list li {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.cfr-autocomplete-list li:hover,
.cfr-autocomplete-list li.active { background: var(--green-soft); color: var(--dex-navy); }
.cfr-autocomplete-list li.cfr-autocomplete-empty { color: var(--gray-500); cursor: default; }
.cfr-autocomplete-list li.cfr-autocomplete-empty:hover { background: none; }

/* Counter (funcionários) */
.cfr-counter { display: flex; align-items: center; gap: 20px; }
.cfr-counter-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  font-size: 20px;
  font-weight: 700;
  color: var(--dex-navy);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.cfr-counter-btn:hover { border-color: var(--green-vibrant-dark); background: var(--green-soft); }
.cfr-counter-value { font-size: 26px; font-weight: 800; font-family: var(--font-display); color: var(--ink); min-width: 40px; text-align: center; }

/* Checkbox */
.cfr-checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--gray-700); cursor: pointer; }
.cfr-checkbox input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--green-vibrant-dark); flex-shrink: 0; }

.cfr-nav-single { display: flex; justify-content: center; margin-top: 10px; }
.cfr-nav-single .btn { min-width: 280px; justify-content: center; }

/* Alertas */
.cfr-alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.cfr-alert i { font-size: 20px; margin-top: 2px; flex-shrink: 0; }
.cfr-alert strong { display: block; font-size: 14.5px; margin-bottom: 4px; }
.cfr-alert p { font-size: 13.5px; line-height: 1.6; margin: 0; }
.cfr-alert-warning { background: #fff6e0; border: 1px solid #f3dfa3; color: #7a5300; }
.cfr-alert-warning i { color: #9a6b00; }
.cfr-alert-info { background: var(--green-soft); border: 1px solid var(--green-vibrant-dark); color: var(--dex-navy); }
.cfr-alert-info i { color: var(--green-vibrant-dark); }

/* ==========================================================
   RESULTADO
   ========================================================== */
.cfr-result { max-width: 680px; margin: 50px auto 0; display: flex; flex-direction: column; gap: 28px; }

.cfr-result-card {
  background: linear-gradient(160deg, var(--dex-navy) 0%, var(--dex-navy-2) 100%);
  border-radius: var(--radius-lg);
  padding: 44px;
  color: var(--white);
  text-align: center;
}
.cfr-result-tag {
  display: inline-block;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--green-vibrant);
  padding: 8px 18px;
  border-radius: 30px;
  margin-bottom: 18px;
}
.cfr-result-value { font-size: 52px; font-weight: 800; font-family: var(--font-display); color: var(--green-vibrant); margin-bottom: 14px; }
.cfr-result-card p { color: rgba(255,255,255,0.85); font-size: 15px; max-width: 520px; margin: 0 auto; line-height: 1.6; }

.cfr-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.cfr-result-item {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cfr-result-item span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-500); font-weight: 700; }
.cfr-result-item strong { font-size: 19px; font-family: var(--font-display); color: var(--dex-navy); }

.cfr-disclaimer { background: var(--gray-50); }

.cfr-cta {
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}
.cfr-cta h3 { font-size: 22px; margin-bottom: 10px; }
.cfr-cta p { font-size: 14.5px; color: var(--gray-700); margin-bottom: 24px; max-width: 480px; margin-left: auto; margin-right: auto; }

/* ==========================================================
   O QUE É O FATOR R / EDUCATIVO
   ========================================================== */
.cfr-edu { padding: 90px 0; background: var(--white); }

/* ==========================================================
   FÓRMULA VISUAL
   ========================================================== */
.cfr-formula-section { padding: 90px 0; background: var(--gray-50); }
.cfr-formula-box {
  max-width: 480px;
  margin: 40px auto 0;
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.cfr-formula-term { font-size: 20px; font-weight: 800; font-family: var(--font-display); color: var(--dex-navy); }
.cfr-formula-eq { font-size: 24px; font-weight: 800; color: var(--gray-500); }
.cfr-formula-fraction { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cfr-formula-num, .cfr-formula-den { font-size: 13px; font-weight: 700; letter-spacing: 0.4px; color: var(--ink); text-align: center; }
.cfr-formula-line { width: 100%; height: 2px; background: var(--green-vibrant-dark); border-radius: 2px; }
.cfr-formula-note { font-size: 13.5px; color: var(--gray-500); margin-top: 18px; }

/* ==========================================================
   POR QUE ISSO IMPORTA (reaproveita .positioning / .pillar)
   ========================================================== */
.cfr-why { background: var(--white); }
.cfr-why-grid { grid-template-columns: repeat(3, 1fr); margin-top: 50px; }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1024px) {
  .cfr-why-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .cfr-calc-section, .cfr-edu, .cfr-formula-section { padding: 60px 0; }
  .cfr-form-card { padding: 28px 22px; }
  .cfr-toggle-pair { flex-direction: column; }
  .cfr-nav-single .btn { width: 100%; min-width: 0; }
  .cfr-result-grid { grid-template-columns: 1fr; }
  .cfr-result-card { padding: 30px 22px; }
  .cfr-result-value { font-size: 40px; }
  .cfr-cta { padding: 30px 22px; }
  .cfr-cta .btn { width: 100%; justify-content: center; }
  .cfr-hero-ctas { flex-direction: column; }
  .cfr-hero-ctas .btn { width: 100%; justify-content: center; }
  .cfr-formula-box { padding: 28px 20px; flex-direction: column; }
  .cfr-formula-eq { transform: rotate(90deg); }
}
