/* =============================================
   Calculadora de Peso Ideal e IMC v2.0
   Prefixo: imc-
   Depende de: calc.css (base)
   ============================================= */

/* ── Badge "Para todos" ── */
.badge-todos {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 99px;
  background: #dbeafe;
  color: #1e40af;
}

.badge-todos svg {
  width: 13px;
  height: 13px;
}

/* ── Calculator Card ── */
.imc-calc-card {
  overflow: visible;
}

/* ── Inputs Row ── */
.imc-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 0 24px;
  margin-bottom: 16px;
}

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

.imc-input-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.02em;
}

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

.imc-input {
  width: 100%;
  padding: 14px 50px 14px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: 'Poppins', sans-serif;
  -moz-appearance: textfield;
}

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

.imc-input::placeholder {
  color: #64748b;
  font-weight: 400;
}

.imc-input:focus {
  outline: none;
  border-color: #0e7490;
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.1);
}

.imc-input.has-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.imc-input-unit {
  position: absolute;
  right: 16px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  pointer-events: none;
}

/* ── Button row ── */
.imc-btn-row {
  display: flex;
  justify-content: flex-end;
  padding: 0 24px;
  margin-top: 4px;
  margin-bottom: 4px;
}

/* ── Result Section ── */
.imc-result-section {
  animation: imc-fadeIn 0.4s ease;
}

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

.imc-result-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 16px 24px 24px;
}

/* ── Result Columns (Peso Ideal left, Gauge right) ── */
.imc-result-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 0 24px 24px;
  align-items: center;
}

/* ── Peso Ideal (left column) ── */
.imc-result-ideal {
  text-align: center;
  padding: 20px;
}

.imc-result-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 8px;
}

