/* --- START OF FILE assets/css/modern_register_style.css --- */

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

/* CSS Variables - Gold & Blue Theme */
:root {
    --gold: #C59D3F;
    --dark-gold: #A57C34;
    --dark-blue: #2A3B75;
    --light-blue: #4A5B95;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #fdfbf5;
    --card-bg: #ffffff;
    --border-color: #e8dcc8;
    --input-bg: #fdfbf5;
    --success-color: #10b981;
    --danger-color: #dc2626;
    --font-family: 'Sarabun', sans-serif;
}

/* Reset & General */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Registration Wrapper */
.registration-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--light-blue) 100%);
    padding: 3rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.header-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--dark-gold) 100%);
}

.logo-section {
    text-align: center;
    position: relative;
    z-index: 1;
}

.logo-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInScale 0.8s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: fadeInDown 0.8s ease 0.2s both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.95);
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Container */
.form-container {
    max-width: 900px;
    margin: -2rem auto 3rem;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

/* Form Section */
.form-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 8px 30px rgba(197, 157, 63, 0.15);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gold);
}

.section-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(197, 157, 63, 0.3);
    flex-shrink: 0;
}

.section-info {
    flex: 1;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 0.25rem;
}

.section-desc {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.form-group {
    position: relative;
    /* Floating Label สำหรับ Input ปกติ: ให้สลับ Label มาก่อน Input เพื่อใช้ CSS Selector */
    display: flex;
    flex-direction: column-reverse; 
}

/* --- FIX: แก้ไขปัญหาหัวข้อ Radio Button ตกไปอยู่ข้างล่าง --- */
.form-group:has(.radio-label-main) {
    flex-direction: column !important; /* บังคับให้เรียงตามปกติ (บนลงล่าง) */
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Form Inputs */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: var(--font-family);
    background: var(--input-bg);
    color: var(--text-color);
    transition: all 0.3s ease;
    min-height: 58px; /* ความสูงมาตรฐาน */
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: white;
    box-shadow: 0 0 0 4px rgba(197, 157, 63, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Floating Labels Logic (Standard Inputs) */
.form-label {
    position: absolute;
    left: 1.25rem;
    top: 1rem;
    color: var(--text-light);
    background: var(--input-bg);
    padding: 0 0.5rem;
    transition: all 0.3s ease;
    pointer-events: none;
    font-size: 0.95rem;
    z-index: 10;
}

/* Trigger Float */
.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label,
.form-select:focus ~ .form-label,
.form-select:valid ~ .form-label,
.form-select:not([value=""]) ~ .form-label {
    top: -0.5rem;
    font-size: 0.8rem;
    color: var(--gold);
    background: white;
    font-weight: 600;
}

/* Fix for Textarea Label */
.form-textarea:focus ~ .form-label,
.form-textarea:not(:placeholder-shown) ~ .form-label {
    top: -0.5rem;
    font-size: 0.8rem;
    color: var(--gold);
    background: white;
    font-weight: 600;
}

/* Disabled State */
.form-select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

.required {
    color: var(--danger-color);
    font-weight: bold;
}

/* Radio & Checkbox Styles */
.radio-label-main {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--dark-blue);
    font-size: 1rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-option {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: var(--gold);
    background: white;
}

.radio-option input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--gold);
    cursor: pointer;
}

.radio-option input[type="radio"]:checked ~ .radio-text {
    color: var(--dark-blue);
    font-weight: 600;
}

.radio-text {
    flex: 1;
    color: var(--text-color);
}

/* Membership Fee Section */
.membership-fee-section {
    margin-bottom: 2rem;
}

.membership-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.membership-card {
    position: relative;
    cursor: pointer;
}

.membership-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.membership-content {
    padding: 2rem;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
    text-align: center;
    transition: all 0.3s ease;
}

.membership-card:hover .membership-content {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(197, 157, 63, 0.2);
}

.membership-card input[type="radio"]:checked ~ .membership-content {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(197, 157, 63, 0.1) 0%, rgba(42, 59, 117, 0.05) 100%);
    box-shadow: 0 4px 15px rgba(197, 157, 63, 0.3);
}

