/* ==========================================================================
   WisePlan Ferramentas — Estilos compartilhados para calculadoras
   ========================================================================== */

/* Theme color variable (matches wise-theme.css #0D6BBA) */
:root {
  --color-theme: #0D6BBA;
}

/* Tool Tabs (pills navigation) */
.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tool-tabs a {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
}
.tool-tabs a:hover {
  background: rgba(255,255,255,0.35);
  color: #fff;
}
.tool-tabs a.active {
  background: #fff;
  color: #333;
  font-weight: 600;
}

/* Calculator card form */
.calc-form-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.calc-form-card h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: #111827;
  margin-bottom: 16px;
}
.calc-form-card label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 4px;
}
.calc-form-card .form-control {
  font-size: 0.875rem;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.calc-form-card .form-control:focus {
  border-color: var(--color-theme, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.calc-form-card .form-select {
  font-size: 0.875rem;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}
.calc-form-card .form-select:focus {
  border-color: var(--color-theme, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* Input with prefix (R$) */
.input-prefix {
  position: relative;
}
.input-prefix .prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 0.875rem;
  pointer-events: none;
}
.input-prefix .form-control {
  padding-left: 40px;
}

/* Btn primary WP */
.btn-wp-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: var(--color-theme, #6366f1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-wp-primary:hover {
  opacity: 0.9;
  color: #fff;
}
.btn-wp-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Result cards */
.result-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.result-card h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: #111827;
  margin-bottom: 16px;
}

/* Metric mini-card */
.metric-card {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
}
.metric-card .metric-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 4px;
}
.metric-card .metric-value {
  font-size: 1.25rem;
  font-weight: 700;
}
.metric-card .metric-detail {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 2px;
}

/* Status colors */
.text-status-green { color: #16a34a; }
.text-status-yellow { color: #d97706; }
.text-status-red { color: #dc2626; }
.bg-status-green-light { background: #f0fdf4; border: 1px solid #bbf7d0; }
.bg-status-red-light { background: #fef2f2; border: 1px solid #fecaca; }
.bg-status-amber-light { background: #fffbeb; border: 1px solid #fde68a; }
.bg-status-primary-light { background: #eef2ff; border: 1px solid #c7d2fe; }

/* Blur overlay (lead gate) */
.blur-overlay-container { position: relative; }
.blur-content {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}
.gate-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 32px;
  z-index: 10;
}
.gate-form-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  border: 1px solid #e5e7eb;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  margin: 0 16px;
}
.gate-form-card .gate-icon {
  width: 48px;
  height: 48px;
  background: #eef2ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--color-theme, #6366f1);
}
.gate-form-card h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: #111827;
  text-align: center;
  margin-bottom: 4px;
}
.gate-form-card .gate-desc {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
  margin-bottom: 24px;
}
.lead-error {
  display: none;
  padding: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #b91c1c;
  margin-bottom: 12px;
}

/* Comparison bar */
.comparison-bar-wrap { margin-bottom: 12px; }
.comparison-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 4px;
}
.comparison-bar {
  height: 24px;
  border-radius: 8px;
}

/* Placeholder (before calculation) */
.calc-placeholder {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  color: #6b7280;
}

/* Hub tool card */
.tool-hub-card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.tool-hub-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-theme, #6366f1);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
  color: inherit;
  text-decoration: none;
}
.tool-hub-card .card-icon {
  width: 48px;
  height: 48px;
  background: #eef2ff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--color-theme, #6366f1);
}
.tool-hub-card .card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #111827;
  margin-bottom: 8px;
}
.tool-hub-card .card-desc {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}
.tool-hub-card .card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-theme, #6366f1);
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
}
.tool-hub-card .card-arrow {
  position: absolute;
  bottom: 16px;
  right: 16px;
  color: var(--color-theme, #6366f1);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.2s;
}
.tool-hub-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Allocation chart (inline) */
.alloc-chart-container { position: relative; }
/* Tabela mobile para diagnóstico de carteira — oculta em desktop */
.alloc-mobile-table { display: none; }
.alloc-chart-bars {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 4px;
  height: 280px;
  position: relative;
}
.alloc-bar-group {
  flex: 1;
  max-width: 100px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
}
.alloc-bar {
  width: 32px;
  border-radius: 4px 4px 0 0;
  transition: all 0.3s;
  position: relative;
  z-index: 2;
}
.alloc-bar-group:hover .alloc-bar { opacity: 0.8; }
.alloc-bar-group .alloc-tooltip {
  position: absolute;
  top: auto;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  font-size: 0.75rem;
  border-radius: 6px;
  padding: 8px 12px;
  white-space: nowrap;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.alloc-bar-group:hover .alloc-tooltip { opacity: 1; }
/* Em mobile, tooltip aparece abaixo da barra para não sair da tela */
@media (max-width: 767.98px) {
  .alloc-bar-group .alloc-tooltip {
    bottom: auto;
    top: calc(100% + 4px);
    font-size: 0.68rem;
    padding: 5px 8px;
  }
}
.alloc-target-line {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
  border-top: 2px dashed #94a3b8;
}
.alloc-band {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 2px;
  pointer-events: none;
}
.alloc-x-labels {
  display: flex;
  justify-content: space-around;
  gap: 4px;
  margin-top: 8px;
  border-top: 1px solid #d1d5db;
  padding-top: 8px;
}
.alloc-x-labels span {
  flex: 1;
  max-width: 100px;
  font-size: 0.7rem;
  color: #4b5563;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alloc-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
  font-size: 0.75rem;
  color: #6b7280;
}
.alloc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.alloc-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}
.alloc-legend-line {
  width: 20px;
  border-top: 2px dashed #94a3b8;
}

/* Score gauge SVG */
.score-gauge { width: 128px; height: 128px; position: relative; margin: 0 auto; }
@media (max-width: 575.98px) {
  .score-gauge { width: 100px; height: 100px; }
  .score-gauge-text .score-num { font-size: 1.5rem; }
}
.score-gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-gauge-text .score-num {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}
.score-gauge-text .score-label {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Custom checkbox for product list */
.product-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
  padding: 4px 0;
}
.product-check:hover { color: #111827; }
.product-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-theme, #6366f1);
}

/* How it works step */
.how-step {
  text-align: center;
  padding: 0 16px;
}
.how-step-icon {
  position: relative;
  width: 64px;
  height: 64px;
  background: #eef2ff;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--color-theme, #6366f1);
}
.how-step-num {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  background: var(--color-theme, #6366f1);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.how-step h5 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.how-step p {
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.5;
}

/* Stacked bar */
.stacked-bar {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  height: 32px;
}
.stacked-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
}
.stacked-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: #6b7280;
}
.stacked-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.stacked-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

/* Form range slider */
.calc-form-card input[type="range"] {
  width: 100%;
  accent-color: var(--color-theme, #6366f1);
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 4px;
}

/* ==========================================================================
   Shared Calculator Page Styles (previously duplicated inline in each page)
   ========================================================================== */

/* CTA Section Typography */
.cta-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  line-height: 1.35;
  font-size: 2.125rem;
  margin-bottom: 12px;
}
.cta-desc {
  font-size: 1.3125rem;
  margin-bottom: 30px;
}

/* Inline lead bar */
.lead-bar {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.lead-bar .lead-bar-text {
  flex-shrink: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.lead-bar .lead-bar-text h4 {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 2px;
  color: #374151;
}
.lead-bar .lead-bar-text p {
  font-size: 0.78rem;
  margin: 0;
  color: #9ca3af;
}
.lead-bar form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.lead-bar .form-control {
  font-size: 0.82rem;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  flex: 1;
  min-width: 0;
}
.lead-bar .form-control::placeholder {
  color: #9ca3af;
}
.lead-bar .form-control:focus {
  border-color: #0D6BBA;
  box-shadow: 0 0 0 2px rgba(13,107,186,0.12);
  outline: none;
}
.lead-bar .btn-lead {
  flex-shrink: 0;
  padding: 9px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: #374151;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.lead-bar .btn-lead:hover {
  background: #1f2937;
}
.lead-bar .btn-lead:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Lead bar success */
.lead-bar-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #166534;
}
.lead-bar-success svg { flex-shrink: 0; color: #16a34a; }
.lead-bar-success p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: #166534;
}

/* Main content card */
.main-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* Lock overlay for calculator content */
.calc-lock-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 10;
  cursor: not-allowed;
}
.calc-lock-overlay .lock-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 16px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  max-width: 320px;
}
.calc-lock-overlay:hover .lock-hint {
  opacity: 1;
}

/* Hero Section — sobrescreve o background inline (hero-10.jpg lavanda) por azul wp */
#hero-ferramentas {
  position: relative;
  z-index: 3;
  background: #0D6BBA !important;
}
.hero-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 2.4rem;
  line-height: 1.2;
  margin-bottom: 14px;
  color: #fff !important;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}
