/* ==========================================================================
   Calculadora de Rescisão — Design System
   Visual único, tipo aplicativo móvel, usado em todas as páginas.
   ========================================================================== */

:root {
  --primary: #1E3A8A;
  --primary-light: #3B5BDB;
  --primary-dark: #142a63;
  --primary-tint: rgba(30, 58, 138, 0.08);
  --whatsapp: #25D366;
  --whatsapp-dark: #128C7E;
  --whatsapp-tint: rgba(37, 211, 102, 0.12);
  --danger: #DC2626;
  --danger-tint: rgba(220, 38, 38, 0.08);
  --bg: #EEF1F8;
  --surface: #FFFFFF;
  --text: #1B1F2A;
  --text-muted: #667085;
  --border: #E4E7F0;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 8px rgba(20, 30, 70, 0.06);
  --shadow-md: 0 10px 30px rgba(20, 30, 70, 0.10);
  --shadow-lg: 0 24px 60px rgba(20, 30, 70, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; }

/* ---- App shell: emula a moldura de um app móvel ---- */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (min-width: 560px) {
  body {
    background: radial-gradient(circle at top, #dbe3fb 0%, var(--bg) 55%);
  }
  .app-shell {
    margin-top: 32px;
    margin-bottom: 32px;
    min-height: calc(100vh - 64px);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
  }
}

/* ---- Topbar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 18px 20px;
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.topbar-subtitle {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 1px;
}

.progress-track {
  margin-top: 14px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #fff;
  transition: width 0.3s ease;
}

.progress-label {
  margin-top: 6px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---- Main content ---- */
.app-main {
  flex: 1;
  padding: 24px 20px 110px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--primary);
}

.page-heading {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.page-lead {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 16px; }

/* ---- Choice buttons (perguntas do fluxo) ---- */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.choice-list li {
  margin: 0;
  padding: 0;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.choice-btn:hover,
.choice-btn:focus-visible {
  border-color: var(--primary-light);
  background: var(--primary-tint);
  transform: translateY(-1px);
}

.choice-btn .choice-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--primary-tint);
  color: var(--primary);
  flex-shrink: 0;
}

.choice-btn.is-whatsapp .choice-icon {
  background: var(--whatsapp-tint);
  color: var(--whatsapp-dark);
}

.choice-btn .choice-text { flex: 1; }
.choice-btn .choice-title { display: block; }
.choice-btn .choice-hint {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.choice-btn .choice-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ---- Botões genéricos ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { filter: brightness(1.06); }

.btn-whatsapp {
  background: linear-gradient(135deg, var(--whatsapp) 0%, var(--whatsapp-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-whatsapp:hover { filter: brightness(1.06); }

.btn-outline {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary-light); }

.icon-wa {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
  flex-shrink: 0;
}

/* ---- Formulário ---- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Seletor de classe única: seletores mais específicos (input[type].input)
   sobrescreviam o padding-left do prefixo "R$" e o texto ficava por baixo. */
.input {
  width: 100%;
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #FAFBFF;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.input:focus {
  outline: none;
  border-color: var(--primary-light);
  background: #fff;
}

/* Sub-rótulos empilhados dentro de um mesmo campo (ex.: Anos e Meses) */
label.field-hint {
  display: block;
  margin-bottom: 6px;
}

label.field-hint + .input-group { margin-bottom: 14px; }

.field > .input-group:last-child { margin-bottom: 0; }

/* ---- input-group ----------------------------------------------------------
   Uma única caixa com a aparência de .input, contendo por dentro o prefixo
   ("R$"), o campo sem borda e os botões de aumentar/diminuir. Tudo em fluxo
   flex — nada sobreposto, então o texto nunca fica por baixo do prefixo.
   -------------------------------------------------------------------------- */
.input-group {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #FAFBFF;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.input-group:focus-within {
  border-color: var(--primary-light);
  background: #fff;
}

/* O campo em si, sem moldura — a moldura é do .input-group */
.input-bare {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 14px 12px;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  -moz-appearance: textfield;
}

.input-bare:focus { outline: none; }

.input-bare::-webkit-outer-spin-button,
.input-bare::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Prefixo fixo dentro da caixa (ex.: R$) */
.input-affix {
  display: flex;
  align-items: center;
  padding-left: 14px;
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
  pointer-events: none;
}

.input-affix + .input-bare { padding-left: 8px; }

/* Botões de aumentar/diminuir, dentro da mesma caixa */
.stepper-btn {
  flex: 0 0 48px;
  border: none;
  background: transparent;
  color: var(--primary);
  font-family: var(--font);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background 0.15s ease;
}

.stepper-btn:hover { background: var(--primary-tint); }
.stepper-btn:active { background: rgba(30, 58, 138, 0.16); }

.stepper-btn:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: -2px;
}

/* Com botões dos dois lados o número fica centralizado */
.input-group.has-stepper .input-bare {
  text-align: center;
  font-weight: 700;
  padding-left: 0;
  padding-right: 0;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-option {
  position: relative;
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.radio-option label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #FAFBFF;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.radio-option label::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.radio-option input[type="radio"]:checked + label {
  border-color: var(--primary-light);
  background: var(--primary-tint);
}

.radio-option input[type="radio"]:checked + label::before {
  border-color: var(--primary);
  border-width: 5px;
}

.radio-option input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* ---- Resultado ---- */
.result-summary {
  text-align: center;
  margin-bottom: 18px;
}

.result-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.result-tipo {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 4px 0 2px;
}

.result-tempo {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.result-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.result-list li:last-child { border-bottom: none; }

.result-list .label { color: var(--text-muted); }
.result-list .value { font-weight: 700; white-space: nowrap; }

.result-total {
  margin-top: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-total .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.result-total .value {
  font-size: 1.4rem;
  font-weight: 800;
}

.copy-hint {
  margin-top: 10px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.disclaimer {
  margin-top: 18px;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- SEO content (index) ---- */
.info-section {
  margin-top: 28px;
}

.info-section h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 8px;
}

.info-section p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.info-section ul {
  margin: 0 0 10px;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.info-section li { margin-bottom: 4px; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* ---- WhatsApp FAB (presente em todas as páginas) ---- */
.wa-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--whatsapp) 0%, var(--whatsapp-dark) 100%);
  color: #fff;
  text-decoration: none;
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 10px 24px rgba(18, 140, 126, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wa-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(18, 140, 126, 0.4);
}

.wa-fab svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ---- Utilitários ---- */
.center { text-align: center; }
.mt-24 { margin-top: 24px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
