/* ==============================================
   Calculadora — Morbidade Neonatal
   Styles específicos (carrega após calc.css)
   ============================================== */

/* ── Disclaimer (amarelo) ── */
.morb-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #92400e;
}

.morb-disclaimer svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #d97706;
}

/* ── Inputs row ── */
.morb-inputs-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 24px;
  max-width: 400px;
}

.morb-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.morb-input-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

.morb-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

/* ── Select (IG) ── */
.morb-select-wrap {
  position: relative;
}

.morb-select {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 10px;
  font-size: 1rem;
  color: var(--text-primary, #1e293b);
  background: var(--bg-white, #fff);
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.morb-select:focus {
  outline: none;
  border-color: var(--teal, #0d9488);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.morb-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #94a3b8;
}

/* ── Result card ── */
.morb-result-card {
  padding: 28px;
}

.morb-result-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin: 0 0 24px;
}

/* ── Result items ── */
.morb-result-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.morb-result-item-sar {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.morb-result-item-ecn {
  background: #fefce8;
  border-color: #fde68a;
}

.morb-result-item-hiv {
  background: #fef2f2;
  border-color: #fecaca;
}

.morb-result-item-sepse {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.morb-result-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #e2e8f0;
  color: #64748b;
}

.morb-result-icon-info {
  background: #e0f2fe;
  color: #0284c7;
}

.morb-result-icon-sar {
  background: #dbeafe;
  color: #2563eb;
}

.morb-result-icon-ecn {
  background: #fef3c7;
  color: #d97706;
}

.morb-result-icon-hiv {
  background: #fee2e2;
  color: #dc2626;
}

.morb-result-icon-sepse {
  background: #dcfce7;
  color: #16a34a;
}

.morb-result-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.morb-result-label {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.4;
}

.morb-result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
}

/* ── Comparison bars ── */
.morb-comparison {
  margin-top: 24px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.morb-comparison-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  margin-bottom: 16px;
}

.morb-bar-group {
  margin-bottom: 12px;
}

.morb-bar-group:last-child {
  margin-bottom: 0;
}

.morb-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.morb-bar-label-text {
  font-size: 0.8125rem;
  color: #64748b;
}

.morb-bar-label-pct {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
}

.morb-bar {
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.morb-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.morb-bar-fill-sar {
  background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.morb-bar-fill-ecn {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.morb-bar-fill-hiv {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.morb-bar-fill-sepse {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

/* ── Legend ── */
.morb-result-legend {
  margin-top: 20px;
  padding: 16px 20px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.morb-result-legend-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  margin-bottom: 10px;
}

.morb-result-legend p {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 4px;
}

.morb-result-legend p:last-child {
  margin-bottom: 0;
}

/* ── Animations ── */
.morb-result-card {
  animation: morbSlideIn 0.4s ease-out;
}

@keyframes morbSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive tweaks ── */
@media (max-width: 480px) {
  .morb-result-item {
    padding: 14px 16px;
  }

  .morb-result-value {
    font-size: 1.25rem;
  }

  .morb-comparison {
    padding: 16px;
  }

  .morb-disclaimer {
    padding: 14px 16px;
    font-size: 0.8125rem;
  }
}

/* ── Card padding fix ── */
#morb-card, .morb-card { padding: 28px; }
.morb-card .card-header,
#morb-card .card-header { margin-bottom: 20px; }
.morb-card .card-header h2,
#morb-card .card-header h2 { font-size: 18px; font-weight: 700; color: #0f172a; margin: 0 0 6px; }
.morb-card .card-header-sub,
#morb-card .card-header-sub { font-size: 13px; color: #64748b; margin: 0; line-height: 1.5; }
.morb-resultado { padding: 28px; }

/* ── Disclaimer yellow ── */
.morb-disclaimer {
  background: #fffbeb !important;
  border: 1px solid #fcd34d !important;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: #92400e;
  margin: 16px 0 24px;
  line-height: 1.6;
}

/* ── Limpar button ── */
.morb-btn-row { align-items: stretch; }
.morb-btn-row .btn-limpar,
.btn-row .btn-limpar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  margin-top: 0;
  width: auto;
}
.morb-btn-row .btn-limpar:hover,
.btn-row .btn-limpar:hover { background: #e2e8f0; }

/* ── Standard calculator fixes ── */
#morb-card { padding: 28px !important; }
#morb-card .card-header { margin-bottom: 20px; }
#morb-card .card-header h2 { font-size: 18px; font-weight: 700; color: #0f172a; margin: 0 0 6px; }
#morb-card .card-header-sub { font-size: 13px; color: #64748b; margin: 0; line-height: 1.5; }

.morb-disclaimer {
  background: #fffbeb !important;
  border: 1px solid #fcd34d !important;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: #92400e;
  margin: 16px 0 24px;
  line-height: 1.6;
}

#morb-erro { margin-bottom: 16px; }

#morb-card .btn-row {
  display: flex !important;
  align-items: stretch !important;
  gap: 10px;
  margin-top: 20px;
}
#morb-card .btn-row .btn-calcular {
  flex: 1;
  width: auto !important;
  margin-top: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#morb-card .btn-row .btn-limpar {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 24px !important;
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  margin-top: 0 !important;
  width: auto !important;
}
#morb-card .btn-row .btn-limpar:hover { background: #e2e8f0 !important; }

.morb-resultado, #morb-resultado { padding: 28px !important; }