.hero-desc {
  font-size: 1.05rem;
  font-weight: 400;
  margin-bottom: 0;
  color: rgba(255,255,255,0.9) !important;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/* Calculator section padding */
.calc-section-padding {
  padding: 32px;
}
.calc-section-padding-top {
  padding: 32px 32px 0;
}

/* ==========================================================================
   Responsive Overrides
   ========================================================================== */

/* ── Extra-large (< 1400px) ── */
@media (max-width: 1399.98px) {
  .cta-heading { font-size: 2rem; }
  .cta-desc { font-size: 1.18755rem; }
}

/* ── Large (< 1200px) ── */
@media (max-width: 1199.98px) {
  .cta-heading { font-size: 1.764705rem; }
  .cta-desc { font-size: 1.32352rem; }
}

/* ── Medium / Tablet (< 992px) ── */
@media (max-width: 991.98px) {
  .cta-heading { font-size: 2.0625rem; line-height: 1.4; }
  .cta-desc { font-size: 1.21875rem; }

  /* Lead bar stacks vertically */
  .lead-bar {
    flex-direction: column;
    text-align: center;
  }
  .lead-bar form {
    flex-direction: column;
    width: 100%;
  }
  .lead-bar .form-control {
    width: 100%;
  }

  /* Lock overlay: always visible on touch devices */
  .calc-lock-overlay {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(2px);
  }
  .calc-lock-overlay .lock-hint {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    opacity: 1;
    margin: 0 16px;
  }
}

/* ── Small / Phone landscape (< 768px) ── */
@media (max-width: 767.98px) {
  /* Tool tabs: horizontal scroll */
  .tool-tabs {
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    gap: 6px;
    scrollbar-width: none;
  }
  .tool-tabs::-webkit-scrollbar {
    display: none;
  }
  .tool-tabs a {
    font-size: 0.72rem;
    padding: 5px 10px;
    flex-shrink: 0;
  }

  /* Gate form */
  .gate-form-card { padding: 24px 20px; }

  /* Hero */
  #hero-ferramentas {
    min-height: auto !important;
    padding: 90px 0 35px !important;
  }
  .hero-title {
    font-size: 1.65rem;
    line-height: 1.3;
  }
  .hero-desc {
    font-size: 0.95rem;
    padding: 0 5%;
  }

  /* Section paddings */
  .calc-section-padding {
    padding: 16px;
  }
  .calc-section-padding-top {
    padding: 16px 16px 0;
  }

  /* Result cards */
  .result-card {
    padding: 16px;
  }
  .calc-form-card {
    padding: 16px;
  }

  /* Allocation chart: ocultar no mobile, mostrar tabela alternativa */
  .alloc-chart-container {
    display: none !important;
  }
  .alloc-mobile-table {
    display: block !important;
  }

  /* How it works steps */
  .how-step {
    padding: 20px 16px;
    margin-bottom: 10px;
  }

  /* Hub tool cards */
  .tool-hub-card {
    padding: 24px;
  }
  .tool-hub-card .card-arrow {
    opacity: 1;
    transform: translateX(0);
    position: static;
    margin-top: 12px;
  }

  /* Lead bar spacing */
  .lead-bar {
    padding: 14px 16px;
  }
  .lead-bar-success {
    padding: 12px 16px;
  }
}

