/* =====================================================================
   Simulador de juros do contrato
   Usa as mesmas cores e fontes do style.css. Texto maior e com mais
   contraste que o resto do site, porque aqui a pessoa precisa ler números.
   ===================================================================== */

.sim-lead { margin-top: 20px; font-size: 1.05rem; color: rgba(246,243,236,0.86); }

.sim-section { padding-top: clamp(40px, 6vw, 80px); }
.sim-grid { display: grid; gap: 32px; }
@media (min-width: 1024px) {
  .sim-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: start; gap: 48px; }
  .sim-resultado { grid-column: 1 / -1; }
}

/* Cartão do formulário */
.sim-card {
  background: var(--card); border: 1px solid rgba(12,28,52,0.12);
  padding: clamp(22px, 5vw, 40px); display: grid; gap: 22px;
}
.sim-form-title { font-size: clamp(1.7rem, 4vw, 2.2rem); line-height: 1.1; }
.sim-help { color: rgba(12,28,52,0.78); font-size: 1rem; margin-top: -10px; }

.sim-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sim-field label, .sim-fieldset legend {
  font-size: 0.95rem; font-weight: 600; color: var(--navy); padding: 0;
}
.sim-fieldset { border: none; margin: 0; padding: 0; }
.sim-fieldset legend { margin-bottom: 8px; }

