/* ==========================================================================
   Vitaroxi — Calorie Calculator  |  calorie.css
   Two-signal rule: orange (#e8750a) = nutrition tool (this tool)
   Green (#71b230) used only for step badges and brand label (standard UI)
   ========================================================================== */

/* ── CSS Custom Properties ─────────────────────────────────────────────── */
.vxcal {
  --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;
}

/* ── Root container ─────────────────────────────────────────────────────── */
.vxcal {
  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 ──────────────────────────────────────────────────────── */
.vxcal *,
.vxcal *::before,
.vxcal *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

.vxcal button {
  cursor: pointer;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.vxcal__err--vis {
  display: block;
}

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

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

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

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

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

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

.vxcal__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 ──────────────────────────────────────────────────────────────── */
.vxcal__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;
}

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

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

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

.vxcal__wbox > .vxcal__iu {
  border: none;
  border-radius: 0;
  box-shadow: none !important;
}

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

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

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

.vxcal__wtbtn:hover:not(.vxcal__wtbtn--active) {
  background: var(--vx-accent-p);
}

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

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

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

.vxcal__hbox > .vxcal__iu {
  border: none;
  border-radius: 0;
  box-shadow: none !important;
}

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

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

.vxcal__hbox-ftin .vxcal__inp {
  padding: 0.55rem 0.6rem;
  font-size: 0.88rem;
}

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

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

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

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

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

.vxcal__htbtn:hover:not(.vxcal__htbtn--active) {
  background: var(--vx-accent-p);
}

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

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

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

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

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

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

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

.vxcal__rbtn--sel .vxcal__rdot {
  border-color: var(--vx-accent);
  background: var(--vx-accent);
}

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

/* ── Calculate Button — orange for nutrition tool ────────────────────────── */
.vxcal__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;
}

.vxcal__btn-calc:hover {
  background: var(--vx-accent-d);
}

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

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

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

/* ── TDEE Hero ───────────────────────────────────────────────────────────── */
.vxcal__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;
}

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

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

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

.vxcal__hero-unit {
  font-size: 0.8rem;
  color: var(--vx-muted-d);
  margin-top: 0.35rem;
}

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

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

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

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

/* ── Goals Section ───────────────────────────────────────────────────────── */
.vxcal__goals-title {
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--vx-text);
  margin-bottom: 0.65rem;
}

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

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

.vxcal__goal-card--loss {
  border-color: var(--vx-accent);
  background: var(--vx-accent-p);
}

.vxcal__goal-card--maintain {
  border-color: var(--vx-brand);
  background: var(--vx-extra);
}

.vxcal__goal-card--gain {
  border-color: var(--vx-teal);
  background: var(--vx-teal-p);
}

.vxcal__goal-icon {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  display: block;
}

.vxcal__goal-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

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

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

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

.vxcal__goal-sub {
  font-size: 0.62rem;
  color: var(--vx-muted);
  margin-top: 0.2rem;
}

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

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

.vxcal__macro-body {
  padding: 1rem 1.25rem;
  background: var(--vx-cream);
}

.vxcal__macro-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

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

.vxcal__macro-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--vx-text);
  width: 60px;
  flex-shrink: 0;
}

.vxcal__macro-bar-wrap {
  flex: 1;
}

.vxcal__macro-track {
  height: 8px;
  background: var(--vx-cream-2);
  border-radius: 6px;
  overflow: hidden;
}

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

.vxcal__macro-fill--carb { background: var(--vx-brand); }
.vxcal__macro-fill--prot { background: var(--vx-teal); }
.vxcal__macro-fill--fat  { background: var(--vx-accent); }

.vxcal__macro-grams {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--vx-text);
  width: 44px;
  text-align: right;
  flex-shrink: 0;
}

.vxcal__macro-pct {
  font-size: 0.7rem;
  color: var(--vx-muted);
  width: 34px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Educational Note ────────────────────────────────────────────────────── */
.vxcal__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: 1rem;
}

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

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

.vxcal__btn-pdf,
.vxcal__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;
}

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

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

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

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

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

@media (max-width: 440px) {
  .vxcal__g2 {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 360px) {
  .vxcal__wrap {
    padding: 1rem 0.75rem 2rem;
  }

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

  .vxcal__title {
    font-size: 1.5rem;
  }

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