/* ============================================================
   Calculadora de Capacidade de Público — SDE Tools
   ============================================================ */

.cp-wrap {
  font-family: 'Inter', sans-serif;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px 40px;
  color: #0F172A;
}

/* Header */
.cp-header {
  text-align: center;
  padding: 40px 0 32px;
}
.cp-header__title {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  margin-bottom: 10px;
  color: #0F172A;
}
.cp-header__desc {
  font-size: 16px;
  color: #64748B;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Body: inputs + resultado lado a lado no desktop */
.cp-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* ── Inputs ─────────────────────────────────────────────── */
.cp-inputs {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.cp-field__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.cp-field__label {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cp-field__value {
  font-size: 15px;
  font-weight: 700;
  color: #2563EB;
  background: #EFF6FF;
  padding: 3px 10px;
  border-radius: 20px;
}

/* Slider */
.cp-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #2563EB 0%, #2563EB var(--pct, 5%), #E2E8F0 var(--pct, 5%));
  outline: none;
  cursor: pointer;
}
.cp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #2563EB;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
  cursor: pointer;
  transition: transform .15s;
}
.cp-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.cp-slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #2563EB;
  border: 3px solid #fff;
  cursor: pointer;
}
.cp-slider__labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94A3B8;
  margin-top: 4px;
}

/* Select grid */
.cp-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.cp-select-btn {
  flex: 1;
  min-width: 80px;
  padding: 10px 12px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all .18s;
  text-align: center;
}
.cp-select-btn:hover { border-color: #2563EB; color: #2563EB; }
.cp-select-btn.is-active {
  background: #2563EB;
  border-color: #2563EB;
  color: #fff;
  font-weight: 600;
}

/* Tooltip trigger */
.cp-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #CBD5E1;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
  transition: background .15s;
}
.cp-tooltip:hover { background: #2563EB; color: #fff; }

/* Tooltip popup */
.cp-tooltip-popup {
  position: absolute;
  z-index: 9999;
  background: #0F172A;
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 8px;
  max-width: 260px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.cp-tooltip-popup.is-visible { opacity: 1; }

/* ── Resultado ──────────────────────────────────────────── */
.cp-result {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 90px;
}

.cp-result__cards {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 12px;
}

.cp-card {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 20px 12px;
  text-align: center;
  transition: transform .2s;
}
.cp-card.is-featured {
  background: #2563EB;
  border-color: #2563EB;
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(37,99,235,.25);
}
.cp-card__icon {
  font-size: 12px;
  font-weight: 700;
  color: #94A3B8;
  margin-bottom: 4px;
}
.cp-card.is-featured .cp-card__icon { color: rgba(255,255,255,.6); }
.cp-card__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748B;
  margin-bottom: 8px;
}
.cp-card.is-featured .cp-card__label { color: rgba(255,255,255,.8); }
.cp-card__value {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  color: #0F172A;
  line-height: 1;
  margin-bottom: 4px;
}
.cp-card.is-featured .cp-card__value { color: #fff; }
.cp-card__sub {
  font-size: 11px;
  color: #94A3B8;
}
.cp-card.is-featured .cp-card__sub { color: rgba(255,255,255,.6); }

/* Gauge */
.cp-gauge { }
.cp-gauge__track {
  position: relative;
  height: 8px;
  background: linear-gradient(to right, #E2F5E2 0%, #FFF3CD 50%, #FDDEDE 100%);
  border-radius: 4px;
  overflow: visible;
  margin-bottom: 6px;
}
.cp-gauge__fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}
.cp-gauge__fill--low  { background: #3B82F6; }
.cp-gauge__fill--ok   { background: #22C55E; }
.cp-gauge__fill--high { background: #EF4444; }
.cp-gauge__marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #334155;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  transition: left .4s ease;
}
.cp-gauge__labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #94A3B8;
}

/* Alertas */
.cp-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  animation: cp-fadein .3s ease;
}
.cp-alert__icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.cp-alert--green  { background: #F0FDF4; color: #166534; }
.cp-alert--yellow { background: #FFFBEB; color: #92400E; }
.cp-alert--red    { background: #FEF2F2; color: #991B1B; }
.cp-alert--blue   { background: #EFF6FF; color: #1E40AF; }

/* Dica de seguro */
.cp-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-left: 3px solid #2563EB;
  border-radius: 0 10px 10px 0;
  padding: 14px 16px;
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
}
.cp-tip__icon { font-size: 18px; flex-shrink: 0; }

/* Animação */
@keyframes cp-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsivo ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .cp-body { grid-template-columns: 1fr; }
  .cp-result { position: static; }
}
@media (max-width: 480px) {
  .cp-result__cards { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .cp-card { padding: 14px 8px; }
  .cp-card__value { font-size: 24px; }
}
