/* --- Page Specific Styles --- */
.container { max-width: 900px; margin: 40px auto; padding: 0 20px; }

.page-header { text-align: center; margin-bottom: 30px; }
.page-header h1 { color: var(--primary-navy); font-size: 2.2rem; margin-bottom: 10px; }
.page-header p { color: #666; font-size: 1.1rem; }

.alert-box {
    background-color: #ffebee;
    border-left: 5px solid var(--danger-red);
    color: #c62828;
    padding: 15px;
    margin-bottom: 30px;
    border-radius: 4px;
    font-size: 0.95rem;
}

/* Alert Box Variants */
.alert-box.alert-success {
    background-color: #e8f5e9;
    border-color: var(--success-green);
    color: #2e7d32;
}

.alert-box.alert-info {
    background-color: #e1f5fe;
    border-color: #0288d1;
    color: #01579b;
}

/* Preliminary Advice Section */
.preliminary-advice {
    background-color: #e1f5fe; /* Light blue */
    border: 1px solid #b3e5fc;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 40px;
    text-align: center;
}

.preliminary-advice h3 {
    color: var(--primary-navy);
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.advice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    text-align: left;
}

.advice-item {
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.advice-icon { font-size: 2.5rem; margin-bottom: 15px; }
.advice-item h4 { color: var(--primary-navy); font-size: 1.1rem; margin-bottom: 10px; }
.advice-item p { font-size: 0.9rem; color: #555; line-height: 1.6; }
.advice-item a { color: var(--dark-teal); font-weight: 600; }

/* Stepper Styles */
.stepper-wrapper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}
.stepper-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}
.stepper-item::before {
    position: absolute;
    content: "";
    border-bottom: 2px solid #ccc;
    width: 100%;
    top: 15px;
    left: -50%;
    z-index: 2;
}
.stepper-item::after {
    position: absolute;
    content: "";
    border-bottom: 2px solid var(--accent-teal);
    width: 0;
    top: 15px;
    left: -50%;
    z-index: 3;
    transition: width 0.3s ease;
}
.stepper-item:first-child::before {
    content: none;
}
.stepper-item:first-child::after {
    content: none; /* Remove the teal progress line for the first step as well */
}
.step-counter {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ccc;
    color: white;
    margin-bottom: 6px;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.step-name {
    font-size: 0.85rem;
    color: #ccc;
    transition: color 0.3s ease, font-weight 0.3s ease;
    text-align: center;
}
.stepper-item.active .step-counter {
    background-color: var(--accent-teal);
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(57, 204, 204, 0.2);
}
.stepper-item.active .step-name {
    color: var(--accent-teal);
    font-weight: 600;
}
.stepper-item.completed .step-counter {
    background-color: var(--primary-navy);
}
.stepper-item.completed .step-name {
    color: var(--primary-navy);
}
.stepper-item.completed::after {
    width: 100%;
}

.form-container {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.section-title {
    color: var(--primary-navy);
    font-size: 1.3rem;
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 10px;
    margin-bottom: 25px;
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.section-number {
    background-color: var(--accent-teal);
    color: var(--primary-navy);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    font-size: 1rem;
    font-weight: bold;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group { margin-bottom: 20px; }
.form-group.full-width { grid-column: 1 / -1; }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
}

.required { color: var(--danger-red); }

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-teal);
    outline: none;
    box-shadow: 0 0 0 3px rgba(57, 204, 204, 0.1);
}

textarea { resize: vertical; min-height: 100px; }

.file-upload-area {
    border: 2px dashed #ccc;
    padding: 30px;
    text-align: center;
    border-radius: 5px;
    background-color: #fafafa;
    cursor: pointer;
    transition: border-color 0.3s;
}

.file-upload-area:hover, .file-upload-area.drag-over { 
    border-color: var(--accent-teal); 
}
.file-upload-area.drag-over {
    background-color: #e0f2f1;
}

.file-preview {
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.file-preview span {
    font-size: 0.8rem;
    text-align: center;
    padding: 5px;
}

.btn-submit {
    background-color: var(--danger-red);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(255, 65, 54, 0.2);
}

/* Teal submit button variant for other forms */
.btn-submit.btn-teal {
    background-color: var(--accent-teal);
    color: var(--primary-navy);
    box-shadow: 0 4px 6px rgba(57, 204, 204, 0.2);
}
.btn-submit.btn-teal:hover {
    background-color: var(--dark-teal);
    color: var(--primary-navy);
    transform: translateY(-2px);
}

/* Form Step Styles */
.form-step {
    display: none;
    animation: fadeIn 0.5s;
}
.form-step.active {
    display: block;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}
.btn-next, .btn-prev {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
}
.btn-next {
    background-color: var(--accent-teal);
    color: var(--primary-navy);
    margin-left: auto; /* Push to the right if it's the only button */
}
.btn-prev {
    background-color: #e0e0e0;
    color: #333;
}

/* ทำให้ปุ่ม submit ในแถบนำทางมีขนาดเท่ากับปุ่มอื่น */
.form-navigation .btn-submit {
    width: auto;
    margin-top: 0;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
}

/* Success Message Styles */
#successMessage { text-align: center; padding: 50px 20px; animation: fadeIn 0.5s; }
.success-icon {
    font-size: 4rem;
    color: var(--success-green);
    width: 80px;
    height: 80px;
    line-height: 80px;
    border: 3px solid var(--success-green);
    border-radius: 50%;
    margin: 0 auto 20px;
}
#successMessage h2 { color: var(--primary-navy); margin-bottom: 15px; font-size: 1.8rem; }
#successMessage p { color: #555; font-size: 1.1rem; margin-bottom: 30px; line-height: 1.7; }
.success-actions { display: flex; gap: 15px; justify-content: center; }

.btn-submit:hover {
    background-color: #d63025;
    transform: translateY(-2px);
}

.error-msg { color: var(--danger-red); font-size: 0.85rem; margin-top: 5px; display: none; }
.input-error { border-color: var(--danger-red) !important; }

footer {
    margin-top: 60px;
}

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .container { padding: 0 15px; }
}

/* Styles for File Upload Preview */
#previewContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding: 10px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    min-height: 70px;
    align-items: center;
    justify-content: flex-start;
    background-color: #f9f9f9;
}

.preview-item {
    position: relative;
    width: 80px; /* Smaller width */
    height: 80px; /* Smaller height */
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s ease-in-out;
}

.preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Use cover to fill the box */
}

.preview-item .file-icon {
    font-size: 2.5em; /* Adjusted icon size */
    color: #666;
    text-align: center;
    line-height: 1;
}

.preview-item .file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.65em;
    padding: 2px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.remove-file {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease;
}

.remove-file:hover {
    background-color: red;
}