/* ==========================================================================
   Vitaroxi — BMI Calculator  |  bmi.css
   Two-signal rule: green (#71b230) = fitness/calculators (this tool)
   ========================================================================== */

/* ── CSS Custom Properties ─────────────────────────────────────────────── */
.vxbmi {
  --vx-navy:      #000f2b;
  --vx-navy-3:    #0a1f3d;
  --vx-navy-4:    #112244;
  --vx-brand:     #71b230;
  --vx-alt-brand: #4d7d20;
  --vx-accent:    #e8750a;
  --vx-cream:     #f7f3ee;
  --vx-cream-2:   #eef0e8;
  --vx-extra:     #eaf4d5;
  --vx-text:      #2a3245;
  --vx-muted:     #5a6a4e;
  --vx-muted-d:   #b8c9a0;
  --vx-border-l:  #dde8cc;
  --vx-border-d:  #1e3a5f;
  --vx-err:       #dc2626;
  --vx-rc:        12px;
  --vx-ri:        8px;
}

/* ── Root container ─────────────────────────────────────────────────────── */
.vxbmi {
  display: block;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  background: transparent;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--vx-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: 2rem 0;
}

/* ── Element reset — prevent theme bleed ───────────────────────────────── */
.vxbmi *,
.vxbmi *::before,
.vxbmi *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.vxbmi input,
.vxbmi button,
.vxbmi select,
.vxbmi textarea {
  font-family: inherit;
  font-size: inherit;
}

.vxbmi button {
  cursor: pointer;
}

.vxbmi table {
  border-collapse: collapse;
  width: 100%;
}

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.vxbmi__wrap {
  max-width: 660px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  width: 100%;
  overflow-x: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.vxbmi__hdr {
  background: var(--vx-navy);
  border-radius: 16px;
  padding: 1.6rem 1.8rem 1.5rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.vxbmi__hdr::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.vxbmi__brand {
  display: block;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--vx-brand);
  margin-bottom: 0.4rem;
}

.vxbmi__title {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  font-style: italic;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 0.3rem;
}

.vxbmi__sub {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--vx-muted-d);
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.vxbmi__card {
  background: #fff;
  border: 1.5px solid var(--vx-border-l);
  border-radius: var(--vx-rc);
  margin-bottom: 1.1rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 15, 43, 0.07);
}

.vxbmi__card-hdr {
  background: var(--vx-navy-3);
  border-radius: 12px 12px 0 0;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-bottom: 1.5px solid var(--vx-border-d);
}

.vxbmi__step-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--vx-brand);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vxbmi__card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

.vxbmi__card-body {
  padding: 1.25rem;
  background: var(--vx-cream);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Field ───────────────────────────────────────────────────────────────── */
.vxbmi__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.vxbmi__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--vx-muted);
  display: block;
}

.vxbmi__opt {
  font-weight: 400;
}

.vxbmi__err {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--vx-err);
  display: none;
}

.vxbmi__err--vis {
  display: block;
}

/* ── Input + Unit ────────────────────────────────────────────────────────── */
.vxbmi__iu {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--vx-border-l);
  border-radius: var(--vx-ri);
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.vxbmi__iu:focus-within {
  border-color: var(--vx-navy);
  box-shadow: 0 0 0 3px rgba(0, 15, 43, 0.10);
}

.vxbmi__inp {
  flex: 1;
  width: 0;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.92rem;
  color: var(--vx-text);
  -moz-appearance: textfield;
}

.vxbmi__inp::-webkit-outer-spin-button,
.vxbmi__inp::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.vxbmi__inp::placeholder {
  color: rgba(90, 106, 78, 0.35);
}

.vxbmi__inp--center {
  text-align: center;
}