.imc-result-range {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

.imc-result-min,
.imc-result-max {
  font-size: 36px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.imc-result-sep {
  font-size: 16px;
  font-weight: 400;
  color: #94a3b8;
}

.imc-result-unit {
  font-size: 16px;
  font-weight: 500;
  color: #64748b;
  align-self: flex-end;
  margin-bottom: 4px;
}

/* Delta indicator */
.imc-result-delta {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  min-height: 21px;
}

.imc-result-delta.imc-delta-ok {
  color: #16a34a;
}

.imc-result-delta.imc-delta-warn {
  color: #ca8a04;
}

.imc-result-delta.imc-delta-danger {
  color: #dc2626;
}

.imc-result-delta.imc-delta-under {
  color: #2563eb;
}

/* ── SVG Gauge ── */
.imc-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.imc-gauge {
  width: 100%;
  max-width: 220px;
  height: auto;
  overflow: visible;
}

.imc-needle {
  /* transform set via JS inline style */
}

.imc-gauge-value {
  font-size: 28px;
  font-weight: 700;
  fill: #0f172a;
  font-family: 'Poppins', sans-serif;
}

.imc-gauge-label {
  font-size: 11px;
  font-weight: 500;
  fill: #94a3b8;
  font-family: 'Poppins', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.imc-classification-text {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  text-align: center;
  padding: 2px 16px;
  border-radius: 99px;
  transition: color 0.3s;
}

/* Classification colors */
.imc-classification-text.imc-class-underweight { color: #2563eb; }
.imc-classification-text.imc-class-normal      { color: #16a34a; }
.imc-classification-text.imc-class-overweight   { color: #ca8a04; }
.imc-classification-text.imc-class-obese1       { color: #ea580c; }
.imc-classification-text.imc-class-obese2       { color: #dc2626; }
.imc-classification-text.imc-class-obese3       { color: #991b1b; }

/* ── Detail Cards Row ── */
.imc-detail-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 24px 24px;
}

.imc-detail-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.imc-detail-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color 0.3s;
}

.imc-detail-icon {
  color: #64748b;
  flex-shrink: 0;
  display: flex;
}

.imc-detail-badge {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: background-color 0.3s;
}

.imc-detail-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.imc-detail-label {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.imc-detail-value {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Alert Cards (conditional, inserted by JS) ── */
#imc-alerts {
  padding: 0 24px;
}

.imc-alert-card {
  padding: 18px 20px;
  border-radius: 12px;
  margin-bottom: 12px;
  border-left: 4px solid;
}

.imc-alert-card:last-child {
  margin-bottom: 24px;
}

.imc-alert-card strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.imc-alert-card p {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  margin: 0;
}

/* Warning (overweight) */
.imc-alert-warning {
  background: #fefce8;
  border-left-color: #eab308;
}
.imc-alert-warning strong { color: #854d0e; }
.imc-alert-warning p { color: #713f12; }

/* Danger (obese) */
.imc-alert-danger {
  background: #fef2f2;
  border-left-color: #ef4444;
}
.imc-alert-danger strong { color: #991b1b; }
.imc-alert-danger p { color: #7f1d1d; }

/* Info (underweight) */
.imc-alert-info {
  background: #eff6ff;
  border-left-color: #3b82f6;
}
.imc-alert-info strong { color: #1e40af; }
.imc-alert-info p { color: #1e3a5f; }

/* Success (normal) */
.imc-alert-success {
  background: #f0fdf4;
  border-left-color: #22c55e;
}
.imc-alert-success strong { color: #15803d; }
.imc-alert-success p { color: #166534; }

/* ── Gestante Callout ── */
.imc-callout-gestante {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 40px;
}

.imc-callout-icon {
  color: #db2777;
  flex-shrink: 0;
  margin-top: 2px;
}

.imc-callout-body strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #9d174d;
  margin-bottom: 4px;
}

.imc-callout-body p {
  font-size: 13px;
  font-weight: 400;
  color: #831843;
  line-height: 1.6;
  margin: 0;
}

.imc-callout-body a {
  color: #db2777;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.imc-callout-body a:hover {
  color: #9d174d;
}

/* ── Educational Content ── */
.imc-section {
  margin-bottom: 48px;
  scroll-margin-top: 24px;
}

.imc-sec-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid #ecfeff;
}

.imc-sub-title {
  font-size: 17px;
  font-weight: 600;
  color: #0e7490;
  margin: 28px 0 12px;
  line-height: 1.4;
}

.imc-body {
  font-size: 15px;
  font-weight: 300;
  color: #334155;
  line-height: 1.8;
  margin: 0 0 16px;
}

.imc-body strong {
  font-weight: 600;
  color: #0f172a;
}

.imc-list {
  margin: 0 0 18px;
  padding-left: 24px;
}

.imc-list li {
  font-size: 15px;
  font-weight: 300;
  color: #334155;
  line-height: 1.75;
  margin-bottom: 10px;
}

.imc-list li strong {
  font-weight: 600;
  color: #0f172a;
}

/* ── Formula Card ── */
.imc-formula-card {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 14px;
  padding: 24px 32px;
  margin: 20px 0;
  text-align: center;
}

.imc-formula-card-main {
  padding: 28px 32px;
}

.imc-formula-title {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0e7490;
  margin-bottom: 14px;
}

.imc-formula {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.imc-formula-text {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-style: italic;
}

/* Big formula with fraction bar */
.imc-formula-big {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.imc-fraction {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.imc-fraction-num {
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  padding-bottom: 6px;
  font-family: 'Georgia', 'Times New Roman', serif;
}

.imc-fraction-bar {
  width: 100%;
  height: 2px;
  background: #0e7490;
}

.imc-fraction-den {
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  padding-top: 6px;
  font-family: 'Georgia', 'Times New Roman', serif;
}

.imc-formula-eq {
  font-size: 22px;
  font-weight: 700;
  color: #0e7490;
  font-family: 'Georgia', 'Times New Roman', serif;
}

/* ── Example Card ── */
.imc-example-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px;
  margin: 20px 0;
}

.imc-example-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0e7490;
  margin-bottom: 12px;
}

.imc-example-text {
  font-size: 14px;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 16px;
}

.imc-example-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.imc-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.imc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0e7490;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.imc-step-text {
  font-size: 14px;
  font-weight: 400;
  color: #475569;
  line-height: 1.6;
  padding-top: 2px;
}

.imc-step-text strong {
  color: #0f172a;
  font-weight: 600;
}

/* ── Tables ── */
.imc-tabela-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.imc-tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.imc-tabela thead th {
  background: #0e7490;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 12px 16px;
  text-align: center;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.imc-tabela thead th:first-child {
  text-align: left;
}

.imc-tabela tbody td {
  padding: 11px 16px;
  text-align: center;
  color: #334155;
  font-weight: 400;
  border-bottom: 1px solid #f1f5f9;
}

.imc-tabela tbody td:first-child {
  text-align: left;
  font-weight: 500;
}

.imc-tabela tbody tr:last-child td {
  border-bottom: none;
}

.imc-tabela tbody tr:hover {
  background: #f8fafc;
}

/* Table row colored left border */
.imc-tabela-row-blue td:first-child    { border-left: 3px solid #3b82f6; }
.imc-tabela-row-green td:first-child   { border-left: 3px solid #22c55e; }
.imc-tabela-row-yellow td:first-child  { border-left: 3px solid #eab308; }
.imc-tabela-row-orange td:first-child  { border-left: 3px solid #f97316; }
.imc-tabela-row-red td:first-child     { border-left: 3px solid #ef4444; }
.imc-tabela-row-darkred td:first-child { border-left: 3px solid #991b1b; }

/* Highlighted row (peso ideal table) */
.imc-tabela-highlight {
  background: #ecfeff !important;
}

/* Risk badges in table */
.imc-risco-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.imc-risco-elevado    { background: #fee2e2; color: #991b1b; }
.imc-risco-moderado   { background: #ffedd5; color: #9a3412; }
.imc-risco-baixo      { background: #dbeafe; color: #1e40af; }
.imc-risco-normal     { background: #dcfce7; color: #15803d; }
.imc-risco-aumentado  { background: #fef9c3; color: #854d0e; }
.imc-risco-grave      { background: #fee2e2; color: #991b1b; }
.imc-risco-muitograve { background: #fecaca; color: #7f1d1d; }

/* Peso ideal table */
.imc-tabela-peso tbody td {
  font-variant-numeric: tabular-nums;
}

/* ── FAQ Accordion ── */
.imc-faq-list {
  border-top: 1px solid #e2e8f0;
}

.imc-faq-item {
  border-bottom: 1px solid #e2e8f0;
}

.imc-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  cursor: pointer;
  user-select: none;
}

.imc-faq-q:focus-visible {
  outline: 2px solid #0e7490;
  outline-offset: 2px;
  border-radius: 4px;
}

.imc-faq-q-text {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
}

.imc-faq-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ecfeff;
  color: #0e7490;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.imc-faq-item.open .imc-faq-icon {
  background: #0e7490;
  color: #fff;
  transform: rotate(45deg);
}

.imc-faq-a {
  display: none;
  padding: 0 0 18px;
}

.imc-faq-a p {
  font-size: 14px;
  font-weight: 300;
  color: #475569;
  line-height: 1.8;
  margin: 0;
}

.imc-faq-item.open .imc-faq-a {
  display: block;
}

/* ── Scroll Animations ── */
[data-animate] {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-animate="fade-up"] {
  transform: translateY(40px);
}

[data-animate].imc-visible {
  opacity: 1;
  transform: none;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  .imc-result-columns {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .imc-detail-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .imc-inputs-row {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 16px;
  }

  .imc-btn-row {
    padding: 0 16px;
  }

  .imc-result-divider {
    margin: 12px 16px 20px;
  }

  .imc-result-columns {
    padding: 0 16px 20px;
  }

  .imc-result-min,
  .imc-result-max {
    font-size: 28px;
  }

  .imc-gauge {
    max-width: 180px;
  }

  .imc-gauge-value {
    font-size: 22px;
  }

  .imc-detail-cards {
    padding: 0 16px 20px;
  }

  #imc-alerts {
    padding: 0 16px;
  }

  .imc-sec-title {
    font-size: 19px;
  }

  .imc-sub-title {
    font-size: 15px;
  }

  .imc-formula-card {
    padding: 18px 16px;
  }

  .imc-formula-text {
    font-size: 15px;
  }

  .imc-fraction-num,
  .imc-fraction-den {
    font-size: 14px;
  }

  .imc-example-card {
    padding: 16px;
  }

  .imc-tabela {
    font-size: 13px;
  }

  .imc-tabela thead th {
    font-size: 12px;
    padding: 10px 12px;
  }

  .imc-tabela tbody td {
    padding: 9px 12px;
  }

  .imc-alert-card {
    padding: 14px 16px;
  }

  .imc-callout-gestante {
    padding: 14px 16px;
  }

  .imc-faq-q-text {
    font-size: 14px;
  }
}

@media (max-width: 380px) {
  .imc-formula-big {
    flex-direction: column;
    gap: 8px;
  }

  .imc-formula-eq {
    display: none;
  }
}

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

/* ── Gauge fix ── */
.imc-gauge-wrap {
  min-width: 220px;
}
.imc-gauge {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  display: block;
}

/* ── Limpar button fix ── */
.imc-btn-row .btn-limpar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  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;
  margin-top: 0;
  width: auto;
}
.imc-btn-row .btn-limpar:hover {
  background: #e2e8f0;
}
