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

/* --- General Body Styles --- */
body {
    font-family: 'Sarabun', sans-serif;
    background-color: #f4f7f6; /* Soft gray background */
    color: #333;
    line-height: 1.6;
}

/* --- Form Container --- */
.container {
    max-width: 1200px;
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    margin-top: 3rem;
    margin-bottom: 3rem;
    border-top: 5px solid #0056b3; /* Accent color */
}

/* --- Headers --- */
h2, h4 {
    color: #0056b3; /* Primary color for headers */
    font-weight: 700;
    margin-bottom: 1rem;
}

h2.main-title {
    color: #212529;
    margin-bottom: 0.5rem;
}

p.subtitle {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

hr {
    margin: 2rem 0;
    border-color: #e9ecef;
}

/* --- Form Elements --- */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.75rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-control:focus {
    border-color: #0056b3;
    box-shadow: 0 0 0 0.25rem rgba(0, 86, 179, 0.2);
}

textarea.form-control {
    resize: vertical;
}

/* --- Radio & Checkbox Styles --- */
.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.2em;
}

.form-check-input:checked {
    background-color: #0056b3;
    border-color: #0056b3;
}

.form-check-label {
    padding-left: 0.5rem;
}


/* --- Submit Button --- */
.btn-primary {
    background-color: #0056b3;
    border-color: #0056b3;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: background-color 0.2s, transform 0.2s;
    width: 100%; /* Full width button */
    margin-top: 1rem;
    align-items: center;
}

.btn-primary:hover {
    background-color: #004494;
    border-color: #004494;
    transform: translateY(-2px); /* Slight lift on hover */
}

/* --- Helper Text --- */
.form-text {
    font-size: 0.9rem;
    color: #6c757d;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
}
/* --- Custom Select Box Styles --- */
.input-group .form-select {
    border-radius: 0 8px 8px 0; /* ทำให้ขอบมนสวยงามเมื่ออยู่ติดกัน */
}

.input-group .input-group-text {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 8px 0 0 8px;
    font-weight: 500;
}

.form-select {
    padding: 0.75rem 2.25rem 0.75rem 1rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-select:focus {
    border-color: #0056b3;
    box-shadow: 0 0 0 0.25rem rgba(0, 86, 179, 0.2);
}
/* Style for when 'other' relation is selected */
.input-group.has-other .form-select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group.has-other .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
        /* Back Button Style */
.back-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 20px;
    color: var(--placeholder-color);
    text-decoration: none;
    transition: color 0.3s, transform 0.3s;
    }
.required::after {
  content: " *";
  color: red;
}