/* --- Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;500;700&display=swap');

/* --- Main Body & Background --- */
body {
    font-family: 'Kanit', sans-serif;
    /* ใช้ Gradient เพิ่มมิติให้กับพื้นหลัง */
    background: linear-gradient(to top right, #f0f4f8, #d9e2ec);
    margin: 0;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #4A5568; /* สีเทาเข้มที่ดูสบายตา */
}

/* --- Form Container Styling --- */
.form-container {
    background-color: #ffffff;
    padding: 40px 50px;
    border-radius: 16px;
    /* เงาที่ดูนุ่มนวลขึ้น */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 900px;
    /* เส้นสีเขียวด้านบนเพื่อสร้างแบรนด์ */
    border-top: 5px solid #92D050; 
    transition: transform 0.3s ease-in-out;
}

/* --- Language & Logo Header --- */
.lang-switcher {
    text-align: right;
    margin-bottom: 10px;
    font-size: 14px;
}

.lang-switcher a {
    color: #2795d1; /* สีฟ้าจากโลโก้ */
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.lang-switcher a:hover {
    background-color: #eaf6fd;
}

.lang-switcher a.active {
    font-weight: 700;
    color: #1A202C;
    pointer-events: none;
}

.logo-container {
    text-align: center;
    margin-bottom: 25px;
}

.logo-container img {
    max-width: 220px;
    height: auto;
    margin-bottom: 10px;
}

.form-main-title {
    font-size: 24px;
    font-weight: 700;
    color: #1A202C; /* สีดำเกือบสนิท */
    margin: 0;
}

/* --- Form Layout & Elements --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 15px;
    color: #2D3748;
}

/* --- Input & Select Fields --- */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
.flatpickr-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #CBD5E0;
    border-radius: 8px;
    box-sizing: border-box; 
    font-size: 16px;
    font-family: 'Kanit', sans-serif;
    background-color: #F7FAFC; /* พื้นหลังสีเทาอ่อนๆ */
    transition: all 0.2s ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
.flatpickr-input:focus {
    background-color: #fff;
    border-color: #2795d1; /* สีฟ้าจากโลโก้ */
    box-shadow: 0 0 0 3px rgba(39, 149, 209, 0.15);
    outline: none;
}

#dob_calendar {
    cursor: pointer;
}

.radio-group {
    display: flex;
    gap: 25px;
    align-items: center;
    padding-top: 12px;
}
.radio-group label {
    font-weight: 400;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.radio-group input {
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

/* --- Privacy Section --- */
.privacy-section {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid #E2E8F0;
    font-size: 13px;
    color: #4A5568;
    text-align: left;
    line-height: 1.7;
}
.consent-group {
    margin: 20px 0;
    display: flex;
    align-items: center;
    background-color: #f7fafc;
    padding: 15px;
    border-radius: 8px;
}
.consent-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    cursor: pointer;
}
.consent-group label {
    font-weight: 500;
    color: #2D3748;
    margin: 0;
    cursor: pointer;
}

/* --- Submit Button --- */
button[type="submit"] {
    width: 100%;
    padding: 15px;
    /* ใช้ Gradient สีฟ้าจากโลโก้ */
    background: linear-gradient(45deg, #2795d1, #1a7ab8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Kanit', sans-serif;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(39, 149, 209, 0.3);
    transition: all 0.3s ease;
}

button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(39, 149, 209, 0.4);
}

/* --- Message Boxes --- */
.message {
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    text-align: left;
    font-weight: 500;
    border: 1px solid;
}
.success {
    background-color: #F0FFF4;
    color: #276749;
    border-color: #9AE6B4;
}
.error {
    background-color: #FFF5F5;
    color: #9B2C2C;
    border-color: #FEB2B2;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    body {
        padding: 20px 10px;
    }
    .form-container {
        padding: 25px;
    }
}