/* محاسبه‌گرهای سلامت — استایل سمت کاربر */

/* فونت یکان‌بخ — مسیرها نسبت به همین فایل CSS هستند */
@font-face {
	font-family: 'YekanBakh';
	src: url('../../fonts/YekanBakh/YekanBakhFaNum-Light.woff') format('woff');
	font-weight: 300;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'YekanBakh';
	src: url('../../fonts/YekanBakh/YekanBakhFaNum-Regular.woff') format('woff');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'YekanBakh';
	src: url('../../fonts/YekanBakh/YekanBakhFaNum-SemiBold.woff') format('woff');
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'YekanBakh';
	src: url('../../fonts/YekanBakh/YekanBakhFaNum-Bold.woff') format('woff');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'YekanBakh';
	src: url('../../fonts/YekanBakh/YekanBakhFaNum-ExtraBold.woff') format('woff');
	font-weight: 800;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'YekanBakh';
	src: url('../../fonts/YekanBakh/YekanBakhFaNum-ExtraBlack.woff') format('woff');
	font-weight: 900;
	font-style: normal;
	font-display: swap;
}

.hc-wrap {
	--hc-primary: #0067CD;
	--hc-secondary: #EA131B;
	--hc-font: 'YekanBakh', Tahoma, Arial, sans-serif;
	max-width: 520px;
	margin: auto;
	direction: rtl;
	text-align: right;
	font-family: var(--hc-font);
	font-size: 15px;
	line-height: 1.7;
}

.hc-wrap input,
.hc-wrap select,
.hc-wrap button {
	font-family: var(--hc-font);
}

.hc-wrap * {
	box-sizing: border-box;
}

.hc-title {
	margin: 0 0 .25em;
	font-size: 1.3em;
	color: var(--hc-primary);
}

.hc-desc {
	margin: 0 0 1em;
	color: #555;
	font-size: .95em;
}

/* فرم */
.hc-form {
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 14px;
	padding: 20px;
	box-shadow: 0 4px 18px rgba(0, 0, 0, .05);
}

.hc-fields {
	display: grid;
	gap: 14px;
}

.hc-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: .92em;
}

.hc-req {
	color: var(--hc-secondary);
	margin-inline-start: 3px;
}

.hc-field input,
.hc-field select {
	width: 100%;
	padding: 11px 12px;
	border: 1.5px solid #dcdcdc;
	border-radius: 9px;
	font-size: 1em;
	font-family: inherit;
	background: #fff;
	transition: border-color .15s ease;
}

.hc-field input:focus,
.hc-field select:focus {
	outline: none;
	border-color: var(--hc-primary);
}

.hc-field.hc-has-error input,
.hc-field.hc-has-error select {
	border-color: var(--hc-secondary);
}

/* پیام خطای هر فیلد همیشه یک خط فضای ثابت می‌گیرد تا ظاهر/پنهان‌شدنش
   ارتفاع فرم را تغییر ندهد (جلوگیری از پرش ارتفاع هنگام نمایش خطا). */
.hc-field-error {
	display: block;
	min-height: 1.2em;
	margin-top: 4px;
	color: var(--hc-secondary);
	font-size: .82em;
	line-height: 1.2;
}

/* چیدمان دو ستونه‌ی فیلدها: [health_calculator id="..." columns="2"] */
.hc-cols-2 .hc-fields {
	grid-template-columns: 1fr 1fr;
}

/* فیلدی که باید تمام عرض را بگیرد، کلاس hc-field-full می‌گیرد. */
.hc-cols-2 .hc-fields .hc-field-full {
	grid-column: 1 / -1;
}

@media (max-width: 480px) {
	.hc-cols-2 .hc-fields {
		grid-template-columns: 1fr;
	}
}

/* دکمه */
.hc-submit {
	width: 100%;
	margin-top: 16px;
	padding: 13px;
	border: 0;
	border-radius: 9px;
	background: var(--hc-primary);
	color: #fff;
	font-size: 1.05em;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: filter .15s ease;
}

.hc-submit:hover {
	filter: brightness(1.08);
}

.hc-submit:disabled {
	opacity: .7;
	cursor: default;
}

.hc-submit.hc-loading {
	position: relative;
	color: transparent;
}

.hc-submit.hc-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 3px solid rgba(255, 255, 255, .4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: hc-spin .7s linear infinite;
}

@keyframes hc-spin {
	to { transform: rotate(360deg); }
}

.hc-form-error {
	margin-top: 10px;
	color: var(--hc-secondary);
	font-size: .9em;
}

/* جابه‌جایی فرم ↔ نتیجه (نتیجه جای فرم نمایش داده می‌شود) */
.hc-wrap {
	transition: min-height .2s ease;
}

.hc-form.hc-hidden {
	display: none;
}

/* نتیجه */
.hc-result {
	display: none;
	margin-top: 16px;
}

