/* css/form_style.css (ฉบับเต็มแก้ไขสมบูรณ์) */

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

/* --- General Body Styling --- */
body {
    font-family: 'Sarabun', sans-serif;
    background: linear-gradient(135deg, #00bfa5, #00897b);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    overflow: auto; 
    position: relative;
    padding: 2rem 0;
}

/* --- Abstract Background Shapes --- */
body::before, body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    z-index: -1;
}

body::before {
    width: 60vw;
    height: 60vw;
    top: -20vw;
    left: -20vw;
}

body::after {
    width: 50vw;
    height: 50vw;
    bottom: -25vw;
    right: -15vw;
}

/* --- Main Form Container --- */
.container {
    max-width: 800px;
    padding: 20px;
}

.card {
    border: none;
    border-radius: 1.5rem;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.card-header {
    background-color: #1a237e !important;
    color: white;
    border-bottom: none;
    padding: 1.5rem;
    text-align: center;
}

.card-body {
    padding-bottom: 2.5rem !important;
}

legend {
    font-weight: 500;
    color: #00695c;
}

/* --- Form Element Styling --- */
.form-control, .form-select {
    background-color: #e8f5e9;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.25);
}

fieldset .row > [class*="col-"] {
    padding-bottom: 1rem;
}

/* --- Radio Button & Info Icon Styling --- */
.form-check {
    margin-bottom: 0.75rem;
}

.info-icon {
    color: #00897b;
    margin-left: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.info-icon:hover {
    transform: scale(1.2);
}

/* --- File Upload Area & Preview --- */
.file-upload-container {
    display: flex;
    gap: 1rem;
    justify-content: start;
    flex-wrap: wrap;
}

.file-upload-area {
    position: relative;
    border: 2px dashed #a5d6a7;
    border-radius: 0.5rem;
    text-align: center;
    color: #6c757d;
    transition: all 0.2s;
    width: 130px;
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-upload-area:hover {
    border-color: #00897b;
    background-color: #e8f5e9;
}

.file-upload-area .upload-placeholder {
    cursor: pointer;
}

.file-upload-area .upload-icon {
    font-size: 2.5rem;
    color: #4db6ac;
    margin-bottom: 0.5rem;
}

.file-upload-area .file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-preview {
    width: 100%;
    height: 100%;
    position: relative;
}

.file-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 5px;
}

.file-preview-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.file-preview-name {
    font-size: 0.8rem;
    word-break: break-all;
}

.remove-file-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: rgba(239, 83, 80, 0.8);
    color: white;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s;
}

.remove-file-btn:hover {
    background-color: #c62828;
}

/* --- Consent Section Styling --- */
.consent-section {
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
}

.consent-section .form-check-label {
    color: #c62828;
    font-weight: 500;
}

.consent-section .info-icon {
    color: #ef5350;
}

/* --- Submit Button --- */
.btn-primary {
    background-color: #e57373;
    border: none;
    font-weight: bold;
    padding: 0.85rem;
    border-radius: 50px;
    transition: background-color 0.2s, transform 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background-color: #ef5350;
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background-color: #e0e0e0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