/* ── Extra-small / Phone portrait (< 576px) ── */
@media (max-width: 575.98px) {
  .cta-heading { font-size: 1.75rem; line-height: 1.4; }
  .cta-desc { font-size: 1.1875rem; }

  #hero-ferramentas {
    padding: 80px 0 30px !important;
  }
  .hero-title {
    font-size: 1.45rem;
    padding: 0 3%;
  }
  .hero-desc {
    font-size: 0.9rem;
    padding: 0 3%;
  }

  /* Footer bottom row */
  footer .row.justify-content-between .col-auto {
    flex: 0 0 100%;
    text-align: center;
    margin-bottom: 8px;
  }

  /* Calc placeholder */
  .calc-placeholder {
    padding: 32px 16px;
  }

  /* Large result values: override inline font-size on small screens */
  .result-card [style*="font-size:2.5rem"],
  .result-card [style*="font-size: 2.5rem"] {
    font-size: 1.75rem !important;
  }

  /* ITCMD composition rows: allow labels to shrink */
  .comp-row .comp-label {
    width: auto !important;
    min-width: 80px;
    flex-shrink: 1 !important;
    font-size: 0.8rem !important;
  }
  .comp-row .comp-input {
    width: 65px !important;
  }

  /* Metric value text scaling */
  .metric-card .metric-value {
    font-size: 1.1rem;
  }

  /* CTA section on small phones */
  .section-cta {
    padding: 40px 0;
  }
}
