/* Calculator styles: bmi */

/* BMI Category Colors */
.vareoncalc-category-underweight {
  color: var(--sc-warning);
}

.vareoncalc-category-normal {
  color: var(--sc-success);
}

.vareoncalc-category-overweight {
  color: var(--sc-warning);
}

.vareoncalc-category-obese {
  color: var(--sc-error);
}

/* ====================================
   BMI Calculator - Health Vitals Dashboard
   Two-panel "Check-Up + Diagnosis" design
   ==================================== */

/* Dashboard-specific layout */
.vareoncalc-bmi-dashboard {
  gap: 24px;
}

/* Wider card for BMI dashboard */
.vareoncalc-card:has(.vareoncalc-bmi-dashboard) {
  max-width: 780px;
}

/* Unit Toggle - compact segmented control */
.bmi-unit-toggle,
.bmi-unit-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 0;
  margin-left: auto;
  width: fit-content;
  max-width: 100%;
}

.bmi-unit-toggle .vareoncalc-measurement-toggle,
.bmi-unit-switcher .vareoncalc-measurement-toggle {
  width: fit-content;
  max-width: 100%;
}

.bmi-vitals-section__header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Vitals Section */
.bmi-vitals-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bmi-section-title {
  padding-bottom: 0;
  border-bottom: 0;
  min-width: 0;
}

/* Compact binary toggle styling exported from the Fuel Cost km/mi switch */
.bmi-icon-toggle {
  width: fit-content;
}

.bmi-icon-toggle.vareoncalc-toggle,
.bmi-icon-toggle.vareoncalc-measurement-toggle {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  min-width: 0;
}

.bmi-icon-toggle.vareoncalc-toggle:hover,
.bmi-icon-toggle.vareoncalc-toggle:focus-within,
.bmi-icon-toggle.vareoncalc-measurement-toggle:hover,
.bmi-icon-toggle.vareoncalc-measurement-toggle:focus-within {
  border: none;
  box-shadow: none;
}

.bmi-icon-toggle .vareoncalc-toggle__track {
  display: inline-flex;
  align-items: stretch;
  width: auto;
  gap: 4px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.bmi-icon-toggle .vareoncalc-toggle__option {
  flex: 0 0 auto;
}

.bmi-icon-toggle__btn.vareoncalc-measurement-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--sc-muted-text, #6b7280);
  font-size: 11px;
  font-weight: 700;
  min-height: 26px;
  min-width: 48px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1;
  white-space: nowrap;
}

