/* ==========================================
   BMI CALCULATOR PAGE
========================================== */

.bmi-header{
    text-align:center;
    padding:45px 20px;
    background:linear-gradient(135deg,#16a34a,#059669);
    color:white;
}

.bmi-header h1{
    font-size:44px;
    margin-bottom:10px;
}

.bmi-header p{
    font-size:18px;
    opacity:.95;
}

.bmi-page{
    max-width:1200px;
    margin:auto;
    padding:50px 20px;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:40px;
}

.bmi-card,
.bmi-result-card,
.bmi-info{
    background:#ffffff;
    color:#1f2937;
    border:1px solid #e5e7eb;
    border-radius:24px;
    box-shadow:0 25px 60px rgba(0,0,0,.12);
    padding:35px;
}

.bmi-info{
    max-width:1200px;
    margin:0 auto 40px;
}

.bmi-card h2,
.bmi-result-card h2,
.bmi-info h2{
    color:#1f2937;
    margin-bottom:22px;
}
.bmi-number{
    font-size:60px;
    font-weight:800;
    color:#10b981;
    margin:18px 0 8px;
}

.bmi-category{
    display:inline-block;
    font-size:20px;
    font-weight:800;
    padding:10px 16px;
    border-radius:999px;
    background:#ecfdf5;
    color:#047857;
    margin-bottom:12px;
}

.bmi-advice{
    margin-top:20px;
    font-size:17px;
    line-height:1.7;
    color:#475569;
    font-weight:600;
}

body.dark-mode .bmi-category{
    background:rgba(16,185,129,.18);
    color:#6ee7b7;
}

body.dark-mode .bmi-advice,
body.dark-mode .bmi-number{
    color:white;
}

.input-group{
    margin-bottom:18px;
}

.input-group label{
    display:block;
    margin-bottom:8px;
    font-weight:700;
    color:#1f2937;
}

.input-group input{
    width:100%;
    padding:14px 16px;
    border-radius:12px;
    border:1px solid #d1d5db;
    background:#ffffff;
    color:#111827;
    font-size:16px;
    outline:none;
}

.input-group input:focus{
    border-color:#22c55e;
    box-shadow:0 0 0 4px rgba(34,197,94,.20);
}

.unit-switch{
    margin-bottom:18px;
}

.unit-btn{
    border:none;
    cursor:pointer;
    padding:8px 12px;
    border-radius:8px;
    font-weight:700;
    background:#e5e7eb;
    color:#111827;
}

.unit-btn.active{
    background:#10b981;
    color:white;
}

.calculate-btn,
.reset-btn{
    border:none;
    cursor:pointer;
    padding:14px 28px;
    border-radius:14px;
    font-size:16px;
    font-weight:700;
    transition:.3s;
}

.calculate-btn{
    background:linear-gradient(135deg,#22c55e,#16a34a);
    color:white;
    box-shadow:0 12px 30px rgba(34,197,94,.35);
}

.calculate-btn:hover{
    transform:translateY(-3px);
    box-shadow:0 18px 40px rgba(34,197,94,.45);
}

.reset-btn{
    background:#334155;
    color:white;
    margin-left:10px;
}

.reset-btn:hover{
    background:#475569;
}

/* ---------- BMI SCALE ---------- */

.bmi-scale{
    position:relative;
    margin:30px 0;
    height:18px;
}

.scale-bar{
    height:14px;
    border-radius:20px;
    background:linear-gradient(
        90deg,
        #3b82f6 0%,
        #3b82f6 25%,
        #22c55e 25%,
        #22c55e 55%,
        #f59e0b 55%,
        #f59e0b 75%,
        #ef4444 75%,
        #ef4444 100%
    );
}

.scale-marker{
    position:absolute;
    top:-8px;
    left:0%;
    width:30px;
    height:30px;
    border-radius:50%;
    background:#ffffff;
    border:5px solid #10b981;
    box-shadow:0 8px 25px rgba(0,0,0,.35);
    transform:translateX(-50%);
    transition:left .8s ease;
}

/* ---------- BMI DARK MODE ---------- */

body.dark-mode .bmi-card,
body.dark-mode .bmi-result-card,
body.dark-mode .bmi-info{
    background:rgba(255,255,255,.08);
    color:white;
    border:1px solid rgba(255,255,255,.14);
    box-shadow:0 25px 60px rgba(0,0,0,.25);
}

body.dark-mode .bmi-card h2,
body.dark-mode .bmi-result-card h2,
body.dark-mode .bmi-info h2,
body.dark-mode .input-group label,
body.dark-mode .bmi-category,
body.dark-mode .bmi-advice,
body.dark-mode .bmi-number{
    color:white;
}

body.dark-mode .input-group input{
    background:#ffffff;
    color:#111827;
}

body.dark-mode .unit-btn{
    background:#334155;
    color:white;
}

body.dark-mode .unit-btn.active{
    background:#10b981;
    color:white;
}

/* ---------- RESPONSIVE ---------- */

@media(max-width:768px){
    .bmi-page{
        grid-template-columns:1fr;
        padding:30px 15px;
    }

    .bmi-header h1{
        font-size:34px;
    }

    .bmi-card,
    .bmi-result-card,
    .bmi-info{
        padding:25px;
    }

    .calculate-btn,
    .reset-btn{
        width:100%;
        margin-left:0;
        margin-top:10px;
    }
}

/* =========================================================
   TOOLXONE BMI CALCULATOR
   SEO / EDUCATIONAL GUIDE
   ========================================================= */

.bmi-guide {
    width: min(1120px, calc(100% - 40px));
    margin: 36px auto;
    padding: 38px 42px;

    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;

    box-shadow:
        0 14px 35px rgba(15, 23, 42, 0.07);

    color: #334155;
    line-height: 1.75;
}


/* =========================================================
   MAIN GUIDE TITLE
   ========================================================= */

.bmi-guide > h2 {
    margin: 0 0 20px;

    color: #0f172a;
    font-size: 2rem;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.02em;
}


/* =========================================================
   SECTION HEADINGS
   ========================================================= */

.bmi-guide h3 {
    margin: 32px 0 12px;

    color: #0f172a;
    font-size: 1.18rem;
    line-height: 1.4;
    font-weight: 750;
}


/* =========================================================
   PARAGRAPHS
   ========================================================= */

.bmi-guide p {
    margin: 0 0 18px;

    color: #475569;
    font-size: 1rem;
    line-height: 1.75;
}

.bmi-guide p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   BMI FORMULA BOXES
   ========================================================= */

.bmi-formula {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    margin: 18px 0 22px;
    padding: 20px 24px;

    background:
        linear-gradient(
            135deg,
            #eff6ff 0%,
            #f0fdf4 100%
        );

    border: 1px solid #bfdbfe;
    border-left: 4px solid #2563eb;
    border-radius: 14px;

    color: #0f172a;
    font-size: 1.12rem;
    line-height: 1.5;
    font-weight: 800;
    text-align: center;

    box-sizing: border-box;
}


/* Worked example */

.bmi-formula-example {
    background:
        linear-gradient(
            135deg,
            #f0fdf4 0%,
            #ecfdf5 100%
        );

    border-color: #bbf7d0;
    border-left-color: #10b981;
}


/* =========================================================
   BMI RANGE TABLE
   ========================================================= */

.bmi-range-table {
    margin: 20px 0 24px;

    border: 1px solid #e2e8f0;
    border-radius: 16px;

    overflow: hidden;

    background: #ffffff;
}


/* Individual range */

.bmi-range-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding: 16px 20px;

    border-bottom: 1px solid #e2e8f0;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.bmi-range-row:last-child {
    border-bottom: 0;
}

.bmi-range-row:hover {
    background: #f8fafc;
}


/* Labels */

.bmi-range-row strong {
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 750;
}


/* Range values */

.bmi-range-row span {
    flex-shrink: 0;

    padding: 6px 12px;

    background: #f1f5f9;
    border-radius: 999px;

    color: #475569;
    font-size: 0.9rem;
    font-weight: 700;
}


/* =========================================================
   RANGE VISUAL ACCENTS
   ========================================================= */

.bmi-range-row:nth-child(1) {
    border-left: 4px solid #3b82f6;
}

.bmi-range-row:nth-child(2) {
    border-left: 4px solid #22c55e;
}

.bmi-range-row:nth-child(3) {
    border-left: 4px solid #f59e0b;
}

.bmi-range-row:nth-child(4) {
    border-left: 4px solid #ef4444;
}


/* =========================================================
   INTERNAL LINKS
   ========================================================= */

.bmi-guide a {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;

    transition:
        color 0.2s ease,
        text-decoration-color 0.2s ease;
}

.bmi-guide a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.bmi-guide a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 3px;
    border-radius: 4px;
}