.vxbmi__utag {
  display: flex;
  align-items: center;
  padding: 0 0.65rem;
  background: var(--vx-cream-2);
  border-left: 1.5px solid var(--vx-border-l);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--vx-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Weight Box ──────────────────────────────────────────────────────────── */
.vxbmi__wbox {
  border: 1.5px solid var(--vx-border-l);
  border-radius: var(--vx-ri);
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.vxbmi__wbox:focus-within {
  border-color: var(--vx-navy);
  box-shadow: 0 0 0 3px rgba(0, 15, 43, 0.10);
}

/* Inline .iu inside wbox — inherit box border, remove its own */
.vxbmi__wbox > .vxbmi__iu {
  border: none;
  border-radius: 0;
  box-shadow: none !important;
}

/* Weight unit toggle */
.vxbmi__wtoggle {
  display: flex;
  border-top: 1.5px solid var(--vx-border-l);
}

.vxbmi__wtbtn {
  flex: 1;
  padding: 0.42rem 0;
  background: transparent;
  border: none;
  border-right: 1.5px solid var(--vx-border-l);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--vx-text) !important;
  text-align: center;
  transition: background 0.12s, color 0.12s;
}

.vxbmi__wtbtn:last-child {
  border-right: none;
}

.vxbmi__wtbtn:hover:not(.vxbmi__wtbtn--active) {
  background: var(--vx-extra);
}

.vxbmi__wtbtn--active {
  background: var(--vx-navy) !important;
  color: #fff !important;
  font-weight: 600;
}

/* ── Height Box ──────────────────────────────────────────────────────────── */
.vxbmi__hbox {
  border: 1.5px solid var(--vx-border-l);
  border-radius: var(--vx-ri);
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.vxbmi__hbox:focus-within {
  border-color: var(--vx-navy);
  box-shadow: 0 0 0 3px rgba(0, 15, 43, 0.10);
}

/* Inline .iu inside hbox */
.vxbmi__hbox > .vxbmi__iu {
  border: none;
  border-radius: 0;
  box-shadow: none !important;
}

/* ft + in row */
.vxbmi__hbox-ftin {
  display: none;
  align-items: stretch;
  border-top: 1.5px solid var(--vx-border-l);
}

.vxbmi__hbox-ftin--active {
  display: flex;
}

.vxbmi__hbox-ftin .vxbmi__inp {
  padding: 0.55rem 0.6rem;
  font-size: 0.88rem;
}

.vxbmi__ftsep {
  display: flex;
  align-items: center;
  padding: 0 0.55rem;
  background: var(--vx-cream-2);
  border-left: 1.5px solid var(--vx-border-l);
  border-right: 1.5px solid var(--vx-border-l);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--vx-muted);
  flex-shrink: 0;
}

.vxbmi__ftsep--last {
  border-right: none;
}

/* Height unit toggle */
.vxbmi__htoggle {
  display: flex;
  border-top: 1.5px solid var(--vx-border-l);
}

.vxbmi__htbtn {
  flex: 1;
  padding: 0.42rem 0;
  background: transparent;
  border: none;
  border-right: 1.5px solid var(--vx-border-l);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--vx-text) !important;
  text-align: center;
  transition: background 0.12s, color 0.12s;
}

.vxbmi__htbtn:last-child {
  border-right: none;
}

.vxbmi__htbtn:hover:not(.vxbmi__htbtn--active) {
  background: var(--vx-extra);
}

.vxbmi__htbtn--active {
  background: var(--vx-navy) !important;
  color: #fff !important;
  font-weight: 600;
}

/* ── 2-col grid (optional details) ──────────────────────────────────────── */
.vxbmi__g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Gender ──────────────────────────────────────────────────────────────── */
.vxbmi__gender-row {
  display: flex;
  gap: 0.6rem;
}

.vxbmi__rbtn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--vx-border-l);
  border-radius: var(--vx-ri);
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--vx-text) !important;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  user-select: none;
}

.vxbmi__rbtn:hover {
  border-color: var(--vx-navy);
}

.vxbmi__rbtn--sel {
  border-color: var(--vx-navy) !important;
  background: var(--vx-navy) !important;
  color: #fff !important;
  font-weight: 600;
}

.vxbmi__rdot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--vx-border-l);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s, background 0.12s;
}

.vxbmi__rbtn--sel .vxbmi__rdot {
  border-color: var(--vx-brand);
  background: var(--vx-brand);
}

.vxbmi__rbtn--sel .vxbmi__rdot::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}

/* ── Calculate Button ────────────────────────────────────────────────────── */
.vxbmi__btn-calc {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--vx-navy);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background 0.15s;
}

.vxbmi__btn-calc:hover {
  background: var(--vx-navy-4);
}

.vxbmi__btn-calc:active {
  transform: scale(0.99);
}

/* ── Results Section ─────────────────────────────────────────────────────── */
.vxbmi__results {
  display: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  margin-top: 1.25rem;
}

.vxbmi__results--vis {
  opacity: 1;
  transform: translateY(0);
}

/* ── Result Hero ─────────────────────────────────────────────────────────── */
.vxbmi__result-hero {
  background: var(--vx-navy);
  border-radius: var(--vx-rc);
  padding: 1.6rem 1.5rem 1.4rem;
  text-align: center;
  margin-bottom: 1.1rem;
  position: relative;
  overflow: hidden;
}

.vxbmi__result-hero::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.vxbmi__hero-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vx-brand);
  margin-bottom: 0.5rem;
}

.vxbmi__hero-val {
  font-family: 'Poppins', sans-serif;
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
}

.vxbmi__cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.55rem;
}

