/*
    Target: Nutritional-Coaching Template Styles
    Description: Styles for TFC/Woo nutritional-coaching templates and overrides
    Version: 1.0.5
    License:         	TFC 2026
    License URI:     	TFC 2026
*/

.tfc-bmi-card {
  position: relative;
  max-width: 760px;
  border-radius: 28px;
  padding: 10px;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  color: #1f1f1f;
  overflow: visible;
}

.tfc-bmi-toggle-wrap {
  display: flex;
  justify-content: flex-end;
}

.tfc-bmi-unit-switch {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #fff;
    border-radius: 999px;
    background: transparent;
    gap: 0;
    background: rgba(255, 255, 255, 0.30);
}

@media (min-width: 768px) {
  .tfc-bmi-unit-switch {
      margin-bottom: 20px;
  }
}

.tfc-bmi-unit-btn {
    border: none;
    background: transparent;
    color: #1f1f1f;
    font-weight: 500;
    font-size: 16px;
    line-height: 1;
    padding: 6px 24px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

@media (min-width: 768px) {
  .tfc-bmi-unit-btn {
    padding: 8px 30px;
  }
}

.tfc-bmi-unit-btn.active {
    background: #fff;
}

.tfc-bmi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10%;
    margin-bottom: 20px;
}

.tfc-bmi-field {
    min-width: 0;
}

.tfc-bmi-label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #2a2a2a;
    font-size: 16px;
}

@media (min-width: 768px) {
  .tfc-bmi-label {
      font-size: 17px;
  }
}

.tfc-bmi-input-wrap {
    position: relative;
}

.tfc-bmi-input {
    width: 100%;
    height: 48px;
    border-radius: 14px !important;
    border: 1.5px solid rgba(255,255,255,.8);
    background: rgba(255,255,255,0.7);
    box-sizing: border-box;
    padding: 0 60px 0 18px;
    font-size: 28px;
    font-weight: 600;
    color: #1f1f1f;
    outline: none;
    border-radius: 12px;
    border: 1px solid #FFF;
    background: rgba(255, 255, 255, 0.20);
}

.tfc-bmi-input:focus {
  border-color: #fff;
}

.tfc-bmi-suffix {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 500;
  color: #3a3a3a;
  pointer-events: none;
}

.tfc-bmi-input::-webkit-outer-spin-button,
.tfc-bmi-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.tfc-bmi-input[type=number] {
  -moz-appearance: textfield;
}

/* ── Ethnicity row ────────────────────────────────────────────── */

.tfc-bmi-ethnicity-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10%;
    margin-bottom: 20px;
    align-items: end;
}

.tfc-bmi-ethnicity-field {
    min-width: 0;
}

.tfc-bmi-select-wrap {
    position: relative;
}


.tfc-bmi-select {
    width: 100%;
    height: 48px;
    border-radius: 14px !important;
    border: 1.5px solid rgba(255,255,255,.8);
    background: rgba(255,255,255,0.7);
    box-sizing: border-box;
    padding: 0 15px !important;
    font-size: 17px !important;
    font-weight: 500;
    color: #1f1f1f;
    outline: none;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    cursor: pointer;
    background: none !important;
    border-radius: 12px !important;
    border: 1px solid #FFF !important;
    background: rgba(255, 255, 255, 0.20) !important;
    height: 47px !important;
}

.tfc-bmi-select:focus {
    border-color: #fff;
}

.tfc-bmi-select-arrow {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
}

/* ── Info / tooltip ───────────────────────────────────────────── */

.tfc-bmi-info-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(-10px);
}

.tfc-bmi-info-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}

.tfc-bmi-info-btn:hover,
.tfc-bmi-info-btn[aria-expanded="true"] {
    opacity: 1;
}

.tfc-bmi-info-text {
    font-size: 17px;
    font-weight: 400;
    color: #000;
    cursor: default;
}

.tfc-bmi-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    width: 280px;
    background: #fff;
    border-radius: 16px 16px 16px 0;
    padding: 16px 18px;
    font-size: 15px;
    line-height: 20px;
    color: #2a2a2a;
    z-index: 10;
    font-family: "Work Sans", sans-serif;
}
 
.tfc-bmi-info-text,
.tfc-bmi-label {
  font-family: "Work Sans", sans-serif;
}

.tfc-bmi-tooltip[hidden] {
    display: none;
}

/* ── Bottom ───────────────────────────────────────────────────── */

.tfc-bmi-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
}

.tfc-bmi-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.tfc-bmi-calc-btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: #000;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    padding: 10px 34px;
    min-width: 180px;
    cursor: pointer;
    transition: .2s ease;
}

.tfc-bmi-calc-btn:hover {
    opacity: 0.92;
}

.tfc-bmi-link {
    font-size: 18px;
    font-style: italic;
    color: #2b2b2b;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.tfc-bmi-link:hover {
    opacity: 0.85;
}

.tfc-bmi-result {
    border-radius: 16px;
    background: #DDD8A1;
    padding: 10px 25px;
    text-align: center;
    box-sizing: border-box;
    border: 1px solid white;
}

.tfc-bmi-result-label {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 6px;
}

.tfc-bmi-result-value {
  font-size: 35px;
  line-height: 1;
  font-weight: 700;
  color: #111;
}

@media (max-width: 767px) {
  .tfc-bmi-card {
    padding: 24px 20px 28px;
  }

  .tfc-bmi-toggle-wrap {
    justify-content: center;
    margin-bottom: 24px;
  }

  .tfc-bmi-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 28px;
  }

  .tfc-bmi-ethnicity-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tfc-bmi-tooltip {
    width: 240px;
  }

  .tfc-bmi-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  /* Dissolve .tfc-bmi-left so its children participate directly in the
     parent flex, allowing independent ordering of button vs link. */
  .tfc-bmi-left {
    display: contents;
  }

  .tfc-bmi-calc-btn {
    order: 1;
    width: 100%;
    min-width: 0;
    padding: 15px 34px;
    font-size: 17px !important;
  }

  .tfc-bmi-result {
    order: 2;
    display: inline-block;
    min-width: 190px;
    margin: 0 auto;
  }

  .tfc-bmi-info-btn {
    max-width: 30px;
  }

  .tfc-bmi-info-text {
    font-size: 16px;
  }

  .tfc-bmi-link {
    order: 3;
    text-align: center;
  }

  .tfc-bmi-result-value {
    font-size: 42px;
  }
}