.bmi-icon-toggle__btn.vareoncalc-measurement-toggle__btn.is-active,
.bmi-icon-toggle__btn.vareoncalc-measurement-toggle__btn[aria-pressed="true"],
.bmi-icon-toggle__btn.vareoncalc-measurement-toggle__btn.vareoncalc-measurement-toggle__btn--active {
  background: var(--sc-accent, #3b82f6);
  color: var(--sc-accent-text, var(--sc-button-text, #fff));
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.18);
}

.bmi-icon-toggle__btn.vareoncalc-measurement-toggle__btn:hover:not(.is-active):not([aria-pressed="true"]):not(.vareoncalc-measurement-toggle__btn--active) {
  background: rgba(59, 130, 246, 0.08);
}

.bmi-icon-toggle__btn.vareoncalc-measurement-toggle__btn:focus-visible {
  outline: 2px solid var(--sc-accent, #3b82f6);
  outline-offset: 1px;
}

/* Vitals Grid - Height & Weight side by side */
.bmi-vitals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bmi-vitals-grid > .vareoncalc-field,
.bmi-vitals-grid > .bmi-height-imperial,
.bmi-height-imperial__inputs > .vareoncalc-field,
.bmi-height-imperial__input > .vareoncalc-field {
  min-width: 0;
}

.bmi-vitals-grid .vareoncalc-input-adorned {
  --sc-suffix-rail-min-width: 20px;
  --sc-suffix-rail-max-width: 42px;
  --sc-suffix-rail-fluid-width: 34%;
}

/* Imperial Height compound field */
.bmi-height-imperial {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.bmi-height-imperial>label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--sc-label-text);
  opacity: 0.88;
}

.bmi-height-imperial__inputs,
.bmi-height-imperial__input {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 0;
}

.bmi-height-imperial__inputs .vareoncalc-field,
.bmi-height-imperial__input .vareoncalc-field {
  margin-bottom: 0;
}

.bmi-height-imperial__inputs .vareoncalc-field--compact label,
.bmi-height-imperial__input .vareoncalc-field--compact label {
  display: none;
}

/* Left panel (Check-Up) styling — card already applies --sc-card-padding; match .vareoncalc-panel-input */
.bmi-checkup {
  padding: 0;
}

.bmi-checkup .vareoncalc-btn {
  margin-top: 8px;
}

/* Right panel (Diagnosis) styling - Placeholder */
.bmi-diagnosis {
  background: var(--sc-input-bg, #f9fafb);
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  min-height: 280px;
}

.bmi-diagnosis--placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sc-card-padding);
  color: var(--sc-muted-text, #6b7280);
}

.bmi-diagnosis--placeholder .placeholder-icon {
  font-size: 48px;
  opacity: 0.4;
  margin-bottom: 12px;
}

.bmi-diagnosis--placeholder .placeholder-text {
  font-size: 14px;
  opacity: 0.7;
  max-width: 200px;
}

/* ====================================
   BMI Results - Redesigned Layout
   ==================================== */
.bmi-results {
  --bmi-text-strong: var(--sc-card-text, #111827);
  --bmi-text-base: var(--sc-card-text, #374151);
  --bmi-text-soft: var(--sc-muted-text, #6b7280);
  --bmi-text-faint: var(--sc-muted-text, #9ca3af);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: var(--sc-card-padding);
  background: transparent;
  border: none;
  border-radius: 0;
}

.bmi-results--fitness {
  /* No outer shadow: blur was visible in the blind two-step gap above "Edit inputs". */
  box-shadow: none;
}

/* ---- Hero ---- */
.bmi-results__hero {
  --bmi-coach-accent: var(--sc-accent, #3b82f6);
  --bmi-coach-accent-soft: rgba(59, 130, 246, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: var(--sc-card-padding);
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 12px;
  background: var(--sc-card-bg, #ffffff);
}

.bmi-results__hero.bmi-category--underweight {
  --bmi-coach-accent: #2563eb;
  --bmi-coach-accent-soft: rgba(37, 99, 235, 0.15);
}

.bmi-results__hero.bmi-category--normal {
  --bmi-coach-accent: #059669;
  --bmi-coach-accent-soft: rgba(5, 150, 105, 0.14);
}

.bmi-results__hero.bmi-category--overweight {
  --bmi-coach-accent: #d97706;
  --bmi-coach-accent-soft: rgba(217, 119, 6, 0.14);
}

.bmi-results__hero.bmi-category--obese-1,
.bmi-results__hero.bmi-category--obese-2,
.bmi-results__hero.bmi-category--obese-3 {
  --bmi-coach-accent: #dc2626;
  --bmi-coach-accent-soft: rgba(220, 38, 38, 0.14);
}

.bmi-hero__score-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bmi-text-soft);
}

.bmi-hero__score {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--bmi-coach-accent);
}

.bmi-hero__category {
  display: inline-flex;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bmi-coach-accent);
  border: 1.5px solid var(--bmi-coach-accent);
  background: transparent;
  margin-bottom: 4px;
}

/* ---- Spectrum Bar ---- */
.bmi-hero__spectrum {
  width: 100%;
  margin-top: 6px;
}

.bmi-spectrum__track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa 0%, #34d399 25%, #fbbf24 55%, #f87171 100%);
}

.bmi-spectrum__marker {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  background: var(--sc-card-bg, #ffffff);
  border: 3px solid var(--bmi-coach-accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px var(--bmi-coach-accent-soft), 0 2px 6px rgba(0, 0, 0, 0.15);
}

.bmi-spectrum__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.bmi-spectrum__zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.bmi-spectrum__zone-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--bmi-text-soft);
}

.bmi-spectrum__zone-range {
  font-size: 10px;
  font-weight: 500;
  color: var(--bmi-text-faint);
}

/* ---- Gauge (Body Composition Zone) ---- */
.bmi-results__gauge {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--sc-card-padding);
  border-radius: 12px;
  border: 1px solid var(--sc-card-border, #e5e7eb);
  background: var(--sc-input-bg, #f9fafb);
}

.bmi-coach-gauge__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.bmi-coach-gauge__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--bmi-text-strong);
}

.bmi-coach-gauge__value {
  font-size: 16px;
  font-weight: 800;
  color: var(--bmi-text-strong);
}

.bmi-coach-gauge__unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--bmi-text-soft);
}

.bmi-gauge {
  position: relative;
}

.bmi-gauge__track {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
}

.bmi-gauge__zone {
  flex: 1;
}

.bmi-gauge__zone--under {
  background: #60a5fa;
}

.bmi-gauge__zone--normal {
  background: #34d399;
}

.bmi-gauge__zone--over {
  background: #fbbf24;
}

.bmi-gauge__zone--obese {
  background: #f87171;
}

.bmi-gauge__marker {
  position: absolute;
  top: -4px;
  width: 18px;
  height: 18px;
  background: var(--sc-card-bg, #ffffff);
  border: 3px solid var(--sc-card-text, #111827);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.25);
}

.bmi-gauge__scale {
  position: relative;
  height: 15px;
  padding-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--bmi-text-soft);
}

.bmi-gauge__tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  line-height: 1;
  white-space: nowrap;
}

.bmi-gauge__tick--start {
  left: 0;
  transform: none;
}

.bmi-gauge__tick--end {
  left: 100%;
  transform: translateX(-100%);
}

/* ---- Insight Cards ---- */
.bmi-results__insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bmi-coach-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--sc-card-padding);
  border-radius: 12px;
  border: 1px solid var(--sc-card-border, #e5e7eb);
  background: var(--sc-card-bg, #ffffff);
}

.bmi-insight__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bmi-text-soft);
}