.vxbmi__cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Scale Card ──────────────────────────────────────────────────────────── */
.vxbmi__scale-card {
  background: #fff;
  border: 1.5px solid var(--vx-border-l);
  border-radius: var(--vx-rc);
  padding: 1.1rem 1.25rem 1.2rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 2px 12px rgba(0, 15, 43, 0.07);
}

.vxbmi__scale-title {
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--vx-text);
  margin-bottom: 1rem;
}

.vxbmi__scale-bar {
  position: relative;
  height: 10px;
  border-radius: 99px;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #3b82f6 0%, #22c55e 28%, #f97316 55%, #ef4444 100%);
  overflow: visible;
}

.vxbmi__scale-ptr {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--vx-navy);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  left: 0%;
  transition: left 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.vxbmi__scale-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--vx-muted);
  font-weight: 500;
  margin-top: 0.3rem;
}

.vxbmi__scale-segs {
  display: flex;
  margin-top: 0.65rem;
  gap: 2px;
}

.vxbmi__sseg {
  text-align: center;
  padding: 0.22rem 0.1rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 600;
}

/* ── Info Tiles ──────────────────────────────────────────────────────────── */
.vxbmi__tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.vxbmi__tile {
  background: var(--vx-cream);
  border: 1.5px solid var(--vx-border-l);
  border-radius: var(--vx-rc);
  padding: 0.8rem 1rem;
  box-shadow: 0 2px 12px rgba(0, 15, 43, 0.07);
}

.vxbmi__tile--hidden {
  display: none;
}

.vxbmi__tile-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vx-muted);
  margin-bottom: 0.2rem;
}

.vxbmi__tile-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--vx-text);
}

/* ── WHO Classification Card ─────────────────────────────────────────────── */
.vxbmi__who-card {
  background: #fff;
  border: 1.5px solid var(--vx-border-l);
  border-radius: var(--vx-rc);
  margin-bottom: 1.1rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 15, 43, 0.07);
}

.vxbmi__who-hdr {
  background: var(--vx-navy);
  padding: 0.75rem 1.25rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

.vxbmi__who-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.vxbmi__who-table th {
  text-align: left;
  font-weight: 600;
  color: var(--vx-muted);
  padding: 0.55rem 1.25rem;
  border-bottom: 2px solid var(--vx-navy);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--vx-cream);
}

.vxbmi__who-table td {
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid var(--vx-cream-2);
  color: var(--vx-text);
}

.vxbmi__who-table tr:last-child td {
  border-bottom: none;
}

.vxbmi__who-table tr:nth-child(even) {
  background: var(--vx-cream-2);
}

.vxbmi__who-table tr.vxbmi__row--active {
  background: var(--vx-extra);
}

.vxbmi__who-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.7rem;
}

/* ── Educational Note ────────────────────────────────────────────────────── */
.vxbmi__edu {
  background: var(--vx-extra);
  border-left: 3px solid var(--vx-brand);
  border-radius: 0 9px 9px 0;
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--vx-navy-3);
  margin-bottom: 1rem;
}

.vxbmi__edu strong {
  font-weight: 600;
  color: var(--vx-navy);
}

/* ── Download Buttons ────────────────────────────────────────────────────── */
.vxbmi__dl-row {
  display: flex;
  gap: 0.75rem;
}

.vxbmi__btn-pdf,
.vxbmi__btn-html {
  flex: 1;
  padding: 0.7rem 0.75rem;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

/* Primary: navy bg, white text */
.vxbmi__btn-pdf {
  background: var(--vx-navy);
  color: #fff;
  border: 1.5px solid var(--vx-navy);
}

.vxbmi__btn-pdf:hover {
  background: var(--vx-navy-4);
  border-color: var(--vx-navy-4);
}

/* Secondary: outline, orange hover */
.vxbmi__btn-html {
  background: transparent;
  color: var(--vx-text);
  border: 1.5px solid var(--vx-border-l);
}

.vxbmi__btn-html:hover {
  background: rgba(232, 117, 10, 0.07);
  border-color: var(--vx-accent);
  color: var(--vx-accent);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* Stack 2-col grids at 440 px */
@media (max-width: 440px) {
  .vxbmi__g2 {
    grid-template-columns: 1fr;
  }

  .vxbmi__tiles {
    grid-template-columns: 1fr;
  }

  .vxbmi__dl-row {
    flex-direction: column;
  }
}

/* Reduce padding at 360 px */
@media (max-width: 360px) {
  .vxbmi__wrap {
    padding: 1rem 0.75rem 2rem;
  }

  .vxbmi__hdr {
    padding: 1.2rem 1rem 1.1rem;
  }

  .vxbmi__title {
    font-size: 1.5rem;
  }

  .vxbmi__card-body {
    padding: 1rem;
  }
}
