/* =========================================================
   BMI CALCULATOR - SCOPED STYLES
   ========================================================= */

.bmi-calculator-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 35px 20px 50px;
    box-sizing: border-box;
    font-family: "Inter", Arial, sans-serif;
    color: #111827;
}

.bmi-calculator-wrapper *,
.bmi-calculator-wrapper *::before,
.bmi-calculator-wrapper *::after {
    box-sizing: border-box;
}


/* =========================================================
   MAIN WIDTH
   ========================================================= */

.bmi-calculator-wrapper > .bmi-header,
.bmi-calculator-wrapper > .bmi-calculator,
.bmi-calculator-wrapper > .bmi-description {
    width: 100%;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   HEADER
   ========================================================= */

.bmi-header {
    margin-bottom: 15px;
}

.bmi-header h1 {
    margin: 0 0 18px;
    padding: 0;
    font-size: 34px;
    line-height: 1.2;
    color: #172554;
    font-weight: 700;
}

.bmi-header p {
    margin: 0 0 8px;
    padding: 14px 20px;
    background: #009B3A;
    color: #ffffff;
    text-align: center;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
}


/* =========================================================
   MAIN CALCULATOR
   ========================================================= */

.bmi-calculator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    border: 1px solid #cfcfcf;
}


/* =========================================================
   INPUT SIDE
   ========================================================= */

.bmi-calculator-wrapper .calculator-input {
    min-width: 0;
    background: #eeeeee;
}


/* =========================================================
   MAIN TABS
   ========================================================= */

.bmi-tabs {
    display: flex;
    align-items: stretch;
    background: #eeeeee;
    border-bottom: 1px solid #cccccc;
}

.bmi-calculator-wrapper .bmi-tab {
    flex: 1;
    min-height: 45px;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-right: 1px solid #ffffff;
    border-radius: 0;
    background: #ffffff;
    color: #111111;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 700;
    cursor: pointer;
}

.bmi-calculator-wrapper .bmi-tab:hover {
    opacity: 0.9;
}

.bmi-calculator-wrapper .bmi-tab.active {
    background: #009B3A;
    color: #ffffff;
}


/* =========================================================
   INPUT CONTENT
   ========================================================= */

.input-content {
    padding: 20px 18px;
}


/* =========================================================
   FORM ROW
   ========================================================= */

.bmi-calculator-wrapper .form-row {
    display: grid;
    grid-template-columns: 75px 1fr;
    align-items: center;
    gap: 15px;
    margin: 0 0 17px;
}

.bmi-calculator-wrapper .form-row > label:first-child {
    margin: 0;
    padding: 0;
    font-size: 18px;
    line-height: 1.4;
    color: #222222;
}


/* =========================================================
   FIELD WRAPPER
   ========================================================= */

.field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.bmi-calculator-wrapper .field-wrapper input,
.bmi-calculator-wrapper .field-wrapper select {
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 70px 0 10px;
    border: 1px solid #008A34;
    border-radius: 3px;
    background: #ffffff;
    color: #111111;
    font-family: inherit;
    font-size: 17px;
    line-height: 1.2;
    outline: none;
}

.bmi-calculator-wrapper .field-wrapper input:focus,
.bmi-calculator-wrapper .field-wrapper select:focus {
    border-color: #007A2F;
    box-shadow: 0 0 0 2px rgba(70, 92, 166, 0.15);
}

.bmi-calculator-wrapper .field-wrapper span {
    position: absolute;
    right: 10px;
    color: #777777;
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
}


/* =========================================================
   HEIGHT INPUTS
   ========================================================= */

.height-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-width: 0;
}

.height-inputs .field-wrapper input,
.height-inputs .field-wrapper select {
    padding-right: 55px;
}


/* =========================================================
   GENDER
   ========================================================= */

.gender-options {
    display: flex;
    align-items: center;
    gap: 20px;
}

.bmi-calculator-wrapper .radio-option {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 0;
    font-size: 17px;
    line-height: 1.2;
    cursor: pointer;
}