.bmi-insight__value-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bmi-insight__svg-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--bmi-text-soft);
}

.bmi-insight__value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--bmi-text-strong);
}

.bmi-insight {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.bmi-insight__text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--bmi-text-base);
}

.bmi-insight__text strong {
  font-weight: 700;
  color: var(--bmi-text-strong);
}

/* ---- Advice Card ---- */
.bmi-results__advice {
  margin: 0;
  padding: var(--sc-card-padding);
  border-radius: 12px;
  border: 1px solid transparent;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.bmi-results__advice.bmi-advice--positive {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.bmi-results__advice.bmi-advice--action {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}

.bmi-results__advice::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.06;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='200' height='80' viewBox='0 0 200 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 40c30-15 50 15 80 0s50-15 80 0 40 15 40 0' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 180px auto;
  background-repeat: repeat;
}

.bmi-coach-advice__title {
  position: relative;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--bmi-text-strong);
}

/* ---- Note ---- */
.bmi-results__note {
  margin-top: -2px;
  padding: 2px 2px 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--bmi-text-faint);
  text-align: center;
}

/* ---- Dark Theme ---- */
.vareoncalc-root[data-theme="dark"] .bmi-diagnosis,
.vareoncalc-root.theme-dark .bmi-diagnosis {
  background: var(--sc-input-bg, #1f2937);
  border-color: var(--sc-card-border, #374151);
}

.vareoncalc-root[data-theme="dark"] .bmi-results,
.vareoncalc-root.theme-dark .bmi-results {
  background: transparent;
  --bmi-text-strong: #d2dced;
  --bmi-text-base: #bcc9dd;
  --bmi-text-soft: #9bacc4;
  --bmi-text-faint: #8598b2;
}

.vareoncalc-root[data-theme="dark"] .bmi-results--fitness,
.vareoncalc-root.theme-dark .bmi-results--fitness {
  box-shadow: none;
}

.vareoncalc-root[data-theme="dark"] .bmi-results__hero,
.vareoncalc-root.theme-dark .bmi-results__hero {
  border-color: var(--sc-card-border, #374151);
  background: var(--sc-card-bg, #111827);
}

.vareoncalc-root[data-theme="dark"] .bmi-coach-card,
.vareoncalc-root.theme-dark .bmi-coach-card {
  border-color: var(--sc-card-border, #374151);
  background: linear-gradient(145deg, var(--sc-card-bg, #111827) 0%, var(--sc-input-bg, #1f2937) 100%);
}

.vareoncalc-root[data-theme="dark"] .bmi-results__gauge,
.vareoncalc-root.theme-dark .bmi-results__gauge {
  border-color: var(--sc-card-border, #374151);
  background: rgba(17, 24, 39, 0.78);
}

.vareoncalc-root[data-theme="dark"] .bmi-spectrum__marker,
.vareoncalc-root.theme-dark .bmi-spectrum__marker {
  background: #1f2937;
}

.vareoncalc-root[data-theme="dark"] .bmi-gauge__marker,
.vareoncalc-root.theme-dark .bmi-gauge__marker {
  background: #e2e8f0;
  border-color: #0f172a;
}

.vareoncalc-root[data-theme="dark"] .bmi-results__advice::after,
.vareoncalc-root.theme-dark .bmi-results__advice::after {
  opacity: 0.04;
  filter: invert(1);
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .vareoncalc-bmi-dashboard {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .bmi-diagnosis {
    min-height: auto;
  }

  .bmi-vitals-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .bmi-height-imperial__inputs,
  .bmi-height-imperial__input {
    grid-template-columns: 1fr 1fr;
  }

  .bmi-unit-toggle,
  .bmi-unit-switcher {
    margin-left: 0;
  }

  .bmi-hero__score {
    font-size: 46px;
  }

  .bmi-results {
    gap: 12px;
    padding: var(--sc-card-padding);
  }

  .bmi-results__insights {
    grid-template-columns: 1fr;
  }

  .bmi-insight__value {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .bmi-vitals-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .bmi-hero__score {
    font-size: 42px;
  }

  .bmi-hero__category {
    font-size: 10px;
  }

  .bmi-spectrum__zone-name {
    font-size: 9px;
  }

  .bmi-spectrum__zone-range {
    font-size: 9px;
  }
}

@media (max-width: 410px) {
  .bmi-vitals-section,
  .bmi-vitals-grid {
    gap: 10px;
  }

  .bmi-height-imperial__inputs,
  .bmi-height-imperial__input {
    grid-template-columns: 1fr;
  }

  .bmi-unit-toggle,
  .bmi-unit-switcher {
    width: 100%;
    justify-content: flex-start;
  }

  .bmi-coach-card--target .bmi-insight__svg-icon {
    display: none;
  }
}

@media (max-width: 360px) {
  .bmi-results {
    padding: var(--sc-card-padding);
  }

  .bmi-hero__score {
    font-size: 36px;
  }
}

@container vareoncalc (max-width: 520px) {
  .bmi-vitals-grid {
    grid-template-columns: 1fr;
  }
}

@container vareoncalc (max-width: 410px) {
  .bmi-coach-card--target .bmi-insight__svg-icon {
    display: none;
  }

  .bmi-vitals-section,
  .bmi-vitals-grid {
    gap: 10px;
  }

  .bmi-height-imperial__inputs,
  .bmi-height-imperial__input {
    grid-template-columns: 1fr;
  }

  .bmi-unit-toggle,
  .bmi-unit-switcher {
    width: 100%;
    justify-content: flex-start;
  }
}

@container vareoncalc (max-width: 360px) {
  .bmi-results {
    padding: var(--sc-card-padding);
  }

  .bmi-hero__score {
    font-size: 36px;
  }
}
