/* Body Fat Calculator — scoped styles (bf-) */

.bf-form {
  display: block;
  padding: 1.15rem 1rem 1.35rem;
}

.bf-intro {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-muted, #5a4a42);
}

/* Unit segmented control */
.bf-units {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}

.bf-unit {
  flex: 1 1 0;
  min-width: 140px;
}

.bf-unit input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bf-unit span {
  display: block;
  text-align: center;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--color-beige-border, #e0d4c4);
  border-radius: 10px;
  background: #fff;
  color: #4a0e1f;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.bf-unit input:checked + span {
  background: var(--color-primary, #8b2942);
  border-color: var(--color-primary, #8b2942);
  color: #fff;
}

.bf-unit input:focus-visible + span {
  outline: 2px solid var(--color-primary, #8b2942);
  outline-offset: 2px;
}

/* Method segmented control (Tape / Skinfold / BMI) */
.bf-methods {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 0.6rem;
}

.bf-method {
  flex: 1 1 0;
  min-width: 0;
}

.bf-method input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bf-method span {
  display: block;
  text-align: center;
  padding: 0.5rem 0.4rem;
  border: 1px solid var(--color-beige-border, #e0d4c4);
  border-radius: 10px;
  background: #fff;
  color: #4a0e1f;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.bf-method input:checked + span {
  background: var(--color-primary, #8b2942);
  border-color: var(--color-primary, #8b2942);
  color: #fff;
}

.bf-method input:focus-visible + span {
  outline: 2px solid var(--color-primary, #8b2942);
  outline-offset: 2px;
}

.bf-method-hint {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-muted, #8a7363);
}

.bf-method-hint:empty {
  display: none;
}

/* Inputs grid */
.bf-inputs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 0.9rem;
  margin: 0 0 0.9rem;
}

.bf-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* The class rule above otherwise overrides the [hidden] attribute, leaving the
   hip field visible for men. */
.bf-field[hidden] {
  display: none;
}

.bf-field--name {
  margin: 0 0 1.5rem;
  padding: 0 0 1.25rem;
  border-bottom: 1px solid var(--color-beige-border, #e0d4c4);
}

.bf-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted, #6b5e58);
}

.bf-opt {
  font-weight: 400;
  color: var(--color-muted, #9a8470);
  font-size: 0.74rem;
}

.bf-field input,
.bf-field select {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--color-beige-border, #e0d4c4);
  border-radius: 10px;
  background: #fff;
  color: #2a2220;
  font-size: 1rem;
}

/* Result */
.bf-result[hidden],
.bf-empty[hidden] {
  display: none;
}

.bf-empty {
  margin: 0.6rem 0 0;
  padding: 0.9rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-muted, #6b5e58);
  background: var(--color-beige, #faf3e8);
  border: 1px dashed var(--color-beige-border, #e0d4c4);
  border-radius: 10px;
}

/* Gauge — matches the BMI / Kundli Milan dial. */
.bf-gauge {
  max-width: 300px;
  margin: 0.4rem auto 0.4rem;
}

.bf-gauge__svg {
  width: 100%;
  height: auto;
  display: block;
}

.bf-gauge__rim {
  filter: drop-shadow(0 1px 1px rgba(74, 14, 31, 0.06));
}

.bf-gauge__arc {
  filter: drop-shadow(0 1px 2px rgba(74, 14, 31, 0.12));
}

.bf-gauge__ticks line {
  stroke: #6b5e58;
  stroke-width: 1;
  opacity: 0.5;
}

.bf-gauge__needle {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.bf-gauge__needle-line {
  stroke: #3a2c26;
}

.bf-gauge__needle-hub-outer {
  fill: none;
  stroke: #d4a017;
  stroke-width: 2;
}

.bf-gauge__needle-hub {
  fill: #7a1834;
}

.bf-gauge__num {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-serif, Georgia, "Times New Roman", serif);
  fill: var(--color-primary, #8b2942);
}

.bf-gauge__cat {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font, system-ui, sans-serif);
  fill: #6b5e58;
}

/* Zones legend */
.bf-zones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.6rem;
  margin: 0.6rem 0 1rem;
}

.bf-zone {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--color-beige-border, #e7d9c3);
  border-radius: 999px;
  background: #fff;
  font-size: 0.78rem;
  color: #4d3d34;
}

.bf-zone.is-active {
  background: #fbf4ef;
  border-color: var(--color-primary, #8b2942);
  font-weight: 700;
}

.bf-zone__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.bf-zone__range {
  color: var(--color-muted, #8a7363);
}

.bf-summary {
  margin: 0 0 0.9rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1.5;
  color: #3a2c26;
}

/* Facts */
.bf-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0 0 1.1rem;
}

.bf-fact {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-beige-border, #e7d9c3);
  border-radius: 10px;
  background: var(--color-beige, #faf3e8);
}

.bf-fact[hidden] {
  display: none;
}

.bf-fact__k {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted, #8a6b52);
}

.bf-fact__v {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary, #8b2942);
}

/* Advice */
.bf-advice__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary, #8b2942);
  border-bottom: 2px solid var(--color-beige-border, #eadfce);
  padding-bottom: 0.35rem;
  margin: 0 0 0.7rem;
}

.bf-advice__list {
  margin: 0;
  padding-left: 1.1rem;
}

.bf-advice__list li {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #3a2c26;
}

@media (max-width: 480px) {
  .bf-facts {
    grid-template-columns: 1fr;
  }
}