.bmi-calculator-wrapper .radio-option input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #009B3A;
    cursor: pointer;
}


/* =========================================================
   HIDDEN FIELDS
   ========================================================= */

.bmi-calculator-wrapper [hidden] {
    display: none !important;
}


/* =========================================================
   ACTION BUTTONS
   ========================================================= */

.bmi-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    margin-top: 20px;
}

.bmi-calculator-wrapper .calculate-button,
.bmi-calculator-wrapper .reset-button {
    height: 50px;
    margin: 0;
    padding: 0 22px;
    border: 0;
    border-radius: 0;
    font-family: inherit;
    font-size: 17px;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
}

.bmi-calculator-wrapper .calculate-button {
    background: #399900;
    color: #ffffff;
}

.bmi-calculator-wrapper .calculate-button:hover {
    background: #2f8200;
}

.bmi-calculator-wrapper .calculate-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.bmi-calculator-wrapper .reset-button {
    background: #aaaaaa;
    color: #ffffff;
}

.bmi-calculator-wrapper .reset-button:hover {
    background: #8f8f8f;
}


/* =========================================================
   RESULT
   ========================================================= */

.bmi-calculator-wrapper .calculator-result {
    min-width: 0;
    min-height: 100%;
    background: #ffffff;
}

.bmi-calculator-wrapper .result-header {
    margin: 0;
    padding: 8px 15px;
    background: #399900;
}

.bmi-calculator-wrapper .result-header h2 {
    margin: 0;
    padding: 0;
    color: #ffffff;
    font-size: 28px;
    line-height: 1.3;
    font-weight: 400;
}

.result-content {
    padding: 15px;
}

.result-title {
    margin: 0 0 5px;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
}

.bmi-value {
    margin: 0 0 5px;
    font-size: 25px;
    line-height: 1.3;
    font-weight: 700;
    color: #111111;
}

.bmi-category {
    margin: 0 0 22px;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;
    color: #cc0000;
}


/* =========================================================
   BMI GAUGE
   ========================================================= */

.bmi-gauge-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin: 10px 0 15px;
}

.bmi-calculator-wrapper #bmi-gauge {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
}

.bmi-calculator-wrapper .bmi-gauge-numbers text {
    font-size: 11px;
    fill: #333333;
    font-weight: 600;
}

.bmi-calculator-wrapper .bmi-gauge-labels text {
    font-size: 10px;
    fill: #333333;
    font-weight: 600;
}

.bmi-calculator-wrapper .bmi-gauge-value {
    font-size: 14px;
    fill: #333333;
    font-weight: 700;
}


/* Needle */

/* .bmi-calculator-wrapper #bmi-needle-group {
    transform-box: fill-box;
    transform-origin: 50% 50%;
} */


/* =========================================================
   BMI RANGE
   ========================================================= */

.bmi-ranges {
    margin-top: 15px;
}

.bmi-ranges h3 {
    margin: 0 0 10px;
    padding: 0;
    font-size: 18px;
    line-height: 1.3;
    color: #222222;
}

.range-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 6px 0;
    font-size: 15px;
    line-height: 1.4;
}

.range-row::before {
    content: "•";
    font-size: 20px;
    line-height: 15px;
}

.range-row span {
    flex: 1;
}

.range-row strong {
    font-weight: 500;
}


/* =========================================================
   DESCRIPTION
   ========================================================= */

.bmi-description {
    margin-top: 25px;
}

.bmi-description p {
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #222222;
}


/* =========================================================
   OTHER UNITS
   ========================================================= */

.other-units-fields {
    width: 100%;
    margin: 0;
    padding: 24px;
    background: #f8f9fa;
    border: 1px solid #d8d8d8;
}

.other-units-content {
    width: 100%;
}

.other-units-content h3 {
    margin: 0 0 8px;
    padding: 0;
    font-size: 21px;
    line-height: 1.3;
    font-weight: 600;
    color: #222222;
}

