* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    padding: 10px;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 22px;
}

/* Progress Bar */
.progress-container {
    display: flex;
    justify-content: space-between;
    padding: 30px 20px;
    background: #fafafa;
    position: relative;
}

.progress-container::before {
    content: '';
    position: absolute;
    top: 40%;
    left: 25%;
    right: 25%;
    height: 2px;
    background: #ddd;
    z-index: 0;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ddd;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: bold;
    transition: all 0.3s;
}

.progress-step.active .step-number,
.progress-step.completed .step-number {
    background: #e91e63;
    color: white;
    transform: scale(1.1);
}

.progress-step.completed .step-number::after {
    content: '✓';
}

.step-label {
    font-size: 14px;
    color: #666;
}

.progress-step.active .step-label {
    color: #e91e63;
    font-weight: 600;
}

/* Form Steps */
.form-step {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e91e63;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.required {
    color: #e91e63;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e91e63;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    transition: all 0.3s;
}

.radio-label:hover {
    border-color: #e91e63;
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked + span {
    color: #e91e63;
    font-weight: 600;
}

/* Previous Insurance Section */
.previous-insurance-container {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.btn-add-small {
    padding: 8px 15px;
    background: #e91e63;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-small:hover {
    background: #c2185b;
    transform: translateY(-1px);
}

.insurance-item {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.insurance-item:last-child {
    margin-bottom: 0;
}

.insurance-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.insurance-item-title {
    font-weight: 600;
    color: #e91e63;
    font-size: 15px;
}

.btn-remove {
    padding: 5px 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-remove:hover {
    background: #d32f2f;
    transform: scale(1.05);
}

.insurance-item .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 0;
}

.insurance-item .form-group label {
    font-size: 13px;
}

/* Radio Group Inline */
.radio-group-inline {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.radio-group-inline label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 20px;
    transition: all 0.3s;
    margin: 0;
}

.radio-group-inline label:hover {
    border-color: #e91e63;
}

.radio-group-inline input[type="radio"] {
    margin-right: 5px;
    cursor: pointer;
}

.radio-group-inline input[type="radio"]:checked + span {
    color: #e91e63;
    font-weight: 600;
}

/* Questions */
.questions-container {
    margin-top: 25px;
}

.question-item {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #e91e63;
}

.question-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.question-number {
    min-width: 35px;
    font-weight: bold;
    color: #e91e63;
    font-size: 16px;
}

.question-text {
    flex: 1;
    color: #333;
    font-size: 15px;
    line-height: 1.6;
}

.answer-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-answer {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
    color: #666;
}

.btn-answer.active {
    background: #e91e63 !important;
    color: white !important;
    border-color: #e91e63 !important;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

.btn-answer:hover:not(.active) {
    border-color: #e91e63;
    color: #333;
}

.btn-answer:active {
    transform: scale(0.98);
}

/* Details Section */
.details-section {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.details-section.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

.details-section .form-group {
    margin-bottom: 15px;
}

.details-section .form-group:last-child {
    margin-bottom: 0;
}

/* Checkbox Group */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: #f0f0f0;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-item label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    margin: 0;
}

/* Expandable Section */
.expandable-section {
    margin-top: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.expand-header {
    padding: 12px 15px;
    background: #fafafa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    transition: background 0.2s;
    user-select: none;
}

.expand-header:hover {
    background: #f0f0f0;
}

.expand-icon {
    transition: transform 0.3s;
    font-size: 12px;
}

.expand-icon.open {
    transform: rotate(180deg);
}

.expand-content {
    display: none;
    padding: 15px;
    background: white;
}

.expand-content.show {
    display: block;
}

.note-text {
    color: #e91e63;
    font-size: 13px;
    margin-bottom: 10px;
    font-weight: 500;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-prev {
    background: #f5f5f5;
    color: #666;
}

.btn-prev:hover {
    background: #e0e0e0;
}

.btn-next,
.btn-submit {
    background: #e91e63;
    color: white;
}

.btn-next:hover,
.btn-submit:hover {
    background: #c2185b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.3);
}

.btn-next:active,
.btn-submit:active {
    transform: translateY(0);
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #e91e63;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .progress-container {
        padding: 20px 10px;
    }

    .progress-container::before {
        left: 20%;
        right: 20%;
    }

    .step-label {
        font-size: 12px;
    }

    .form-step {
        padding: 20px 15px;
    }

    .step-title {
        font-size: 20px;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .insurance-item .form-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-add-small {
        width: 100%;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .radio-label {
        width: 100%;
        justify-content: center;
    }

    .radio-group-inline {
        flex-direction: column;
        gap: 10px;
    }

    .radio-group-inline label {
        width: 100%;
        justify-content: center;
    }

    .answer-buttons {
        flex-direction: column;
    }

    .btn-answer {
        width: 100%;
    }

    .header h1 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container {
        border-radius: 5px;
    }

    .form-step {
        padding: 15px 10px;
    }

    .question-item {
        padding: 15px;
    }

    .step-title {
        font-size: 18px;
    }

    .question-text {
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    .header,
    .progress-container,
    .button-group,
    .loading-overlay {
        display: none;
    }

    .form-step {
        display: block !important;
        page-break-after: always;
    }

    .container {
        box-shadow: none;
    }
}
/* Step 3: Smile Club */
.info-box {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.info-box p {
    margin: 0;
    color: #333;
    font-size: 15px;
}

.sports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

/* Step 4: FATCA & CRS */
.consent-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.consent-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e91e63;
}

.consent-header .icon {
    font-size: 24px;
}

.consent-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.consent-content {
    margin-bottom: 20px;
}

.consent-content p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.consent-details {
    background: white;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.consent-details p {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.consent-details ol {
    margin-left: 20px;
    color: #555;
}

.consent-details ol li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.consent-buttons {
    margin-top: 15px;
}

.consent-question {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

/* Progress Bar for 4 steps */
.progress-container::before {
    left: 12.5%;
    right: 12.5%;
}

/* Responsive for 4 steps */
@media (max-width: 768px) {
    .progress-container::before {
        left: 10%;
        right: 10%;
    }
    
    .sports-grid {
        grid-template-columns: 1fr;
    }
    
    .consent-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .consent-details ol {
        margin-left: 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .consent-section {
        padding: 15px;
    }
    
    .consent-header h3 {
        font-size: 18px;
    }
    
    .consent-details {
        padding: 10px;
    }
}
/* ==================== Smile Club Section ==================== */
.smile-club-question {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 5px;
}

.smile-club-question label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: block;
}

.smile-club-question .answer-buttons {
    display: flex;
    gap: 10px;
}

#smileClubDetails {
    animation: slideDown 0.3s ease;
}

.sports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

/* ==================== FATCA & CRS Sections ==================== */
.fatca-section,
.crs-section {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.section-icon-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e91e63;
}

.star-icon {
    font-size: 28px;
    color: #e91e63;
}

.section-icon-header h3 {
    margin: 0;
    color: #333;
    font-size: 22px;
    font-weight: 700;
}

.section-description {
    margin-bottom: 20px;
}

.section-description p {
    color: #555;
    line-height: 1.8;
    font-size: 14px;
}

.consent-question-box {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.consent-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 15px;
}

.consent-question-text {
    color: #555;
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 14px;
}

.consent-buttons-inline {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.answer-label {
    font-weight: 600;
    color: #333;
    margin: 0;
    min-width: 120px;
}

.button-pair {
    display: flex;
    gap: 10px;
}

.btn-consent {
    padding: 10px 30px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
    color: #666;
    min-width: 80px;
}

.btn-consent.active {
    background: #e91e63 !important;
    color: white !important;
    border-color: #e91e63 !important;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

.btn-consent:hover:not(.active) {
    border-color: #e91e63;
    color: #333;
}

.btn-consent:active {
    transform: scale(0.98);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .sports-grid {
        grid-template-columns: 1fr;
    }
    
    .consent-buttons-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .answer-label {
        min-width: auto;
    }
    
    .button-pair {
        width: 100%;
    }
    
    .btn-consent {
        flex: 1;
    }
    
    .section-icon-header {
        flex-direction: row;
    }
    
    .fatca-section,
    .crs-section {
        padding: 15px;
    }
    
    .consent-question-box {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .smile-club-question {
        padding: 15px;
    }
    
    .section-icon-header h3 {
        font-size: 18px;
    }
    
    .consent-question-text {
        font-size: 13px;
    }
    
    .btn-consent {
        padding: 8px 20px;
        font-size: 14px;
    }
}
/* Disabled State for Details Section */
.details-section input[type="checkbox"]:disabled + label,
.details-section input[type="text"]:disabled,
.details-section .btn-answer:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.details-section input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.checkbox-item input[type="checkbox"]:disabled + label {
    color: #999;
}
/* Form Hint */
.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.form-group input[type="text"]:focus + .form-hint {
    color: #007bff;
}

.form-group input.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.form-group input.error + .form-hint {
    color: #dc3545;
}

.form-group input.valid {
    border-color: #28a745;
}

/* Date Input Styling */
input[name="birth_date"],
input[name="id_card_expiry"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}


/* ================================
   Footer Styles (Stick to Bottom)
   ================================ */
.footer-custom {
    background-color: #ffe3f1;        /* Light pink background */
    border-top: 2px solid #e91e63;    /* Darker pink top border */
    flex-shrink: 0;                   /* Prevent shrinking when space is tight */
    width: 100%;
    margin-top: 15px;
}
.footer-custom .container {
    max-width: 800px;
    padding-left: 1rem;
    padding-right: 1rem;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0);
    overflow: hidden;
}
.footer-custom p {
    margin-bottom: 0.25rem;
    font-size: 14px;
    color: #000000;
}
.footer-custom p strong {
    color: #ff57b2;
}
.footer-custom p small {
       color: #ff0000;
    font-size: 15px;
}
/* Signature Section */
.signature-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.signature-section h3 {
    color: #2c3e50;
    margin-bottom: 16px;
    font-size: 18px;
}

.signature-container {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#signatureCanvas {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: crosshair;
    width: 100%;
    max-width: 600px;
    height: 200px;
    display: block;
    margin: 0 auto;
    background: white;
    touch-action: none; /* ป้องกัน scroll บนมือถือ */
}

.signature-actions {
    margin-top: 12px;
    text-align: center;
}

.btn-clear {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.signature-note {
    text-align: center;
    color: #7f8c8d;
    font-size: 13px;
    margin-top: 8px;
    font-style: italic;
}

/* Summary Section */
.summary-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.summary-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.summary-content {
    display: grid;
    gap: 16px;
}

.summary-group {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.summary-group h4 {
    color: #667eea;
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 600;
}

.summary-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 200px;
    font-size: 14px;
}

.summary-value {
    color: #34495e;
    flex: 1;
    font-size: 14px;
}

/* Consent Section */
.consent-section {
    margin: 24px 0;
}

.consent-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.6;
}

.consent-label input[type="checkbox"] {
    margin-top: 4px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.consent-label a {
    color: #667eea;
    text-decoration: underline;
    font-weight: 600;
}

.consent-label a:hover {
    color: #764ba2;
}

/* Responsive */
@media (max-width: 768px) {
    #signatureCanvas {
        max-width: 100%;
    }
    
    .summary-item {
        flex-direction: column;
        gap: 4px;
    }
    
    .summary-label {
        min-width: auto;
    }
}