.sim-field input, .sim-field select {
  width: 100%; min-height: 54px; padding: 12px 14px;
  font-family: inherit; font-size: 1.1rem; color: var(--navy);
  background: var(--offwhite); border: 1px solid rgba(12,28,52,0.35); border-radius: 4px;
  outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
.sim-field select {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%230c1c34' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.sim-field input:focus, .sim-field select:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(205,170,111,0.55); }
/* Campo inválido: borda vermelha de 2px (1px de borda + 1px de sombra, sem mexer no layout).
   Continua vermelha com o campo em foco, só ganha o anel dourado por fora. */
.sim-field [aria-invalid="true"] { border-color: #a3261b; box-shadow: 0 0 0 1px #a3261b; }
.sim-field [aria-invalid="true"]:focus { border-color: #a3261b; box-shadow: 0 0 0 1px #a3261b, 0 0 0 4px rgba(205,170,111,0.55); }

/* Mensagem curta logo abaixo do campo com erro. Vermelho escuro: 6,9:1 sobre o branco */
.sim-campo-erro {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 0.95rem; font-weight: 500; line-height: 1.4; color: #a3261b;
}
.sim-campo-erro[hidden] { display: none; }
.sim-campo-erro::before {
  content: "!"; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  background: #a3261b; color: #fff; font-size: 0.75rem; font-weight: 700; line-height: 18px; text-align: center;
}
.sim-field input::placeholder { color: rgba(12,28,52,0.5); }

.sim-hint { font-size: 0.92rem; color: rgba(12,28,52,0.75); line-height: 1.5; }

.sim-row { display: grid; gap: 22px; }
@media (min-width: 560px) { .sim-row { grid-template-columns: 1fr 1fr; } }
.sim-row-tight { grid-template-columns: 1.3fr 1fr; gap: 12px; }

.sim-erro {
  background: #fbeceb; border-left: 4px solid #a3261b; color: #7a1c14;
  padding: 14px 16px; font-size: 1rem; line-height: 1.5;
}

.sim-botao {
  width: 100%; min-height: 58px; border: none; cursor: pointer;
  background: var(--navy); color: var(--offwhite);
  font-family: inherit; font-size: 1rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  transition: background .25s ease, color .25s ease;
}
.sim-botao:hover { background: var(--champagne); color: var(--navy); }
.sim-botao:focus-visible { outline: 3px solid var(--champagne); outline-offset: 3px; }
.sim-botao:disabled { background: var(--navy-soft); cursor: progress; }

.sim-privacidade {
  font-size: 0.92rem; line-height: 1.55; color: rgba(12,28,52,0.75);
  border-top: 1px solid rgba(12,28,52,0.1); padding-top: 18px;
}

/* Bloco "como funciona" */
.sim-como { padding: clamp(4px, 2vw, 16px) 0; }
.sim-como-title { font-size: clamp(1.6rem, 3.5vw, 2rem); line-height: 1.15; }
.sim-como ol { margin-top: 20px; padding-left: 0; list-style: none; counter-reset: passo; display: grid; gap: 18px; }
.sim-como li {
  counter-increment: passo; position: relative; padding-left: 46px;
  font-size: 1rem; line-height: 1.6; color: rgba(12,28,52,0.82);
}
.sim-como li::before {
  content: counter(passo); position: absolute; left: 0; top: -2px;
  font-family: 'Cormorant Garamond', serif; font-size: 1.9rem; line-height: 1; color: #9a7433;
}

/* Resultado */
.sim-resultado { outline: none; }
.sim-result {
  background: var(--card); border: 1px solid rgba(12,28,52,0.12); border-top: 5px solid var(--navy-soft);
  padding: clamp(22px, 5vw, 44px); display: grid; gap: 20px;
}
.sim-result.sim-alerta { border-top-color: #9a6a14; }
.sim-result.sim-neutro { border-top-color: var(--champagne); }
.sim-result.sim-dentro { border-top-color: #2f6b4f; }
.sim-result-eyebrow { color: rgba(12,28,52,0.72); }
.sim-result-title { font-size: clamp(1.7rem, 4.4vw, 2.5rem); line-height: 1.12; }
.sim-result-body { font-size: 1.05rem; line-height: 1.6; color: rgba(12,28,52,0.85); max-width: 720px; }

.sim-numbers, .sim-totals dl { display: grid; gap: 1px; background: rgba(12,28,52,0.12); border: 1px solid rgba(12,28,52,0.12); }
@media (min-width: 560px) {
  .sim-numbers { grid-template-columns: 1fr 1fr; }
  /* número ímpar de itens: o último ocupa a linha toda, sem deixar um quadrado vazio */
  .sim-numbers > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 760px) { .sim-totals dl { grid-template-columns: repeat(3, 1fr); } }
.sim-numbers > div, .sim-totals dl > div { background: var(--offwhite); padding: 18px 20px; }
.sim-numbers dt, .sim-totals dt { font-size: 0.92rem; color: rgba(12,28,52,0.78); }
/* Números na fonte do texto: a Cormorant desenha algarismos antigos, piores de ler */
.sim-numbers dd { font-size: 1.6rem; line-height: 1.2; margin-top: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sim-totals dd { font-size: 1.25rem; font-weight: 600; margin-top: 6px; }
.sim-numbers dd.sim-sub, .sim-totals dd.sim-sub {
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.92rem; font-weight: 400; margin-top: 2px; color: rgba(12,28,52,0.75);
}
.sim-totals h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.sim-totals .sim-note { margin-top: 10px; }

/* Gráfico de barras: uma série, rótulo e valor escritos sobre cada barra */
.sim-chart { margin: 4px 0 0; display: grid; gap: 16px; }
.sim-chart-head { display: flex; justify-content: space-between; gap: 12px; font-size: 0.98rem; flex-wrap: wrap; }
.sim-chart-head strong { font-weight: 600; }
.sim-chart-track { position: relative; height: 26px; margin-top: 6px; background: var(--stone-light); }
.sim-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 0 4px 4px 0;
  transition: width .7s cubic-bezier(.22,1,.36,1);
}
.sim-bar-contrato { background: var(--navy); }
.sim-bar-media { background: #6f7d91; }
.sim-chart-limit {
  position: absolute; top: -4px; bottom: -4px; width: 0;
  border-left: 2px dashed #9a6a14; transform: translateX(-1px);
}
.sim-chart figcaption { font-size: 0.92rem; color: rgba(12,28,52,0.75); line-height: 1.5; }

.sim-note { font-size: 0.92rem; line-height: 1.55; color: rgba(12,28,52,0.75); }
.sim-note-center { text-align: center; margin-top: -8px; }

/* Botão de WhatsApp: verde escuro para manter contraste com o texto branco */
.sim-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 60px; padding: 14px 22px; margin-top: 6px;
  background: #0e7a5f; color: #ffffff; text-decoration: none; border-radius: 4px;
  font-size: 1.05rem; font-weight: 600; line-height: 1.3; text-align: center;
  transition: background .25s ease;
}
.sim-whatsapp:hover { background: #0b6550; }
.sim-whatsapp:focus-visible { outline: 3px solid var(--champagne); outline-offset: 3px; }
.sim-whatsapp svg { flex: none; }

.sim-link-secundario {
  display: inline-flex; align-items: center; min-height: 48px; width: fit-content;
  color: var(--navy); font-weight: 600; font-size: 1rem; text-underline-offset: 4px;
}

.sim-aviso {
  font-size: 0.92rem; line-height: 1.55; color: rgba(12,28,52,0.8);
  background: var(--stone-light); padding: 16px 18px; border-left: 3px solid var(--champagne);
}

/* Calculadora de rescisão: bloco recolhível de remuneração variável */
.rc-variavel { border: 1px solid rgba(12,28,52,0.18); border-radius: 4px; background: var(--offwhite); }
.rc-variavel summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 56px; padding: 12px 16px; font-size: 1rem; font-weight: 600; color: var(--navy); line-height: 1.35;
}
.rc-var-txt { flex: 1; }
.rc-var-txt span { font-weight: 400; color: rgba(12,28,52,0.72); }
.rc-variavel summary::-webkit-details-marker { display: none; }
.rc-variavel summary::after {
  content: "+"; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--champagne);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 400;
  transition: transform .3s ease;
}
.rc-variavel[open] summary::after { transform: rotate(45deg); }
.rc-variavel summary:focus-visible { outline: 3px solid var(--champagne); outline-offset: 2px; }
.rc-variavel-corpo { display: grid; gap: 18px; padding: 4px 16px 20px; }
.rc-variavel .sim-field input { background: var(--card); }

/* Chamada para o simulador na home e na página de áreas */
.sim-teaser { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .sim-teaser { grid-template-columns: 1.3fr auto; } }

@media (prefers-reduced-motion: reduce) {
  .sim-bar, .sim-botao, .sim-whatsapp, .sim-field input, .sim-field select { transition: none !important; }
}
