/* ==========================================================================
   Vitaroxi — TDEE Calculator  |  tdee.css
   Two-signal rule: orange (#e8750a) = nutrition tool (this tool)
   ========================================================================== */

.vxtdee {
  --vx-navy:      #000f2b;
  --vx-navy-3:    #0a1f3d;
  --vx-navy-4:    #112244;
  --vx-brand:     #71b230;
  --vx-accent:    #e8750a;
  --vx-accent-d:  #c45e00;
  --vx-accent-p:  #fef3e8;
  --vx-teal:      #1d9e75;
  --vx-teal-p:    #e0f5ee;
  --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;
}

.vxtdee {
  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;
}

.vxtdee *, .vxtdee *::before, .vxtdee *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}

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

.vxtdee button { cursor: pointer; }

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

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

.vxtdee__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;
}

.vxtdee__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;
}

.vxtdee__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;
}

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

/* ── Card ────────────────────────────────────────────────────────────────── */
.vxtdee__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);
}

.vxtdee__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);
}

.vxtdee__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;
}

.vxtdee__step-badge--check {
  background: var(--vx-accent);
  font-size: 0.85rem;
}

.vxtdee__card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

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

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

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

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

.vxtdee__err--vis { display: block; }

/* ── Input + Unit ────────────────────────────────────────────────────────── */
.vxtdee__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;
}

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

.vxtdee__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;
}

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

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

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

.vxtdee__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;
}

/* ── Select ──────────────────────────────────────────────────────────────── */
.vxtdee__select {
  width: 100% !important;
  padding: 0.65rem 2.2rem 0.65rem 0.75rem !important;
  border: 1.5px solid var(--vx-border-l) !important;
  border-radius: var(--vx-ri) !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6a4e' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  font-size: 0.88rem !important;
  color: var(--vx-text) !important;
  cursor: pointer !important;
  outline: none !important;
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

/* ── 2-col grid ──────────────────────────────────────────────────────────── */
.vxtdee__g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Gender ──────────────────────────────────────────────────────────────── */
.vxtdee__gender-row {
  display: flex;
  gap: 0.6rem;
  height: 100%;
  align-items: stretch;
}

.vxtdee__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;
}

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

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

.vxtdee__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;
}

.vxtdee__rbtn--sel .vxtdee__rdot {
  border-color: var(--vx-accent);
  background: var(--vx-accent);
}

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

/* ── Weight Box ──────────────────────────────────────────────────────────── */
.vxtdee__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;
}

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

.vxtdee__wbox > .vxtdee__iu { border: none; border-radius: 0; box-shadow: none !important; }

.vxtdee__wtoggle { display: flex; border-top: 1.5px solid var(--vx-border-l); }

.vxtdee__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;
}

.vxtdee__wtbtn:last-child { border-right: none; }
.vxtdee__wtbtn:hover:not(.vxtdee__wtbtn--active) { background: var(--vx-accent-p); }
.vxtdee__wtbtn--active { background: var(--vx-navy) !important; color: #fff !important; font-weight: 600; }

/* ── Height Box ──────────────────────────────────────────────────────────── */
.vxtdee__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;
}

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

.vxtdee__hbox > .vxtdee__iu { border: none; border-radius: 0; box-shadow: none !important; }

.vxtdee__hbox-ftin {
  display: none;
  align-items: stretch;
  border-top: 1.5px solid var(--vx-border-l);
}

.vxtdee__hbox-ftin--active { display: flex; }
.vxtdee__hbox-ftin .vxtdee__inp { padding: 0.55rem 0.6rem; font-size: 0.88rem; }

.vxtdee__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;
}

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

.vxtdee__htoggle { display: flex; border-top: 1.5px solid var(--vx-border-l); }

.vxtdee__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;
}

.vxtdee__htbtn:last-child { border-right: none; }
.vxtdee__htbtn:hover:not(.vxtdee__htbtn--active) { background: var(--vx-accent-p); }
.vxtdee__htbtn--active { background: var(--vx-navy) !important; color: #fff !important; font-weight: 600; }

/* ── Calculate button (orange — nutrition) ───────────────────────────────── */
.vxtdee__btn-calc {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--vx-accent);
  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;
  margin-top: 0.25rem;
}

.vxtdee__btn-calc:hover { background: var(--vx-accent-d); }
.vxtdee__btn-calc:active { transform: scale(0.99); }

/* ── Results ─────────────────────────────────────────────────────────────── */
.vxtdee__results { display: none; }

.vxtdee__results--vis {
  display: block;
  animation: vxtdeeSlideIn 0.3s ease;
}

@keyframes vxtdeeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Result top row (TDEE hero + BMR tile) ───────────────────────────────── */
.vxtdee__result-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.vxtdee__result-hero {
  background: var(--vx-navy);
  border-radius: var(--vx-rc);
  padding: 1.1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

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

.vxtdee__hero-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--vx-accent);
  margin-bottom: 0.4rem;
}

