/* ============================================================
   BMI Calculator Widget — CSS
   ============================================================ */

/* ── Card ──────────────────────────────────────────────────── */
.bmi-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    margin: 0 auto;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 8px 40px rgba(0,0,0,0.10);
}

.bmi-main__wrapper {
	display: flex;
}

.flex-column {
	flex-direction: column;
}

.flex-row {
	flex-direction: row;
}
/* ── Header ─────────────────────────────────────────────────── */
.bmi-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 6px;
    text-align: center;
}

.bmi-subtitle {
    font-size: 14px;
    color: #888;
    text-align: center;
    margin: 0 0 24px;
}

/* ── Unit Toggle ─────────────────────────────────────────────── */
.bmi-toggle-wrap {
    display: flex;
    gap: 0;
    background: #f1f5f9;
    border-radius: 0px;
    padding: 4px;
    margin-bottom: 15px;
}

.bmi-toggle-btn {
    flex: 1;
    padding: 5px 16px;
    border: none;
    border-radius: 0px;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1.2;
}

.bmi-toggle-btn span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.7;
}

.bmi-toggle-btn.active {
    background: #ffffff;
    color: #ff8707;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

/* ── Inputs ──────────────────────────────────────────────────── */
.bmi-inputs {
    display: flex;
    gap: 16px;
    margin-bottom: 15px;
	flex-wrap: wrap;
	justify-content: space-between;
}

.bmi-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
	min-width: calc( 50% - 16px );
}

.bmi-label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    letter-spacing: 0.02em;
	line-height: 1;
	margin-bottom: 5px;
}

.bmi-label small {
    font-weight: 400;
    color: #aaa;
    font-size: 11px;
}

.bmi-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.bmi-input-wrap-imperial {
    display: flex;
    gap: 8px;
}

.bmi-input {
    width: 100%;
    padding: 5px 50px 5px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 0px;
    font-size: 15px;
    color: #1a1a2e;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}

.bmi-input::-webkit-outer-spin-button,
.bmi-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bmi-input:focus {
    outline: none;
    border-color: #ff8707;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
    background: #fff;
}

.bmi-unit-badge {
    position: absolute;
    right: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #aaa;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 0px;
    pointer-events: none;
}

/* ── Gender Buttons ──────────────────────────────────────────── */
.bmi-gender-btns {
    display: flex;
    gap: 10px;
}

.bmi-gender-btn {
    flex: 1;
    padding: 5px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 0px;
    background: #f8fafc;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bmi-gender-btn:hover {
    border-color: #c7d2fe;
    color: #ff8707;
}

.bmi-gender-btn.active {
    border-color: #ff8707;
    background: #ff8707;
    color: #ffffff;
}

/* ── Error ───────────────────────────────────────────────────── */
.bmi-error {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #ef4444;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
}

/* ── Button ──────────────────────────────────────────────────── */
.bmi-btn {
    display: block;
    width: 100%;
    padding: 5px 20px;
    background: #ff8707;
    color: #fff;
    border: none;
    border-radius: 0px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    letter-spacing: 0.02em;
}

.bmi-btn:hover {
    background: #cc3626;
    box-shadow: 0 4px 20px rgba(79,70,229,0.35);
    transform: translateY(-1px);
}

.bmi-btn:active {
    transform: translateY(0);
}

/* ── Result Card ─────────────────────────────────────────────── */
.bmi-result {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    margin-top: 24px;
    animation: bmiSlideIn 0.35s ease;
    transition: background-color 0.3s, border-color 0.3s;
}

@keyframes bmiSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Color states */
.bmi-result.underweight {
    background-color: rgba(59,130,246,0.08);
    border-color: #3b82f6;
}
.bmi-result.normal {
    background-color: rgba(34,197,94,0.08);
    border-color: #22c55e;
}
.bmi-result.overweight {
    background-color: rgba(245,158,11,0.08);
    border-color: #f59e0b;
}
.bmi-result.obese {
    background-color: rgba(239,68,68,0.08);
    border-color: #ef4444;
}

.bmi-result-inner {
    display: flex;
    gap: 24px;
    align-items: center;
}

.bmi-result-left {
    flex: 0 0 auto;
    text-align: center;
    min-width: 110px;
}

.bmi-result-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #aaa;
    margin-bottom: 4px;
}

.bmi-result-value {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
    transition: color 0.3s;
    color: #1a1a2e;
}

.bmi-result.underweight .bmi-result-value { color: #3b82f6; }
.bmi-result.normal      .bmi-result-value { color: #22c55e; }
.bmi-result.overweight  .bmi-result-value { color: #f59e0b; }
.bmi-result.obese       .bmi-result-value { color: #ef4444; }

.bmi-result-category {
    font-size: 15px;
    font-weight: 700;
    color: #555;
}

.bmi-result-right {
    flex: 1;
}

.bmi-result-tip {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-top: 10px;
}

/* ── BMI Meter ───────────────────────────────────────────────── */
.bmi-meter-wrap {
    position: relative;
}

.bmi-meter {
    height: 10px;
    border-radius: 99px;
    background: linear-gradient(
        to right,
        #3b82f6 0% 15%,
        #22c55e 15% 45%,
        #f59e0b 45% 65%,
        #ef4444 65% 100%
    );
    position: relative;
    margin-bottom: 4px;
}

.bmi-meter-needle {
    position: absolute;
    top: -5px;
    width: 4px;
    height: 20px;
    background: #1a1a2e;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    left: 0%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.bmi-meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #aaa;
    padding: 0 2px;
}

/* ── Table ───────────────────────────────────────────────────── */
.bmi-table-wrap {
    margin-top: 8px;
}

.bmi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.bmi-table th {
    padding: 8px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #aaa;
    border-bottom: 1.5px solid #f1f5f9;
}

.bmi-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f8fafc;
    color: #555;
    font-weight: 500;
}

.bmi-table td:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bmi-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.bmi-table-underweight .bmi-dot, .bmi-table-underweight .item-bar { background: #3b82f6; }
.bmi-table-normal      .bmi-dot, .bmi-table-normal      .item-bar { background: #22c55e; }
.bmi-table-overweight  .bmi-dot, .bmi-table-overweight  .item-bar { background: #f59e0b; }
.bmi-table-obese       .bmi-dot, .bmi-table-obese       .item-bar { background: #ef4444; }

.bmi-table tr.bmi-table-highlight td {
    font-weight: 700;
}

.bmi-helping__section {
	display: flex;
}

.bmi-help__item {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bmi-help__item .item-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 5px 0 0;
}

.bmi-help__item .bmi-title,
.bmi-help__item .value{
	font-size: 12px;
	color: #555;
	font-weight: 500;
	line-height: 1;
	margin-bottom: 0;
}

.bmi-help__item.bmi-table-highlight .bmi-title {
	color: #cc3626 !important;
}

.item-bar {
	width: 100%;
	height: 10px;
}

.bmi-table-underweight .item-bar {
	border-radius: 5px 0 0 5px ;
}

.bmi-table-obese .item-bar {
	border-radius: 0 5px 5px 0px;
}
/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 500px) {
    .bmi-card {
        padding: 24px 18px;
    }

    .bmi-inputs {
        grid-template-columns: 1fr;
    }

    .bmi-gender-field {
        grid-column: auto;
    }

    .bmi-result-inner {
        flex-direction: column;
        text-align: center;
    }

    .bmi-result-left {
        min-width: auto;
    }
}