/* =========================================================
   MOBILE RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

    .bmi-guide {
        width: calc(100% - 28px);

        margin: 28px auto;
        padding: 28px 22px;

        border-radius: 18px;
    }

    .bmi-guide > h2 {
        font-size: 1.6rem;
    }

    .bmi-guide h3 {
        margin-top: 27px;
        font-size: 1.08rem;
    }

    .bmi-guide p {
        font-size: 0.96rem;
        line-height: 1.7;
    }

    .bmi-formula {
        padding: 17px 16px;

        font-size: 1rem;
    }

    .bmi-range-row {
        gap: 14px;
        padding: 15px 16px;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .bmi-guide {
        width: calc(100% - 20px);

        margin: 22px auto;
        padding: 24px 18px;

        border-radius: 16px;
    }

    .bmi-guide > h2 {
        font-size: 1.42rem;
    }

    .bmi-guide h3 {
        font-size: 1.03rem;
    }

    .bmi-formula {
        padding: 16px 12px;

        font-size: 0.94rem;

        overflow-wrap: anywhere;
    }

    .bmi-range-row {
        align-items: flex-start;
        flex-direction: column;

        gap: 8px;
    }

    .bmi-range-row span {
        align-self: flex-start;
    }
}


/* =========================================================
   DARK MODE
   Supports common ToolXone theme patterns
   ========================================================= */

