﻿/* Spinner Style */
.spinner {
    width: 100px;
    height: 100px;
    border: 6px solid #00aeef;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    backface-visibility: hidden;
    will-change: transform;
    transform: translateZ(0);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

#loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* สำหรับมือถือปรับขนาด spinner */
@media (max-width: 768px) {
    .spinner {
        width: 60px;
        height: 60px;
        border-width: 4px;
    }
}

/*สูง 90% ของ viewport*/
.modal-dialog.custom-height {
    max-height: 90vh;
}

.viewqr-label {
    line-height: 1.1; /* ปรับระยะบรรทัด label */
    margin: 0; /* ลบ margin ที่เกิดจาก label */
    padding: 0; /* ลบ padding */
}

.viewqr-srn {
    color: red;
    font-weight: bold;
}

.viewqr-name {
    font-weight: normal;
}


.main-section {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.BGblue {
    background-color: #27baff;
}        

@font-face {
    font-family: "DB_Heavent";
    src: url("fonts/DB_Heavent.eot"); /* IE9 Compat Modes */
    src: url("fonts/DB_Heavent.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
    url("fonts/DB_Heavent.otf") format("opentype"), /* Open Type Font */
    url("fonts/DB_Heavent.svg") format("svg"), /* Legacy iOS */
    url("fonts/DB_Heavent.ttf") format("truetype"), /* Safari, Android, iOS */
    url("fonts/DB_Heavent.woff") format("woff"), /* Modern Browsers */
    url("fonts/DB_Heavent.woff2") format("woff2"); /* Modern Browsers */
    font-weight: normal;
    font-style: normal;
}

.normal {
    font-family: 'DB Heavent', 'DB_Heavent', 'Arial';
    font-size: 22px;
    color: #000000;
    TEXT-DECORATION: none;    
}

.normal_b {
    font-family: 'DB Heavent', 'DB_Heavent', 'Arial';
    font-weight: bold;
    font-size: 30px;
    color: #004a99; /* เปลี่ยนเป็นสีน้ำเงินตามแบบใหม่ */
    line-height: 1.2; /* ควบคุมระยะห่างระหว่างบรรทัดไม่ให้ลอย */
    display: block;
    text-align: center;
}

.normal_select {
    font-family: 'DB Heavent', 'DB_Heavent', 'Arial';
    font-size: 24px;
    text-decoration: none;
    color: black; /* ตัวเลือกทั่วไปเป็นดำ */
    background-color: white;
}
    /* ทำให้ตัว placeholder จาง */
.normal_select option[value=""] {
    color: gray; /* เฉพาะ "กรุณาระบุ" */
}

.swal2-confirm {
    font-family: 'DB Heavent', 'DB_Heavent', 'Arial' !important;    
    font-size: 24px !important;
    width: 150px;
    text-align: center !important;
    background-color: #6c757d !important;
    padding: 8px 12px !important;
    border: none !important;
    color: white !important;
    display: inline-block !important;
    margin: 4px 2px !important;
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
    margin-left: 10px !important;
    margin-right: 30px !important;
}

    .swal2-confirm:hover, .swal2-confirm:active {
        background-color: #5c636a !important;
    }

.flex-container {
    display: flex;
    align-items: stretch;
}

.flex-item-left {
    flex: 5%;
    text-align: right;
}

.flex-item-right {
    flex: 95%;
    text-align: left;
    padding-left: 10px;
}

/* --- [ส่วนที่เพิ่มใหม่: ตกแต่ง Form & Desktop Style] --- */
#register-page {
    background-color: #f4f7f9;
    padding: 0 0 40px 0;
}

/* เพิ่มตรงนี้ครับ */
.form-header {
    margin-top: 20px; /* เพิ่มระยะห่างจากรูป Banner ด้านบน */
    margin-bottom: 25px; /* เพิ่มระยะห่างก่อนเริ่มฟอร์ม */
    padding: 0 15px;
    text-align: center;
}

#Form2 {
    max-width: 750px;
    margin: 0 auto 50px auto;
    background: #ffffff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    border: 1px solid #eee;
}

.form-control {
    border-radius: 12px !important;
    border: 1.5px solid #e1e1e1;
    background-color: #fafafa;
    transition: all 0.3s;
}

    .form-control:focus {
        background-color: #fff;
        border-color: #0dcaf0;
        box-shadow: 0 0 0 0.25rem rgba(13, 202, 240, 0.1);
    }

.d-flex.flex-row {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 10px 15px;
    margin-bottom: 8px;
    align-items: flex-start;
}

/* --- 1. ส่วนนี้สำหรับ Desktop (ค่าเริ่มต้น) --- */
#b_next, .b_download, .b_home {
    background: linear-gradient(135deg, #0dcaf0 0%, #004a99 100%) !important;
    border: none !important;
    color: white !important;
    font-family: 'DB Heavent', 'DB_Heavent', 'Arial' !important;
    font-weight: bold !important;
    font-size: 24px !important;
    box-shadow: 0 4px 15px rgba(0, 74, 153, 0.2) !important;
    transition: all 0.3s ease !important;
    padding: 12px 25px !important;
    border-radius: 50px !important;
    text-decoration: none !important;
    cursor: pointer;
    text-align: center;
    display: inline-block; /* Desktop วางเรียงต่อกันข้างๆ ได้ */
    min-width: 250px !important;
    margin: 15px !important; /* เว้นระยะห่างรอบๆ ปุ่มบน Desktop */
    vertical-align: middle;
}

    /* เอฟเฟกต์ Hover สำหรับทุกปุ่ม */
    #b_next:hover, .b_download:hover, .b_home:hover {
        background: linear-gradient(135deg, #004a99 0%, #0dcaf0 100%) !important;
        box-shadow: 0 6px 20px rgba(0, 74, 153, 0.3) !important;
        transform: translateY(-2px) !important;
        color: white !important;
    }

    /* เอฟเฟกต์ตอนกด สำหรับทุกปุ่ม */
    #b_next:active, .b_download:active, .b_home:active {
        transform: translateY(1px) !important;
        box-shadow: 0 2px 10px rgba(0, 74, 153, 0.2) !important;
    }

