html,
body {
    font-family: "Open Sans", sans-serif;
    background: #fff;
    margin: 0;
    color: #333;
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: hidden;
}

section {
    padding: 40px 0;
}

header {
    border-bottom: 0.2px solid #787878;
    padding: 10px 0;
    background: #fff;
}

footer {
    border-top: 0.2px solid #787878;
    padding: 10px 0;
    background: #fff;
    text-align: center;
}

    footer p {
        margin: 0;
    }

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.form_wrapper {
    background: #D5F0FF;
    border-radius: 12px;
    margin: 20px auto;
    padding: 25px 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

    .form_wrapper:first-child {
        background: #E97039;
        margin-top: -50px;
        position: relative;
        z-index: 1;
    }

h1 {
    color: #004a99;
    font-size: 22px;
    margin-bottom: 5px;
}

h2 {
    color: #1d77d3;
    font-size: 18px;
    margin-top: 0;
}

.question {
    margin: 20px 0;
}

.form_wrapper:nth-child(2) .question {
    padding-top: 20px;
    border-top: 1px solid #fff;
}

label {
    font-weight: 400;
    color: #1e1e1e;
    max-width: 90%;
}

    label span {
        color: #e80e0e;
    }

.form_wrapper:first-child label span {
    color: #fff;
}

.input-wrapper {
    position: relative;
    width: 100%;
    margin-top: 5px;
}

    .input-wrapper input {
        padding: 10px 55px 10px 8px;
        border: 1px solid #e5e5e5;
        border-radius: 6px;
        width: 100%;
        box-sizing: border-box;
        font-size: 16px;
        color: #1e1e1e;
        position: relative;
    }

        .input-wrapper input:focus {
            outline: #e97039 auto 1px;
        }

            .input-wrapper input:focus + .unit {
                color: #e97039;
            }

        .input-wrapper input::placeholder {
            color: #919191;
        }

    .input-wrapper .unit {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        color: #5c5c5c;
        font-size: 14px;
        pointer-events: none;
        font-weight: 500;
        align-content: center;
        padding: 0 10px;
        border-radius: 10px;
    }

.form_wrapper:first-child .input-wrapper .unit {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    color: #5c5c5c;
    font-size: 14px;
    pointer-events: none;
    font-weight: 500;
    align-content: center;
    background: #D5F0FF;
    padding: 0 10px;
    border-radius: 10px;
}

.custom-radio {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-family: sans-serif;
    gap: 8px;
    margin: 7px 15px 0 0;
}

    .custom-radio input {
        display: none;
    }

.text-left {
    text-align: left !important;
}

.custom-radio .checkmark {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #fff;
    position: relative;
    transition: all 0.2s ease;
    border: 0.3px solid #5b94b4;
}

.custom-radio input:checked + .checkmark {
    background-color: #e97039;
}

    .custom-radio input:checked + .checkmark::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #fff;
    }

.form_wrapper:first-child .custom-radio input:checked + .checkmark {
    background-color: #fff;
}

    .form_wrapper:first-child .custom-radio input:checked + .checkmark::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #256B93;
    }

.height-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

#heightUnit {
    padding: 6px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    border: none;
    background: #D5F0FF;
}

    #heightUnit:focus {
        outline: #e97039 auto 1px;
    }

.pefr-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.tooltip.info-tooltip {
    margin-left: 6px;
    color: #007bff;
    cursor: help;
    position: relative;
    display: inline-block;
    font-size: 14px;
    line-height: 1;
}

    .tooltip.info-tooltip::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 130%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.85);
        color: #fff;
        font-size: 12px;
        padding: 8px 10px;
        border-radius: 4px;
        white-space: nowrap;
        z-index: 2000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.12s ease;
        pointer-events: none;
    }

    .tooltip.info-tooltip::before {
        content: "";
        position: absolute;
        bottom: 120%;
        left: 50%;
        transform: translateX(-50%);
        border-width: 6px;
        border-style: solid;
        border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.12s ease;
        z-index: 2000;
    }

    .tooltip.info-tooltip:hover::after,
    .tooltip.info-tooltip:hover::before {
        opacity: 1;
        visibility: visible;
    }