.vxtdee__hero-val {
  font-family: 'Poppins', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.vxtdee__hero-unit {
  font-size: 0.65rem;
  color: var(--vx-muted-d);
  margin-top: 0.25rem;
}

.vxtdee__bmr-tile {
  background: var(--vx-cream);
  border: 1.5px solid var(--vx-border-l);
  border-radius: var(--vx-rc);
  padding: 1.1rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 15, 43, 0.07);
}

.vxtdee__tile-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--vx-muted);
  margin-bottom: 0.4rem;
}

.vxtdee__tile-val {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--vx-text);
  line-height: 1;
}

.vxtdee__tile-unit {
  font-size: 0.65rem;
  color: var(--vx-muted);
  margin-top: 0.25rem;
}

/* ── Bar Chart ───────────────────────────────────────────────────────────── */
.vxtdee__bars { margin-bottom: 1rem; }

.vxtdee__bar-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}

.vxtdee__bar-row:last-child { margin-bottom: 0; }

.vxtdee__bar-lbl {
  width: 4.5rem;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--vx-muted);
  flex-shrink: 0;
}

.vxtdee__bar-track {
  flex: 1;
  height: 1.2rem;
  background: var(--vx-cream-2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--vx-border-l);
}

.vxtdee__bar-fill {
  height: 100%;
  width: 0;
  border-radius: 6px;
  transition: width 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

.vxtdee__bar-fill--bmr   { background: var(--vx-brand); }
.vxtdee__bar-fill--act   { background: var(--vx-teal); }
.vxtdee__bar-fill--total { background: var(--vx-navy); }

.vxtdee__bar-val {
  width: 3.5rem;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--vx-text);
  flex-shrink: 0;
}

/* ── Goal Cards ──────────────────────────────────────────────────────────── */
.vxtdee__goals-title {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--vx-text);
  margin-bottom: 0.6rem;
}

.vxtdee__goals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.vxtdee__goal-card {
  border-radius: var(--vx-rc);
  padding: 0.9rem 0.65rem;
  text-align: center;
  border: 1.5px solid;
}

.vxtdee__goal-card--loss    { border-color: var(--vx-accent); background: var(--vx-accent-p); }
.vxtdee__goal-card--maintain{ border-color: var(--vx-brand);  background: var(--vx-extra); }
.vxtdee__goal-card--gain    { border-color: var(--vx-teal);   background: var(--vx-teal-p); }

.vxtdee__goal-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  display: block;
}

.vxtdee__goal-card--loss .vxtdee__goal-label     { color: var(--vx-accent-d); }
.vxtdee__goal-card--maintain .vxtdee__goal-label  { color: var(--vx-brand); }
.vxtdee__goal-card--gain .vxtdee__goal-label      { color: var(--vx-teal); }

.vxtdee__goal-val {
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  display: block;
}

.vxtdee__goal-card--loss .vxtdee__goal-val        { color: var(--vx-accent-d); }
.vxtdee__goal-card--maintain .vxtdee__goal-val     { color: var(--vx-brand); }
.vxtdee__goal-card--gain .vxtdee__goal-val         { color: var(--vx-teal); }

.vxtdee__goal-sub {
  font-size: 0.6rem;
  color: var(--vx-muted);
  margin-top: 0.15rem;
}

/* ── Educational Note ────────────────────────────────────────────────────── */
.vxtdee__edu {
  background: var(--vx-accent-p);
  border-left: 3px solid var(--vx-accent);
  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: 0;
}

/* ── Download Buttons ────────────────────────────────────────────────────── */
.vxtdee__dl-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.vxtdee__btn-pdf,
.vxtdee__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;
}

.vxtdee__btn-pdf {
  background: var(--vx-navy);
  color: #fff;
  border: 1.5px solid var(--vx-navy);
}

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

.vxtdee__btn-html {
  background: transparent;
  color: var(--vx-text);
  border: 1.5px solid var(--vx-border-l);
}

.vxtdee__btn-html:hover {
  background: var(--vx-accent-p);
  border-color: var(--vx-accent);
  color: var(--vx-accent-d);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .vxtdee__goals-grid { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .vxtdee__g2 { grid-template-columns: 1fr; }
  .vxtdee__result-top { grid-template-columns: 1fr; }
  .vxtdee__dl-row { flex-direction: column; }
}

@media (max-width: 360px) {
  .vxtdee__wrap { padding: 1rem 0.75rem 2rem; }
  .vxtdee__hdr { padding: 1.2rem 1rem 1.1rem; }
  .vxtdee__title { font-size: 1.5rem; }
  .vxtdee__card-body { padding: 1rem; }
}