.hc-result.hc-active {
	display: block;
	margin-top: 0;
}

/* دکمه‌ی محاسبه‌ی مجدد — هم‌ظاهر با دکمه‌ی محاسبه‌ی فرم (.hc-submit) */
.hc-back {
	width: 100%;
	margin-top: 16px;
	padding: 13px;
	border: 0;
	border-radius: 9px;
	background: var(--hc-primary);
	color: #fff;
	font-size: 1.05em;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: filter .15s ease;
}

.hc-back:hover {
	filter: brightness(1.08);
}

.hc-result-card {
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 14px;
	padding: 20px;
	animation: hc-fade .3s ease;
}

@keyframes hc-fade {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

/* نمایش پیش‌فرض نتیجه (فهرستی) */
.hc-result-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hc-result-list li {
	display: flex;
	justify-content: space-between;
	padding: 9px 0;
	border-bottom: 1px dashed #eee;
}

.hc-result-list li:last-child {
	border-bottom: 0;
}

.hc-result-value {
	font-weight: 700;
	color: var(--hc-primary);
}

/* خروجی اصلی برجسته (نمایش پیش‌فرض) */
.hc-result-hero {
	text-align: center;
	padding: 6px 0 16px;
	margin-bottom: 6px;
	border-bottom: 1px solid #f0f0f0;
}

.hc-result-hero-value {
	font-size: 2.6em;
	font-weight: 800;
	line-height: 1.1;
	color: var(--hc-primary);
}

.hc-result-hero-unit {
	font-size: .38em;
	font-weight: 600;
	color: #888;
	margin-inline-start: 4px;
}

.hc-result-hero-label {
	margin-top: 4px;
	font-size: .95em;
	font-weight: 600;
	color: #555;
}

.hc-result-note {
	margin: 14px 0 0;
	padding: 10px 12px;
	background: #f6f8fa;
	border-radius: 9px;
	color: #555;
	font-size: .86em;
	line-height: 1.8;
}

/* سلب مسئولیت — انتهای باکس نتیجه‌ی همه‌ی محاسبه‌گرها */
.hc-result-disclaimer {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin-top: 16px;
	padding: 11px 13px;
	background: #fff8e6;
	border: 1px solid #f3e0b0;
	border-radius: 10px;
}

.hc-disclaimer-icon {
	flex: 0 0 auto;
	margin-top: 3px;
	color: #b8860b;
}

.hc-disclaimer-text {
	margin: 0;
	color: #6b5626;
	font-size: .82em;
	line-height: 1.85;
	text-align: justify;
}

/* در موبایل کمی جمع‌وجورتر */
@media (max-width: 480px) {
	.hc-result-disclaimer {
		gap: 7px;
		padding: 10px 11px;
	}

	.hc-disclaimer-text {
		font-size: .8em;
		line-height: 1.75;
		text-align: right;
	}
}

/* نتیجه‌ی BMI */
.hc-bmi-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.hc-bmi-number {
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.hc-bmi-value {
	font-size: 2.6em;
	font-weight: 800;
	line-height: 1;
	color: var(--hc-primary);
}

.hc-bmi-unit {
	font-size: .9em;
	color: #888;
}

.hc-bmi-category {
	padding: 7px 14px;
	border-radius: 999px;
	font-weight: 700;
	color: #fff;
	background: var(--hc-secondary);
	white-space: nowrap;
}

.hc-bmi-category.hc-cat-normal {
	background: var(--hc-primary);
}

/* گیج — جهت LTR تا مقیاس BMI از کم به زیاد چپ‌به‌راست باشد */
.hc-bmi-gauge {
	position: relative;
	margin: 28px 0 10px;
	direction: ltr;
}

.hc-bmi-gauge-track {
	display: flex;
	height: 12px;
	border-radius: 999px;
	overflow: hidden;
}

.hc-gseg {
	height: 100%;
}

.hc-gseg-under  { width: 14%; background: #f0c419; }
.hc-gseg-normal { width: 26%; background: #27ae60; }
.hc-gseg-over   { width: 20%; background: #f39c12; }
.hc-gseg-obese  { width: 40%; background: #e74c3c; }

.hc-bmi-pointer {
	position: absolute;
	top: -7px;
	width: 4px;
	height: 26px;
	background: #222;
	border-radius: 3px;
	transform: translateX(-50%);
	box-shadow: 0 0 0 3px #fff;
	transition: left .4s ease;
}

.hc-bmi-hint {
	margin: 14px 0 0;
	color: #555;
	font-size: .9em;
}

/* اعلان مخصوص مدیر */
.hc-notice {
	max-width: 520px;
	margin: 1em auto;
	padding: 10px 14px;
	background: #fff3cd;
	border: 1px solid #ffe69c;
	border-radius: 8px;
	font-size: .9em;
	direction: rtl;
}