.membership-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.membership-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
}

.membership-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gold);
}

/* Upload Section */
.upload-section {
    margin-top: 2rem;
}

.upload-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.upload-card {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    background: var(--input-bg);
    transition: all 0.3s ease;
}

.upload-card:hover {
    border-color: var(--gold);
    background: white;
}

.upload-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.upload-icon {
    font-size: 1.8rem;
}

.upload-info {
    flex: 1;
}

.upload-title {
    font-weight: 600;
    color: var(--dark-blue);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.required-tag {
    display: inline-block;
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

.upload-area {
    position: relative;
    cursor: pointer;
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    text-align: center;
    padding: 2rem 1rem;
    border: 2px dashed transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-placeholder {
    background: rgba(197, 157, 63, 0.05);
    border-color: var(--gold);
}

.upload-icon-large {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.upload-text {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-light);
}

.preview-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.preview-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    background: var(--danger-color);
    transform: scale(1.1);
}

.success-badge {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Confirmation Box */
.confirmation-box {
    background: linear-gradient(135deg, rgba(197, 157, 63, 0.1) 0%, rgba(42, 59, 117, 0.05) 100%);
    border: 2px solid var(--gold);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    position: relative;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gold);
    border-radius: 6px;
    background: white;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
}


.checkbox-container input[type="checkbox"]:checked ~ .checkmark {
    background: var(--gold);
}

.checkbox-container input[type="checkbox"]:checked ~ .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

.checkbox-text {
    flex: 1;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Signature Box */
.signature-box {
    margin-top: 2rem;
}

.signature-label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--dark-blue);
    font-size: 1rem;
}

.signature-pad-wrapper {
    border: 3px solid var(--gold);
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
}

#signature-pad {
    width: 100%;
    height: 250px;
    cursor: crosshair;
    touch-action: none;
    display: block;
}

.clear-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--text-light);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

/* Submit Section */
.submit-section {
    text-align: center;
    margin-top: 3rem;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 3rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(197, 157, 63, 0.4);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(197, 157, 63, 0.5);
}

.btn-icon {
    font-size: 1.5rem;
}

.btn-text {
    letter-spacing: 0.5px;
}