button {
    background: #e97039;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    display: block;
    width: fit-content;
    margin: 40px auto 0 auto;
    font-weight: 700;
}

    button.retake {
        background: #e97039;
        color: #fff;
        border: 1px solid #e97039;
        padding: 10px 20px;
        border-radius: 10px;
        cursor: pointer;
        font-size: 14px;
        width: fit-content;
        margin: 20px auto;
        font-weight: 500;
        display: flex;
        justify-content: center;
        align-items: center;
        flex: 1;
    }

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    display: none;
}

.error {
    color: red;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.form_wrapper:first-child .error {
    color: #333;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e1e1e;
}

.form_wrapper:first-child h3,
.form_wrapper:first-child label {
    color: #fff;
}

#result-section h3 {
    font-size: 18px;
    font-weight: 400;
    color: #000;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 5px;
}

    #result-section h3 ul,
    #result-section h3 li {
        margin: 5px;
        white-space: normal;
    }

#result-section #p_score {
    font-size: 35px;
    font-weight: 700;
    color: #000;
    text-align: left;
}

.score-info {
    display: inline-block;
    position: relative;
    margin-left: 2px;
    cursor: pointer;
}

    .score-info i {
        width: 18px;
        height: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-style: normal;
        font-weight: bold;
        font-size: 13px;
        line-height: 1;
    }

.score-popup {
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%);
    background: #184ea3;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    text-align: center;
    z-index: 10;
}

#result-section h3 .score-popup {
    width: 450px;
    left: 30px;
}

.score-popup::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #184ea3 transparent transparent transparent;
}

.score-info:hover .score-popup {
    visibility: visible;
    opacity: 1;
}

#result-section h3 .score-info:hover .score-popup {
    visibility: visible;
    opacity: 1;
    white-space: normal;
}

.banner-img {
    width: 100%;
}

.calc-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    top: -100px;
}

    .calc-header h1 {
        display: block;
        align-items: center;
        flex-wrap: nowrap;
        gap: 10px;
        font-size: 28px;
        font-weight: 700;
        color: #fff;
        margin: 0;
    }

    .calc-header .subtext {
        color: #1e1e1e;
        font-weight: 500;
        font-size: 18px;
        margin: 0;
    }

.calc-detail-btn {
    position: relative;
    background: #f5f8ff;
    border: 1.5px solid #184ea3;
    border-radius: 8px;
    padding: 6px 12px 6px 8px;
    color: #184ea3;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-left: 12px;
}

    .calc-detail-btn i {
        background: #184ea3;
        color: #fff;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-style: normal;
        font-size: 16px;
        font-weight: bold;
    }

.calc-popup {
    position: absolute;
    top: 30px;
    right: 0;
    width: 500px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 20;
    text-align: left;
}

    .calc-popup h3 {
        font-size: 18px;
        font-weight: 700;
        margin-bottom: 10px;
    }

    .calc-popup p {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 16px;
    }

    .calc-popup .formula {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 18px;
        font-size: 14px;
        font-weight: 600;
    }

    .calc-popup .fraction {
        display: inline-block;
        vertical-align: middle;
    }

        .calc-popup .fraction hr {
            margin: 4px 0;
            border: 0;
            border-top: 1px solid #fff;
        }

    .calc-popup .graph img {
        width: 160px;
        background: #fff;
        border-radius: 10px;
        margin-bottom: 6px;
    }

    .calc-popup .graph p {
        font-size: 12px;
        opacity: 0.8;
        text-align: center;
    }

    /* Arrow */
    .calc-popup .arrow {
        position: absolute;
        top: -10px;
        right: 40px;
        width: 0;
        height: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-bottom: 10px solid rgba(0, 0, 0, 0.9);
    }