body.dark .bmi-guide,
body.dark-mode .bmi-guide,
[data-theme="dark"] .bmi-guide {
    background: #111827;
    border-color: #273449;

    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.22);

    color: #cbd5e1;
}

body.dark .bmi-guide > h2,
body.dark .bmi-guide h3,
body.dark-mode .bmi-guide > h2,
body.dark-mode .bmi-guide h3,
[data-theme="dark"] .bmi-guide > h2,
[data-theme="dark"] .bmi-guide h3 {
    color: #f8fafc;
}

body.dark .bmi-guide p,
body.dark-mode .bmi-guide p,
[data-theme="dark"] .bmi-guide p {
    color: #cbd5e1;
}

body.dark .bmi-formula,
body.dark-mode .bmi-formula,
[data-theme="dark"] .bmi-formula {
    background: #172033;
    border-color: #334155;
    border-left-color: #60a5fa;

    color: #f8fafc;
}

body.dark .bmi-formula-example,
body.dark-mode .bmi-formula-example,
[data-theme="dark"] .bmi-formula-example {
    background: #12261f;
    border-color: #285b46;
    border-left-color: #34d399;
}

body.dark .bmi-range-table,
body.dark-mode .bmi-range-table,
[data-theme="dark"] .bmi-range-table {
    background: #111827;
    border-color: #334155;
}

body.dark .bmi-range-row,
body.dark-mode .bmi-range-row,
[data-theme="dark"] .bmi-range-row {
    border-bottom-color: #334155;
}

body.dark .bmi-range-row:hover,
body.dark-mode .bmi-range-row:hover,
[data-theme="dark"] .bmi-range-row:hover {
    background: #172033;
}

body.dark .bmi-range-row strong,
body.dark-mode .bmi-range-row strong,
[data-theme="dark"] .bmi-range-row strong {
    color: #f1f5f9;
}

body.dark .bmi-range-row span,
body.dark-mode .bmi-range-row span,
[data-theme="dark"] .bmi-range-row span {
    background: #1e293b;
    color: #cbd5e1;
}

body.dark .bmi-guide a,
body.dark-mode .bmi-guide a,
[data-theme="dark"] .bmi-guide a {
    color: #60a5fa;
}