.ft-form {
    background-color: white;
    padding: 0rem 2rem 2rem 2rem;
    border-radius: 1rem 1rem 0rem 0.5rem;
    width: min(32rem, 90%);
    border-left: 5px solid #313856;
    border-bottom: 5px solid #313856;

    button[type="submit"]:disabled {
        background-color: silver;
        color: darkgrey;
        cursor: not-allowed;
    }

    .ft-form-group {
        display: flex; !important;
    }

    .ft-form-control-radio-group {
        margin-top: 0.5rem !important;

        &.responsive {
            flex-direction: column;
            align-items: start;
            gap: 0.5rem;

            label {
                flex-direction: row-reverse;
            }
        }
    }

    .ft-form-control {
        label {
            color: black;
        }
    }

    input {
        outline: none;
        box-shadow: none !important;
    }

    span {
        color: white;
    }

    .ft-button {
        justify-self: center;
        margin-top: 2rem;

        &.small {
            margin-top: 1rem;
        }
    }

    .ft-header,
    .ft-sub-header {
        background-color: #313856;
        text-align: center;
    }

    .ft-header {
        padding: 1rem;
        border-radius: 0.5rem 0.5rem 0 0;
        margin: 0 -2rem;
    }

    .ft-sub-header {
        padding: 0.5rem;
        border-radius: 0 5rem 5rem 0;
        margin-left: -2rem;
    }

    .h4 {
        font-size: 2rem;
        font-weight: 700;
        color: white;
    }

    .h5 {
        font-size: 1.8rem;
        font-weight: 700;
        color: white;
    }
}

.radio {
    width: 1.2rem !important;
    height: 1.2rem !important;
}

.radio-label {
    font-size: 0.9rem !important;
}

.dark-text {
    color: black !important;
}

.light-text {
    color: white !important;
}

.bmr-results-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #333;
}

.bmr-results-input {
    max-width: 100%;
    padding: 0.8rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    border: 1px solid #35bdfc;
    border-radius: 0.5rem;
    background-color: #e6f4ff;
    color: #004c99;
    margin: 0 auto;
    text-align: center;
}

.ft-health-form {
    display: flex;
    justify-content: center;
    position: relative;
}

.health-bmi-result,
.health-fat-result,
.health-bmr-result,
.bmr-explanation,
.health-section,
.health-instruction {
    text-align: center;
    align-content: center;
}

.health-bmi-result,
.health-fat-result,
.health-bmr-result,
.bmr-explanation,
.health-instruction {
    font-size: 1rem;
    line-height: 1.6;
}

.health-section {
    font-weight: bold;
    font-size: 0.8rem;
    line-height: 1.2;
    padding: 0 1rem;
}

.health-bmi-result,
.health-fat-result,
.health-bmr-result {
    display: none;
}

.pale-blue {
    background-color: #c6d6da;
}

.light-blue {
    background-color: #4cc2df;
}

.green {
    background-color: #4eb74a;
}

.light-orange {
    background-color: #f69a21;
}

.orange {
    background-color: #f27e1c;
}

.red {
    background-color: #f5473e;
}

.health-scale {
    display: grid;
    grid-template-columns: 20% 20% 20% 20% 20%;
    width: 100%;
    height: 3rem;
    position: relative;
}

.health-marker {
    position: absolute;
    top: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #ffcc00;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    font-weight: bold;
    color: black;
    font-size: 0.8rem;
    text-align: center;
    display: inline-block;
    transition: left 0.5s ease, top 0.5s ease;
}

.health-marker::after {
    content: "";
    position: absolute;
    bottom: -0.4rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffcc00;
}

/* Used in script */
.test-result-transition {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, max-height 0.4s ease-out;
}

.test-result-visible {
    opacity: 1;
    transform: translateY(0);
    max-height: 100vh;
    overflow: visible;
}

.custom-dropdown {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;

    &.focused {
        border-color: #35bdfc;
        box-shadow: 0 0 5px #35bdfc;
        border-radius: 666px;
    }

    .custom-dropdown-button {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        height: 36px;
        padding: 0.5rem 1rem;
        padding-right: 0.5rem;
        border: 1px solid #ccc;
        border-radius: 666px;
        background-color: white;
        cursor: pointer;
        font-size: 0.9rem;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;

        .custom-dropdown-arrow {
            transition: transform 0.3s ease;
            line-height: 8px;

            [aria-expanded="true"] & {
                transform: rotate(180deg);
            }
        }
    }

    .custom-dropdown-options {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        max-height: 200px;
        overflow-y: auto;
        border: 1px solid #ccc;
        border-radius: 8px;
        background: white;
        z-index: 500;

        &.open {
            display: block;
        }

        div {
            padding: 0.5rem 1rem;
            cursor: pointer;
            font-size: 0.9rem;

            &:hover {
                background-color: #f0f0f0;
            }
        }
    }
}

@media screen and (max-width: 600px) {
    .health-section {
        padding: 1rem 0;
        height: 3rem;
    }

    .h4 {
        font-size: 1.5rem !important;
        font-weight: 500 !important;
    }

    .health-scale {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, auto);
        height: auto;
        overflow: visible;
    }

    .health-marker {
        left: -1rem;
        transform: translate(0, -50%);
    }

    .health-marker::after {
        left: 95%;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 10px solid #ffcc00;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
    }
}

@media screen and (max-width: 425px) {
    .ft-form {
        padding: 0 1rem 1rem 1rem;
    }

    .h4 {
        font-size: 1rem !important;
        font-weight: 500 !important;
    }

    .h5 {
        font-size: 1.2rem !important;
    }

    .ft-sub-header {
        margin-left: -1rem !important;
        margin-right: 0 !important;
    }

    .ft-header {
        margin-left: -1rem !important;
        margin-right: -1rem !important;
    }
}

@media screen and (max-width: 319px) {
    .custom-dropdown-button {
        align-items: flex-start !important;
    }
}