/* Gói gọn biến CSS tại wrapper, không dùng :root */
.bmi-neo-wrapper {
    --bg-light: #fdfdfd;
    --border-ink: 3px solid #111111;
    --shadow-solid: 5px 5px 0px #111111;
    --shadow-pressed: 2px 2px 0px #111111;
    
    /* Bảng màu phân loại BMI */
    --color-underweight: #80ed99;  /* Xanh ngọc */
    --color-normal: #57cc99;       /* Xanh lục tươi */
    --color-overweight: #f4a261;   /* Cam đất */
    --color-obese: #e76f51;        /* Đỏ gạch */
    
    --color-brand: #ffe66d;        /* Vàng chanh làm điểm nhấn chính */

    max-width: 650px;
    margin: 0 auto;
    font-family: ui-sans-serif, system-ui, sans-serif;
    color: #111111;
    box-sizing: border-box;
}

.bmi-neo-wrapper * {
    box-sizing: border-box;
}

/* Header */
.bmi-neo-header {
    background: var(--color-brand);
    border: var(--border-ink);
    box-shadow: var(--shadow-solid);
    padding: 24px;
    border-radius: 0px; /* Cố tình để vuông vức đậm chất Brutalism */
    margin-bottom: 2rem;
}

.bmi-neo-header h2 {
    margin: 0 0 8px 0;
    font-size: 2.2rem;
    font-weight: 900;
}

.bmi-neo-header p {
    margin: 0;
    font-weight: 600;
}

/* Form */
.bmi-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.bmi-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bmi-group label {
    font-weight: 800;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.bmi-neo-wrapper input[type="number"] {
    width: 100%;
    padding: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    border: var(--border-ink);
    background: var(--bg-light);
    box-shadow: 4px 4px 0px #111;
    transition: all 0.2s;
}

.bmi-neo-wrapper input[type="number"]:focus {
    outline: none;
    background: #f0f0f0;
    box-shadow: var(--shadow-solid);
}

/* Nút bấm */
.bmi-neo-btn {
    width: 100%;
    padding: 20px;
    font-size: 1.4rem;
    font-weight: 900;
    background: #111111;
    color: #ffffff;
    border: var(--border-ink);
    box-shadow: var(--shadow-solid);
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.1s;
}

.bmi-neo-btn:hover {
    background: #333333;
}

.bmi-neo-btn:active {
    box-shadow: var(--shadow-pressed);
    transform: translate(3px, 3px);
}

/* Kết quả */
.bmi-neo-result {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 4px solid #111;
}

.bmi-neo-result.show-res {
    display: block !important;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Bảng điểm chính */
.bmin-main-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 2rem;
}

.bmin-score-box, .bmin-ideal-box {
    border: var(--border-ink);
    box-shadow: var(--shadow-solid);
    padding: 20px;
    text-align: center;
    background: var(--bg-light);
}

.bmin-main-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.bmin-number {
    font-size: 3.5rem;
    font-weight: 900;
}

.bmin-ideal-range {
    font-size: 1.8rem;
    font-weight: 800;
    color: #333;
    margin-top: 15px;
}

/* Thanh trực quan */
.bmin-visual-scale {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.scale-block {
    border: var(--border-ink);
    padding: 15px 5px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #eaeaea;
    opacity: 0.6;
    transition: all 0.3s ease;
    filter: grayscale(80%);
}

.scale-block .emoji { font-size: 1.5rem; }
.scale-block .label { font-weight: 800; font-size: 0.9rem; text-transform: uppercase; }
.scale-block .range { font-size: 0.8rem; font-weight: 600; }

/* Trạng thái Active */
.scale-block.is-active {
    opacity: 1;
    filter: grayscale(0%);
    box-shadow: var(--shadow-solid);
    transform: scale(1.05);
    z-index: 2;
}

.block-underweight.is-active { background: var(--color-underweight); }
.block-normal.is-active { background: var(--color-normal); }
.block-overweight.is-active { background: var(--color-overweight); }
.block-obese.is-active { background: var(--color-obese); }

/* Disclaimer */
.bmin-disclaimer {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 15px;
    background: #f1f1f1;
    border: 2px dashed #111;
}

/* Animation */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.95) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
    .bmi-form-grid, .bmin-main-card { grid-template-columns: 1fr; }
    .bmin-visual-scale { grid-template-columns: 1fr 1fr; }
}