/* Ideal Weight & BMI Calculator */
.iwc {
	--iwc-primary: #4107a1;
	--iwc-under: #38bdf8;
	--iwc-healthy: #22c55e;
	--iwc-over: #f59e0b;
	--iwc-obese: #ef4444;
	--iwc-border: #e5e7eb;
	--iwc-ink: #181d27;
	--iwc-muted: #6b7280;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: var(--iwc-ink);
	max-width: 760px;
	margin: 24px auto;
}
.iwc *, .iwc *::before, .iwc *::after { box-sizing: border-box; }

.iwc__form { background: #fff; border: 1px solid var(--iwc-border); border-radius: 14px; padding: 20px; }
.iwc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.iwc__field { display: flex; flex-direction: column; gap: 6px; }
.iwc__label { font-size: 14px; font-weight: 600; color: var(--iwc-ink); }
.iwc__label-row { display: flex; align-items: center; justify-content: space-between; }

.iwc__input {
	width: 100%; height: 44px; padding: 0 12px; font-size: 16px;
	border: 1px solid var(--iwc-border); border-radius: 8px; background: #fff; color: var(--iwc-ink);
}
.iwc__input:focus { outline: none; border-color: var(--iwc-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--iwc-primary) 18%, transparent); }
.iwc__field.has-error .iwc__input { border-color: var(--iwc-obese); }

.iwc__ftin { display: flex; align-items: center; gap: 8px; }
.iwc__ftin .iwc__input { text-align: center; }
.iwc__ftin span { color: var(--iwc-muted); font-size: 14px; }

.iwc__error { color: var(--iwc-obese); font-size: 12.5px; min-height: 1em; }
.iwc__generic-error { color: var(--iwc-obese); font-size: 14px; margin: 10px 0 0; }

/* Toggles */
.iwc__toggle, .iwc__unit { display: inline-flex; border: 1px solid var(--iwc-border); border-radius: 8px; overflow: hidden; }
.iwc__toggle-btn, .iwc__unit-btn {
	border: 0; background: #fff; cursor: pointer; color: var(--iwc-muted);
	font-family: inherit; font-weight: 600;
}
.iwc__toggle-btn { padding: 10px 18px; font-size: 14px; }
.iwc__unit-btn { padding: 5px 12px; font-size: 12.5px; }
.iwc__toggle-btn.is-active, .iwc__unit-btn.is-active { background: var(--iwc-primary); color: #fff; }

/* Calculate button */
.iwc__calc {
	margin-top: 18px; width: 100%; height: 48px; border: 0; border-radius: 10px;
	background: var(--iwc-primary); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
	font-family: inherit; transition: opacity .15s;
}
.iwc__calc:disabled { opacity: .45; cursor: not-allowed; }

/* Results */
.iwc__results { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.iwc__card {
	background: #fff; border: 1px solid var(--iwc-border); border-radius: 14px; padding: 20px;
	display: flex; flex-direction: column; gap: 8px; min-height: 120px;
}
.iwc__card.is-inactive { border-style: dashed; background: #fafafa; }
.iwc__card.is-inactive .iwc__bmi-value,
.iwc__card.is-inactive .iwc__range-value { color: #c7cad1; }
.iwc__card-title { font-size: 14px; color: var(--iwc-muted); font-weight: 600; }
.iwc__bmi-value { font-size: 34px; font-weight: 800; line-height: 1; }
.iwc__range-value { font-size: 22px; font-weight: 700; }

.iwc__pill { align-self: flex-start; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; }
.iwc__pill--underweight { background: var(--iwc-under); }
.iwc__pill--healthy-weight { background: var(--iwc-healthy); }
.iwc__pill--overweight { background: var(--iwc-over); }
.iwc__pill--obese { background: var(--iwc-obese); }

/* Scale bar (landing page) */
.iwc__scale { margin-top: 10px; }
.iwc__scale-bar { position: relative; display: flex; height: 10px; border-radius: 999px; overflow: hidden; }
.iwc__scale-zone { display: block; height: 100%; }
.iwc__scale-zone--under { width: 14%; background: var(--iwc-under); }      /* 15–18.5 of 15–40 */
.iwc__scale-zone--healthy { width: 26%; background: var(--iwc-healthy); }  /* 18.5–25 */
.iwc__scale-zone--over { width: 20%; background: var(--iwc-over); }        /* 25–30 */
.iwc__scale-zone--obese { width: 40%; background: var(--iwc-obese); }      /* 30–40 */
.iwc__scale-marker {
	position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%;
	background: #fff; border: 3px solid var(--iwc-ink); transform: translate(-50%, -50%);
}
.iwc__scale-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--iwc-muted); margin-top: 4px; }

/* Formulas (landing page) */
.iwc__formulas { margin-top: 22px; }
.iwc__formulas.is-inactive { opacity: .5; }
.iwc__formulas-title { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.iwc__formula-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.iwc__formula-card {
	border: 1px solid var(--iwc-border); border-radius: 12px; padding: 14px 16px;
	display: flex; flex-direction: column; gap: 4px;
}
.iwc__formula-name { font-size: 13px; color: var(--iwc-muted); font-weight: 600; }
.iwc__formula-val { font-size: 20px; font-weight: 700; }

/* CTA + banner */
.iwc__cta {
	display: inline-flex; align-items: center; justify-content: center; margin-top: 18px;
	padding: 12px 22px; background: var(--iwc-primary); color: #fff !important; text-decoration: none !important;
	border-radius: 10px; font-weight: 700;
}
.iwc__banner { display: block; margin-top: 22px; }
.iwc__banner img { display: block; width: 100%; height: auto; border-radius: 12px; }

@media (max-width: 600px) {
	.iwc__grid, .iwc__results, .iwc__formula-grid { grid-template-columns: 1fr; }
}
