:root {
    --home-buttons-top: 700px;
    --home-buttons-width: 620px;
    --home-button-gap-y: 10px;
    --home-button-height: 126px;
    --home-bottom-space: 125px;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: 'Prompt', 'Noto Sans SC', sans-serif;
    background: #efc6d5;
}

body {
    overflow-x: hidden;
}

main {
    width: 100%;
    min-height: 100vh;
}

/* =====================================================
   FOCUS
===================================================== */

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #E82270;
}

/* =====================================================
   HOME PAGE
===================================================== */

.home-page {
    width: 100%;
    max-width: 810px;
    min-height: calc( var(--home-buttons-top) + (var(--home-button-height) * 2) + var(--home-button-gap-y) + var(--home-bottom-space) );
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

    .home-page.bg-th {
        background: url('/images/home/bg-th.jpg') top center no-repeat;
        background-size: 100% auto;
    }

    .home-page.bg-en {
        background: url('/images/home/bg-en.jpg') top center no-repeat;
        background-size: 100% auto;
    }

    .home-page.bg-cn {
        background: url('/images/home/bg-cn.jpg') top center no-repeat;
        background-size: 100% auto;
    }

/* =====================================================
   Login Success PAGE === มาจาก HOMEPAGE
===================================================== */

.loginsuccess-page {
    width: 100%;
    max-width: 810px;
    min-height: calc( var(--home-buttons-top) + var(--home-button-height) + var(--home-button-gap-y) + var(--home-bottom-space) );
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

    .loginsuccess-page.bg-th {
        background: url('/images/home/bg-th.jpg') top center no-repeat;
        background-size: 100% auto;
    }

    .loginsuccess-page.bg-en {
        background: url('/images/home/bg-en.jpg') top center no-repeat;
        background-size: 100% auto;
    }

    .loginsuccess-page.bg-cn {
        background: url('/images/home/bg-cn.jpg') top center no-repeat;
        background-size: 100% auto;
    }
/*---------TERMS Page------*/
.terms-page {
    width: 100%;
    max-width: 810px;
    margin: 0 auto;
    position: relative;
    /* เอาออกก็ได้ */
    overflow: visible;
    /* เพิ่มพื้นที่ด้านล่าง */
    padding-bottom: 20px;
}

.terms-img {
    display: block;
    width: 100%;
    height: auto;
}

.terms-home-btn {
    display: block;
    width: 250px; /* เปลี่ยนทีหลังได้ */
    max-width: 70%;
    margin: 20px auto 0 auto;
}

/* =====================================================
   HOME BUTTONS
===================================================== */

    .home-buttons {
        position: absolute;
        left: 50%;
        top: var(--home-buttons-top); /* ร========= ะยะห่างจาก space ด้านบน ========= */
        transform: translateX(-50%);
        width: var(--home-buttons-width);
        display: grid;
        grid-template-columns: auto auto;
        justify-content: center;
        gap: 24px;
        z-index: 10;
        column-gap: 3px; /* ระยะห่างปุ่มซ้าย-ขวา */
        row-gap: var(--home-button-gap-y); /* ระยะห่างปุ่มบน-ล่าง */
    }

    .home-button-link {
        display: block;
        text-decoration: none;
    }

    .home-btn-img {
        width: 100%;
        height: var(--home-button-height);
        display: block;
        border: 0;
        transition: transform 0.15s ease;
        object-fit: contain;
    }

        .home-btn-img:hover {
            transform: translateY(-2px);
        }
    /* =====================================================
   LANGUAGE FOOTER
===================================================== */

    .language-footer {
        position: fixed;
        left: 0;
        bottom: 0;
        width: 100%;
        min-height: 40px;
        background: url('/images/languagebarbg.jpg') center bottom repeat-x;
        z-index: 9999;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 10px 12px;
    }

    .language-footer-inner {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    .language-title {
        color: #65193E;
        font-size: 18px;
        font-weight: 500;
        margin-right: 10px;
        white-space: nowrap;
    }

    .footer-globe-icon {
        width: 32px;
        height: auto;
        display: block;
    }
    /* =====================================================
   LANGUAGE BUTTONS
===================================================== */

    .footer-lang-btn,
    .footer-lang-btn:link,
    .footer-lang-btn:visited {
        min-width: 60px;
        height: 36px;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        background: linear-gradient(to bottom, #ffeaf1, #ffdce7);
        color: #65193E !important;
        text-decoration: none;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.8);
        font-size: 18px;
        font-weight: 500;
        line-height: 1;
        box-shadow: 0 4px 8px rgba(235, 120, 170, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9);
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

        .footer-lang-btn:hover {
            color: #65193E !important;
            transform: translateY(-1px);
            box-shadow: 0 6px 12px rgba(235, 120, 170, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.95);
        }

        .footer-lang-btn.active,
        .footer-lang-btn.active:link,
        .footer-lang-btn.active:visited,
        .footer-lang-btn.active:hover {
            background: #E82270;
            color: #ffffff !important;
            box-shadow: 0 5px 12px rgba(232, 34, 112, 0.45);
        }
    /* =====================================================
   MOBILE / TABLET
===================================================== */

    @media (max-width: 810px) {
        .home-page {
            max-width: 100%;
            background-position: top center !important;
            background-size: 100% auto !important;
            background-repeat: no-repeat !important;
            min-height: 100vh;
            padding-top: 86vw;
            padding-bottom: 85px;
            overflow: visible;
        }

        .loginsuccess-page {
            max-width: 100%;
            background-position: top center !important;
            background-size: 100% auto !important;
            background-repeat: no-repeat !important;
            min-height: 100vh;
            padding-top: 86vw;
            padding-bottom: 85px;
            overflow: visible;
        }

        .home-buttons {
            position: relative;
            left: auto;
            top: auto;
            transform: none;
            margin: 0 auto;
            width: 60%;
            max-width: 300px;
            display: flex;
            flex-direction: column;
            gap: 1px; /*ปรับความห่างแกน y ระหว่างปุ่ม*/
            z-index: 10;
        }

        .home-button-link {
            width: 100%;
            display: block;
        }

        .home-btn-img {
            width: 100%;
            height: auto;
            display: block;
        }

        .language-footer {
            min-height: 55px;
            padding: 8px 8px;
        }

        .language-title {
            font-size: 14px;
            margin-right: 4px;
        }

        .footer-globe-icon {
            width: 26px;
        }

        .footer-lang-btn,
        .footer-lang-btn:link,
        .footer-lang-btn:visited {
            min-width: 55px;
            height: 35px;
            font-size: 14px;
        }
    }

    @media (max-width: 480px) {
        .language-footer-inner {
            gap: 7px;
        }

        .language-title {
            font-size: 13px;
        }

        .footer-lang-btn,
        .footer-lang-btn:link,
        .footer-lang-btn:visited {
            min-width: 54px;
            height: 30px;
            font-size: 13px;
        }
    }