.calc-detail-btn:hover .calc-popup {
    opacity: 1;
    visibility: visible;
}

.result-section {
    text-align: center;
    padding-top: 0;
}

.result_wrap {
    background: #FDF1EB;
    border-radius: 25px;
    padding: 30px 0 30px 0;
}

.result-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: left;
    color: #000000;
    margin-top: 15px;
}

#recommendationBox h3 {
    font-weight: 700;
    margin-bottom: 20px;
}

#recommendationBox p {
    font-weight: 700;
}

button.breakdown_btn {
    background: #e97039;
    font-weight: 700;
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 15px 25px;
    gap: 10px;
    margin: 30px auto;
    width: fit-content;
}

.status_wrap .result-title {
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 20px;
    text-align: left;
    color: #000000;
}

.result-container {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
    gap: 0;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-left: 20px;
    position: relative;
}

    .summary-item.p_summ::before {
        content: "";
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        margin: auto;
        background: #def1ec;
        width: 15px;
        height: 15px;
        border-radius: 50%;
    }

/*    .summary-item.p_summ {
        border-top: 1px solid #c9c9c9;
        padding-top: 10px;
    }*/

/*    .summary-item.h_summ {
        border-bottom: 1px solid #c9c9c9;
        padding-bottom: 10px;
    }*/

    .summary-item.h_summ::before {
        content: "";
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        margin: auto;
        background: #00a94f;
        width: 15px;
        height: 15px;
        border-radius: 50%;
    }

.status_wrap {
    padding: 15px;
    padding-bottom: 45px;
    background: #fff;
    border-radius: 25px;
    margin: 0 0 0 0;
}

.gauge {
    position: relative;
    width: 130px;
    height: 130px;
}

.gauge-body {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--gauge-color, #00a94f) calc(var(--gauge-percent, 0) * 1%), #def1ec 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 1s ease;
}

.gauge-cover {
    position: absolute;
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #00a94f;
    gap: 3px;
}

    .gauge-cover small {
        font-size: 24px;
        font-weight: 700;
        color: #00a94f;
    }

.score-status {
    margin-top: 12px;
    font-weight: 600;
    font-size: 18px;
}

.pefr-summary {
    display: flex;
/*    flex-direction: column;*/
    justify-content: space-between;
    gap: 15px;
    flex: 1;
    padding: 10px 0;
}

.summary-item h4 {
    margin: 0;
    font-size: 13px;
    color: #000;
}

.summary-item p {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.recommendation-box {
    padding: 20px;
    margin-top: 30px;
    text-align: left;
    transition: border-color 0.5s ease;
    border: 1px solid #F95451;
    border-radius: 10px;
}

    .recommendation-box h3 {
        margin: 0 0 8px;
        font-size: 18px;
    }

    .recommendation-box p {
        margin: 0;
        font-size: 16px;
        color: #444;
    }

/* SCORE METER */
.score-meter {
    margin-top: 0px;
    text-align: center;
    position: relative;
}

.meter-line {
    position: relative;
    height: 30px;
    background: linear-gradient(to right, #4caf50 0, #4caf50 50%, #e1252a 50%, #e1252a 100%);
    border-radius: 20px;
    width: 100%;
    margin: 0 auto 25px;
}

.zone-label {
    position: absolute;
    top: 30px;
    font-size: 16px;
    color: #000;
    font-weight: 600;
}

    .zone-label.left {
        left: 0;
    }

    .zone-label.right {
        right: 0;
    }

.triangle-indicator {
    position: absolute;
    top: -15px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 13px solid #000;
    transition: left 0.5s ease, border-bottom-color 0.5s ease;
    transform: rotate(180deg);
}

.zone-info {
    display: inline-block;
    padding: 10px 15px;
    border: 2px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
    color: #333;
    margin: 20px 0 0 0;
    width: 100%;
    text-align: left;
}

    .zone-info h4 {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
    }

    .zone-info p {
        margin: 3px 0 0;
        font-size: 16px;
    }

#s_breakdown p {
    font-weight: 700;
    font-size: 20px;
    margin: 0;
}

#s_breakdown {
    background: #D5F0FF;
    border-radius: 25px;
    text-align: left;
    margin-top: 20px;
}

