/* ============================================================================
 * calc.css — Estilos da Calculadora de Salário Líquido (Portal Salário)
 *
 * Localização: themes/Newspaper-child/page-templates/calculadoras/assets/calc.css
 * Tudo escopado em .sal-calc-* — não vaza pro resto do site.
 * Mobile-first. Brand color: #098749 (verde Portal Salário).
 * ========================================================================== */

/* Reset/base local ----------------------------------------------------- */
.sal-calc-main * { box-sizing: border-box; }
.sal-calc-main { color: #1f2937; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.55; text-align: left; }

/* Override do parent theme (Newspaper-child tem main{text-align:center}) ------- */
.sal-calc-main,
.sal-calc-main p,
.sal-calc-main h2,
.sal-calc-main h3,
.sal-calc-main label,
.sal-calc-main summary,
.sal-calc-main td,
.sal-calc-main th,
.sal-calc-form,
.sal-calc-field,
.sal-calc-avancado,
.sal-calc-breakdown,
.sal-calc-bk-row,
.sal-calc-detalhamento,
.sal-calc-detalhamento__conteudo,
.sal-calc-mercado,
.sal-calc-mercado-card,
.sal-calc-editorial,
.sal-calc-faq { text-align: left; }

/* Elementos que devem ficar centralizados explicitamente ----------------- */
.sal-calc-result-hero,
.sal-calc-result-hero strong,
.sal-calc-result-aliquota,
.sal-calc-mercado-pos,
.sal-calc-mercado-loading,
.sal-calc-mercado-erro,
.sal-calc-mercado-link { text-align: center; }

/* [hidden] precisa vencer .sal-calc-result-label { display: block } ---- */
.sal-calc-main [hidden] { display: none !important; }

/* Remover spinner do input number (Dependentes) ---------------------- */
.sal-calc-field input[type="number"]::-webkit-inner-spin-button,
.sal-calc-field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.sal-calc-field input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Slot de ad — sem background cinza (deixa o AdSense gerenciar altura) */
.sal-calc-ad { background: transparent; min-height: 0; }
.sal-calc-ad:empty { display: none; }

/* Botão "Calcular novamente" --------------------------------------- */
.sal-calc-reset {
  margin: 20px 0 24px;
  text-align: center;
}
.sal-calc-btn-reset {
  background: #fff;
  color: #098749;
  border: 2px solid #098749;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.sal-calc-btn-reset:hover {
  background: #098749;
  color: #fff;
}

.sal-calc-container {
  max-width: 100%;
  margin: 24px auto;
  padding: 0 16px;
}

/* Page title (estilo sóbrio, alinhado ao header do site) ------------ */
.sal-calc-pagetitle {
  padding: 20px 0 18px;
  margin-bottom: 20px;
  border-bottom: 2px solid #098749;
}
.sal-calc-pagetitle h1 {
  margin: 0 0 6px;
  font-size: 1.7rem;
  line-height: 1.2;
  color: #1f2937;
  font-weight: 700;
}
.sal-calc-sub {
  margin: 0;
  color: #6b7280;
  font-size: 0.95rem;
}
@media (min-width: 640px) {
  .sal-calc-pagetitle h1 { font-size: 2.1rem; }
}

/* Toggle ------------------------------------------------------------- */
.sal-calc-toggle {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 10px;
}
.sal-calc-toggle__btn {
  background: transparent;
  border: 0;
  padding: 12px 16px;
  font-size: 0.92rem;
  border-radius: 7px;
  cursor: pointer;
  color: #4b5563;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.sal-calc-toggle__btn--active {
  background: #fff;
  color: #098749;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.sal-calc-toggle__btn strong { color: inherit; }
@media (min-width: 640px) {
  .sal-calc-toggle { grid-template-columns: 1fr 1fr; }
  .sal-calc-toggle__btn { text-align: center; }
}

/* Form --------------------------------------------------------------- */
.sal-calc-form {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

.sal-calc-field { margin-bottom: 16px; }
.sal-calc-field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: #1f2937;
}

.sal-calc-input-money {
  position: relative;
  display: flex;
  align-items: stretch;
}
.sal-calc-input-money .sal-calc-currency {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  color: #6b7280;
  font-weight: 600;
}
.sal-calc-input-money input,
.sal-calc-field input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 1.05rem;
  border: 1px solid #d1d5db;
  border-radius: 0 8px 8px 0;
  font-family: inherit;
  background: #fff;
  color: #111827;
  -webkit-appearance: none;
}
.sal-calc-field input[type="number"] {
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.sal-calc-input-money input:focus,
.sal-calc-field input:focus {
  outline: 0;
  border-color: #098749;
  box-shadow: 0 0 0 3px rgba(9, 135, 73, 0.15);
}

.sal-calc-field--primary input { font-size: 1.3rem; font-weight: 700; }

.sal-calc-help {
  display: block;
  margin-top: 5px;
  color: #6b7280;
  font-size: 0.78rem;
}

/* Avançado ---------------------------------------------------------- */
.sal-calc-avancado {
  margin: 12px 0 16px;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  padding: 0;
}
.sal-calc-avancado summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  color: #098749;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.sal-calc-avancado summary::-webkit-details-marker { display: none; }
.sal-calc-avancado summary::after {
  content: '▾';
  font-size: 0.85rem;
  transition: transform 0.2s;
}
.sal-calc-avancado[open] summary::after { transform: rotate(180deg); }
.sal-calc-avancado summary small {
  font-weight: 400;
  color: #6b7280;
  font-size: 0.78rem;
  flex: 1;
  text-align: right;
  padding-right: 8px;
}
.sal-calc-avancado__grid {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
  border-top: 1px dashed #e5e7eb;
  padding-top: 16px;
}
.sal-calc-avancado__grid .sal-calc-field { margin-bottom: 0; }
@media (min-width: 640px) {
  .sal-calc-avancado__grid { grid-template-columns: 1fr 1fr; }
}

/* Botão calcular ---------------------------------------------------- */
.sal-calc-btn-calcular {
  display: block;
  width: 100%;
  padding: 14px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: #098749;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}
.sal-calc-btn-calcular:hover { background: #07703d; }
.sal-calc-btn-calcular:active { transform: translateY(1px); }

/* Resultado --------------------------------------------------------- */
.sal-calc-resultado { margin-bottom: 24px; }

.sal-calc-result-hero {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-left: 5px solid #098749;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 16px;
}
.sal-calc-result-label {
  display: block;
  font-size: 0.92rem;
  color: #047857;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}
.sal-calc-result-valor {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  color: #065f46;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.sal-calc-result-aliquota {
  display: block;
  margin-top: 8px;
  color: #047857;
  font-size: 0.85rem;
}

/* Breakdown -------------------------------------------------------- */
.sal-calc-breakdown {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 16px;
}
.sal-calc-bk-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-variant-numeric: tabular-nums;
}
.sal-calc-bk-row + .sal-calc-bk-row { border-top: 1px solid #f3f4f6; }
.sal-calc-bk-op {
  font-weight: 700;
  text-align: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.85rem;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sal-calc-bk-row--plus  .sal-calc-bk-op { background: #6b7280; }
.sal-calc-bk-row--minus .sal-calc-bk-op { background: #ef4444; }
.sal-calc-bk-row--final .sal-calc-bk-op { background: #098749; }
.sal-calc-bk-row--final {
  background: #f0fdf4;
  border-top: 2px solid #098749 !important;
  font-weight: 700;
}
.sal-calc-bk-lbl { color: #374151; font-size: 0.93rem; }
.sal-calc-bk-val { font-weight: 600; color: #111827; font-size: 1rem; }

/* AdSense slot ----------------------------------------------------- */
.sal-calc-ad {
  margin: 24px 0;
  min-height: 90px;
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
}

/* Compare com mercado --------------------------------------------- */
.sal-calc-mercado {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.sal-calc-mercado h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  color: #1f2937;
}
.sal-calc-mercado-intro {
  margin: 0 0 14px;
  color: #6b7280;
  font-size: 0.9rem;
}

/* Autocomplete ---------------------------------------------------- */
.sal-calc-autocomplete { position: relative; }
.sal-calc-busca-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.98rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  background: #fff;
}
.sal-calc-busca-input:focus {
  outline: 0;
  border-color: #098749;
  box-shadow: 0 0 0 3px rgba(9, 135, 73, 0.15);
}
.sal-calc-busca-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  list-style: none;
  margin: 0;
  padding: 4px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
}
.sal-calc-busca-item {
  padding: 10px 12px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.sal-calc-busca-item:hover,
.sal-calc-busca-item[aria-selected="true"] {
  background: #ecfdf5;
}
.sal-calc-busca-label { font-weight: 500; color: #1f2937; flex: 1; font-size: 0.92rem; }
.sal-calc-busca-sub   { font-size: 0.75rem; color: #6b7280; white-space: nowrap; }

/* Card de mercado -------------------------------------------------- */
.sal-calc-mercado-card { margin-top: 16px; }
.sal-calc-mercado-loading,
.sal-calc-mercado-erro {
  padding: 16px;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
}
.sal-calc-mercado-erro { color: #b91c1c; }
.sal-calc-mercado-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f3f4f6;
}
.sal-calc-mercado-head h3 { margin: 0; font-size: 1.08rem; color: #1f2937; }
.sal-calc-mercado-head small { color: #6b7280; font-size: 0.8rem; font-variant-numeric: tabular-nums; }

.sal-calc-mercado-pos {
  padding: 10px 14px;
  border-radius: 7px;
  margin-bottom: 14px;
  font-size: 0.92rem;
}
.sal-calc-mercado-categoria {
  margin: -6px 0 12px;
  font-size: 0.85rem;
  color: #6b7280;
}
.sal-calc-mercado-categoria strong { color: #374151; font-weight: 600; }
.sal-calc-mercado-pos--pos { background: #ecfdf5; color: #065f46; border-left: 3px solid #098749; }
.sal-calc-mercado-pos--neg { background: #fef2f2; color: #991b1b; border-left: 3px solid #dc2626; }

.sal-calc-mercado-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.sal-calc-mercado-kpi {
  padding: 12px;
  background: #f9fafb;
  border-radius: 7px;
}
.sal-calc-kpi-lbl {
  display: block;
  font-size: 0.72rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  font-weight: 600;
}
.sal-calc-kpi-val {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.sal-calc-score, .sal-calc-tend {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 4px;
}
.sal-calc-score--alto  { background: #d1fae5; color: #065f46; }
.sal-calc-score--med   { background: #fef3c7; color: #92400e; }
.sal-calc-score--baixo { background: #fee2e2; color: #991b1b; }
.sal-calc-tend--up   { background: #d1fae5; color: #065f46; }
.sal-calc-tend--flat { background: #f3f4f6; color: #374151; }
.sal-calc-tend--down { background: #fee2e2; color: #991b1b; }

.sal-calc-mercado-link {
  display: inline-block;
  margin-top: 4px;
  color: #098749;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.sal-calc-mercado-link:hover { text-decoration: underline; }

/* Detalhamento ----------------------------------------------------- */
.sal-calc-detalhamento {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 16px;
  text-align: left;
}
.sal-calc-detalhamento summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  color: #098749;
  list-style: none;
  text-align: left;
}
.sal-calc-detalhamento summary::-webkit-details-marker { display: none; }
.sal-calc-detalhamento summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.2s;
  margin-right: 6px;
}
.sal-calc-detalhamento[open] summary::before { transform: rotate(90deg); }
.sal-calc-detalhamento__conteudo {
  padding: 0 18px 18px;
  border-top: 1px solid #f3f4f6;
}
.sal-calc-passos {
  margin: 12px 0 0;
  padding-left: 24px;
}
.sal-calc-passos li {
  margin-bottom: 8px;
  font-size: 0.93rem;
  color: #374151;
}
.sal-calc-passos li small {
  display: block;
  color: #6b7280;
  font-size: 0.82rem;
  margin-top: 2px;
}

/* Editorial -------------------------------------------------------- */
.sal-calc-editorial {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #e5e7eb;
}
.sal-calc-editorial h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  color: #1f2937;
}
.sal-calc-editorial h2:not(:first-child) { margin-top: 28px; }
.sal-calc-editorial h3 {
  margin: 20px 0 10px;
  font-size: 1.1rem;
  color: #1f2937;
}
.sal-calc-editorial p {
  margin: 0 0 12px;
  color: #374151;
  font-size: 0.95rem;
}

/* Tabelas ---------------------------------------------------------- */
.sal-calc-tabela {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 0.88rem;
}
.sal-calc-tabela th,
.sal-calc-tabela td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}
.sal-calc-tabela thead th {
  background: #f9fafb;
  font-weight: 700;
  color: #374151;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.sal-calc-tabela tbody tr:hover { background: #f9fafb; }

/* FAQ -------------------------------------------------------------- */
.sal-calc-faq {
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 0;
}
.sal-calc-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: #1f2937;
  font-size: 0.96rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.sal-calc-faq summary::-webkit-details-marker { display: none; }
.sal-calc-faq summary::after {
  content: '+';
  font-size: 1.4rem;
  color: #098749;
  transition: transform 0.2s;
  line-height: 1;
}
.sal-calc-faq[open] summary::after { transform: rotate(45deg); }
.sal-calc-faq p {
  margin: 10px 0 0;
  color: #4b5563;
  font-size: 0.92rem;
}

/* Lista de fontes oficiais ----------------------------------------- */
.sal-calc-fontes {
  list-style: none;
  padding: 0;
  margin: 16px 0 20px;
}
.sal-calc-fontes li {
  padding: 14px 16px;
  background: #f9fafb;
  border-left: 3px solid #098749;
  border-radius: 4px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: #374151;
}
.sal-calc-fontes li strong { display: block; margin-bottom: 4px; color: #1f2937; }
.sal-calc-fontes li a {
  display: inline-block;
  margin-top: 6px;
  color: #098749;
  font-weight: 600;
  text-decoration: none;
}
.sal-calc-fontes li a:hover { text-decoration: underline; }

/* Disclaimer final ------------------------------------------------- */
.sal-calc-disclaimer {
  margin-top: 24px !important;
  padding: 14px 16px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 0.85rem !important;
  color: #78350f !important;
  line-height: 1.5;
}

/* Responsivo ------------------------------------------------------ */
@media (min-width: 640px) {
  .sal-calc-result-valor { font-size: 3rem; }
  .sal-calc-mercado-grid { grid-template-columns: repeat(4, 1fr); }
}