/* Page Footer */
.page-footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header {
        padding: 2rem 1rem 3rem;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .main-subtitle {
        font-size: 0.95rem;
    }

    .form-section {
        padding: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-number {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
    }

    .radio-option {
        min-width: 100%;
    }

    .membership-options {
        grid-template-columns: 1fr;
    }

    .upload-grid {
        grid-template-columns: 1fr;
    }

    .submit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-section {
    animation: slideIn 0.5s ease;
}

.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }
.form-section:nth-child(3) { animation-delay: 0.3s; }
.form-section:nth-child(4) { animation-delay: 0.4s; }
.form-section:nth-child(5) { animation-delay: 0.5s; }

/* ------------------------------------------------------------------------ */
/* TOM SELECT CUSTOMIZATION (Fixed Height & Style)                          */
/* ------------------------------------------------------------------------ */

/* 1. บังคับกล่องให้หน้าตาและขนาดเท่ากับ Input ปกติเป๊ะๆ */
.ts-wrapper {
    width: 100% !important;
}

.ts-control {
    border: 2px solid var(--border-color) !important;
    border-radius: 10px !important;
    /* ใช้ความสูงตายตัวเท่ากับ min-height ของ input อื่น */
    height: 58px !important; 
    min-height: 58px !important;
    width: 100% !important; /* Force Full Width */
    
    /* ปรับ Padding แนวตั้งเป็น 0 แล้วใช้ Flex จัดกึ่งกลางแทน */
    padding: 0 1.25rem !important; 
    
    font-family: var(--font-family) !important;
    font-size: 1rem !important;
    background-color: var(--input-bg) !important;
    box-shadow: none !important;
    
    display: flex !important;
    align-items: center !important; /* จัดข้อความให้อยู่กึ่งกลางแนวตั้ง */
}

/* 2. เมื่อกดเลือก (Focus) ให้เปลี่ยนสีกรอบ */
.ts-control.focus {
    border-color: var(--gold) !important;
    background-color: white !important;
    box-shadow: 0 0 0 4px rgba(197, 157, 63, 0.1) !important;
}

/* 3. จัดการ Input ภายในให้ไม่มีระยะห่างเกินความจำเป็น */
.ts-control > input {
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    font-size: 1rem !important;
}

/* 4. จัดการ Dropdown รายชื่อจังหวัด */
.ts-dropdown {
    border: 2px solid var(--gold) !important;
    border-radius: 10px !important;
    margin-top: 5px !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
    z-index: 9999 !important;
}

.ts-dropdown .option {
    padding: 10px 15px !important;
}

.ts-dropdown .active {
    background-color: var(--gold) !important;
    color: white !important;
}

/* 5. Logic สำหรับ Floating Label (ทำให้ Label ลอยเหมือนช่องอื่น) */

/* ซ่อน Label สีน้ำเงินอันเก่าทิ้งไป */
.form-group:has(.ts-wrapper)::before {
    display: none !important;
}

/* นำ Label ตัวจริงกลับมาแสดง */
.form-group:has(.ts-wrapper) .form-label {
    display: block !important;
    z-index: 10;
    cursor: text;
}

/* สถานะปกติ: Label อยู่ตรงกลาง (ทำหน้าที่เหมือน Placeholder) */
.form-group:has(.ts-wrapper) .form-label {
    top: 50%;                 /* กึ่งกลางแนวตั้ง */
    transform: translateY(-50%); /* ดึงขึ้นครึ่งนึงให้กลางเป๊ะ */
    left: 1.25rem;
    font-size: 0.95rem;
    color: var(--text-light);
    pointer-events: none; /* กดทะลุไปโดน input ได้ */
    transition: all 0.2s ease;
}

/* สถานะ Label ลอยขึ้น: เมื่อ Focus หรือ มีข้อมูล (.has-items) */
.ts-wrapper.focus ~ .form-label,
.ts-wrapper.has-items ~ .form-label {
    top: -0.5rem !important;      /* ลอยไปเกาะเส้นขอบบน */
    transform: translateY(0) !important; /* ยกเลิกการจัดกึ่งกลาง */
    font-size: 0.8rem !important;
    color: var(--gold) !important;
    background: white !important;
    font-weight: 600 !important;
    padding: 0 0.5rem !important;
}

/* --- Premium Bank Transfer Box --- */
.payment-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.payment-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 5px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--dark-blue) 100%);
}

.payment-title {
    font-size: 1.2rem;
    color: var(--dark-blue);
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.bank-modern-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 550px;
    margin: 0 auto;
    transition: transform 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
}

.bank-modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.bank-logo-box {
    width: 80px;
    height: 80px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #eee;
    flex-shrink: 0;
}

.bank-logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.bank-info-box {
    text-align: left;
    flex-grow: 1;
}

.bank-name-text {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 2px;
}

.account-name-text {
    font-size: 1.1rem;
    color: var(--dark-blue);
    font-weight: 600;
    margin-bottom: 8px;
}

.account-number-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 8px;
    width: fit-content;
}

.acc-num {
    font-family: 'Sarabun', monospace; /* หรือใช้ font monospace เพื่อความเท่ */
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark-blue);
    letter-spacing: 1px;
}

.btn-copy-modern {
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-copy-modern:hover {
    background: var(--gold);
    color: white;
    border-color: var(--gold);
}

.btn-copy-modern:active {
    transform: scale(0.95);
}

.payment-note {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .bank-modern-card {
        flex-direction: column;
        text-align: center;
    }
    .bank-info-box {
        text-align: center;
        width: 100%;
    }
    .account-number-row {
        margin: 0 auto;
        justify-content: center;
    }
}