#score_table {
    padding: 0;
    margin: 0;
    color: #333333;
}

    #score_table tr:first-child {
        font-size: 20px;
    }

    #score_table tr:last-child {
        font-size: 17px;
        color: #e97039;
        border-bottom: none;
    }

    #score_table tr td,
    #score_table tr th {
        padding: 15px;
    }

    #score_table tr:first-child th {
        font-weight: 400;
        font-size: 16px;
    }

    #score_table tr td:nth-child(2),
    #score_table tr td:nth-child(3) {
        font-weight: 700;
    }

    #score_table tr {
        border-bottom: 0.4px solid #fff;
    }

        #score_table tr td:nth-child(1),
        #score_table tr th:nth-child(1) {
            padding-left: 0;
        }

.p_summ .score-popup {
    left: -80px;
}

    .p_summ .score-popup::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 205px;
        transform: translateX(-50%);
        border-width: 6px;
        border-style: solid;
        border-color: #184ea3 transparent transparent transparent;
    }

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-box {
    background: #02ad4f;
    padding: 20px 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

    .popup-box p {
        font-size: 16px;
        margin-bottom: 15px;
        color: #fff;
        font-weight: 700;
    }

    .popup-box button {
        background: #fff;
        color: #000;
        border: none;
        padding: 8px 18px;
        border-radius: 5px;
        cursor: pointer;
        margin-top: 0;
    }

        .popup-box button:hover {
            background: #fff;
        }

#recommendationText span {
    margin-left: -1rem;
    font-weight: 700;
    margin-top: 20px;
    display: block;
}

.gauge {
    display: none;
}

.summary-item h4 {
    font-size: 16px;
}

.summary-item p {
    font-size: 17px;
}

.summary-item {
    gap: 10px;
}

.result-container {
    justify-content: start;
    border-top: 1px solid #c9c9c9;
    border-bottom: 1px solid #c9c9c9;
}

.meter-line {
    display: none;
}

h1 span {
    color: #ee0000;
}

.zone-info {
    display: none;
}

#result-section h3.scr {
    width: fit-content;
    border: 2px solid #E1252A;
    padding: 10px;
    border-radius: 10px;
}

@media (max-width: 480px) {
    .calc-header h1 {
        flex-wrap: wrap;
        font-size: 21px;
        line-height: 28px;
    }

    .calc-detail-btn {
        margin-left: 0;
        margin-top: 6px;
    }

    #result-section h3 .score-popup {
        width: 350px;
        left: 30px;
    }

        #result-section h3 .score-popup::after {
            content: "";
            position: absolute;
            top: 100%;
            left: 45%;
            transform: translateX(-50%);
            border-width: 6px;
            border-style: solid;
            border-color: #184ea3 transparent transparent transparent;
        }


    .result-container {
        justify-content: center;
        flex-direction: column;
        padding: 10px 0;
    }

    .status_wrap {
        margin: 20px 0 0 0;
    }

    .pefr-summary{
        flex-direction: column;
    }
}

@media (min-width: 1024px) {
    .calc-header {
        top: -10%;
    }

    .form_wrapper:first-child {
        margin-top: -100px;
    }

    button.retake {
        flex: none;
        width: 200px;
        margin: 20px 0;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .calc-header {
        top: -8%;
    }

        .calc-header h1 {
            max-width: 70%;
        }

    .pefr-summary {
        margin-top: 0;
    }
}
main {
    min-height: calc(100vh - 200px);
}