#divImage {
    background-color: white;
    margin-top: 20px;
    margin-bottom: 50px;
    border: none !important; /* ลบเส้นขอบสีดำที่คุณใส่ไว้ใน inline style ออก (ถ้าต้องการ) */
    box-shadow: 0 0 20px rgba(0,0,0,0.1); /* เพิ่มเงาให้นุ่มนวล */
    border-radius: 15px;
    overflow: hidden; /* ให้รูป header โค้งตามการ์ด */
}

.form-control, .normal_select {
    -webkit-appearance: none; /* ป้องกัน iOS ใส่เงาแปลกๆ ให้ input */
    appearance: none;
}
/* --- [ส่วนที่เพิ่มใหม่: Mobile Responsive] --- */
@media (max-width: 576px) {
    /* ปรับฟอนต์หัวข้อหลักให้เล็กลงหน่อยจาก 30px เดิม */
    .normal_b {
        font-size: 24px !important; /* บนมือถือ 3 บรรทัดใช้ 24px จะสวยกว่า */
        line-height: 1.1 !important;
    }

    /* บังคับระยะห่างของส่วนหัว */
    .form-header {
        margin-top: 10px !important; /* บนมือถือขยับขึ้นไปนิดนึงให้เห็นเนื้อหาเร็วขึ้น */
        margin-bottom: 15px !important; /* ระยะห่างที่กระชับขึ้นบนมือถือ */
        padding: 0 10px !important;
    }

    /* บังคับขนาดฟอนต์ 16px สำหรับ Input และ Label บนมือถือ */
    label.normal,
    .form-control,
    .form-select,
    .form-check-label.normal,
    .normal_select {
        font-size: 16px !important;
    }

    .mb-3 {
        margin-bottom: 20px !important;
    }

    .d-flex.flex-row {
        padding: 12px 15px !important;
        margin-bottom: 10px !important;
    }

    #Form2 {
        padding: 30px 20px !important;
        margin: 0 15px 40px 15px !important;
        border-radius: 20px;
    }

    .row > .col-sm-6 {
        margin-bottom: 10px;
    }

    #b_next, .b_download, .b_home {
        width: 70% !important; /* กว้าง 70% ของจอมือถือ */
        min-width: 70% !important;
        display: block !important; /* ปรับเป็น block เพื่อให้ซ้อนกันเป็นแถว */
        margin: 10px auto 20px auto !important; /* จัดกึ่งกลาง และเว้นระยะห่างบน-ล่าง */
    }
}