.other-units-content > p {
    margin: 0 0 20px;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #666666;
}


/* =========================================================
   CONVERTER TABS
   ========================================================= */

.converter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #dddddd;
}

.bmi-calculator-wrapper .converter-tab {
    margin: 0;
    padding: 9px 15px;
    border: 1px solid #d5d9dd;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 500;
    cursor: pointer;
}

.bmi-calculator-wrapper .converter-tab:hover {
    background: #f0f0f0;
}

.bmi-calculator-wrapper .converter-tab.active {
    background: #009B3A;
    color: #ffffff;
    border-color: #009B3A;
}


/* =========================================================
   CONVERTER PANEL
   ========================================================= */

.converter-panel {
    width: 100%;
}

.converter-panel[hidden] {
    display: none !important;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: end;
}

.converter-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.converter-field label {
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 600;
    color: #333333;
}

.bmi-calculator-wrapper .converter-field select {
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #cfd4da;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.bmi-calculator-wrapper .converter-field select:focus {
    border-color: #009B3A;
    box-shadow: 0 0 0 2px rgba(70, 92, 166, 0.12);
}


/* =========================================================
   CONVERTER INPUT ROW
   ========================================================= */

.converter-input-row {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.bmi-calculator-wrapper .converter-input-row input {
    flex: 1;
    min-width: 0;
    height: 44px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #cfd4da;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.bmi-calculator-wrapper .converter-input-row input:focus {
    border-color: #009B3A;
    box-shadow: 0 0 0 2px rgba(70, 92, 166, 0.12);
}

.bmi-calculator-wrapper .converter-input-row button {
    height: 44px;
    margin: 0;
    padding: 0 20px;
    border: 0;
    border-radius: 4px;
    background: #009B3A;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.bmi-calculator-wrapper .converter-input-row button:hover {
    background: #35488c;
}


/* =========================================================
   CONVERTER RESULT
   ========================================================= */

.converter-result {
    min-height: 45px;
    margin-top: 20px;
    padding: 15px 18px;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.4;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 750px) {

    .bmi-calculator-wrapper {
        padding: 25px 15px 40px;
    }

    .bmi-calculator {
        grid-template-columns: 1fr;
    }

    .calculator-result {
        border-top: 1px solid #cccccc;
    }

    .bmi-header h1 {
        font-size: 30px;
    }

    .bmi-header p {
        font-size: 16px;
    }

    .other-units-fields {
        padding: 18px;
    }

    .converter-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 500px) {

    .bmi-calculator-wrapper {
        padding: 15px 10px 30px;
    }

    .bmi-header h1 {
        font-size: 27px;
    }

    .bmi-header p {
        font-size: 14px;
        padding: 12px 10px;
    }

    .bmi-tabs {
        flex-direction: column;
    }

    .bmi-calculator-wrapper .bmi-tab {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid #ffffff;
    }

    .input-content {
        padding: 18px 12px;
    }

    .bmi-calculator-wrapper .form-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .bmi-calculator-wrapper .form-row > label:first-child {
        font-size: 16px;
    }

    .height-inputs {
        grid-template-columns: 1fr;
    }

    .gender-options {
        gap: 15px;
    }

    .bmi-actions {
        justify-content: stretch;
    }

    .bmi-calculator-wrapper .calculate-button,
    .bmi-calculator-wrapper .reset-button {
        flex: 1;
        padding: 0 12px;
    }

    .result-header h2 {
        font-size: 24px;
    }

    .bmi-value {
        font-size: 22px;
    }

    .bmi-calculator-wrapper #bmi-gauge {
        max-width: 280px;
    }

    .other-units-fields {
        padding: 15px;
    }

    .converter-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .bmi-calculator-wrapper .converter-tab {
        width: 100%;
    }

    .converter-input-row {
        flex-direction: column;
    }

    .bmi-calculator-wrapper .converter-input-row button {
        width: 100%;
    }
}