/* DGA Job Application Form Styles */

.dga-application-wrap {
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Sarabun', 'Prompt', sans-serif;
}

/* Section */
.dga-form-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 24px;
    padding: 24px;
}

.dga-section-heading {
    font-size: 1.1em;
    font-weight: 700;
    color: #b22222;
    border-bottom: 2px solid #b22222;
    padding-bottom: 8px;
    margin-top: 0;
    margin-bottom: 20px;
}

.dga-section-title-bar h2 {
    font-size: 1.3em;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.dga-org-name {
    color: #555;
    font-size: 0.9em;
    margin-bottom: 16px;
}

/* Form rows */
.dga-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 0;
}

.dga-two-col .dga-form-group {
    flex: 1 1 calc(50% - 8px);
    min-width: 200px;
}

.dga-three-col .dga-form-group {
    flex: 1 1 calc(33% - 12px);
    min-width: 160px;
}

/* Form groups */
.dga-form-group {
    margin-bottom: 16px;
}

.dga-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.92em;
    color: #333;
}

.dga-form-group input[type="text"],
.dga-form-group input[type="email"],
.dga-form-group input[type="tel"],
.dga-form-group input[type="number"],
.dga-form-group input[type="date"],
.dga-form-group input[type="file"],
.dga-form-group input[type="url"],
.dga-form-group textarea,
.dga-form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c0c0c0;
    border-radius: 3px;
    font-size: 0.95em;
    box-sizing: border-box;
    font-family: inherit;
    color: #333;
    background: #fafafa;
    transition: border-color 0.2s;
}

.dga-form-group input:focus,
.dga-form-group textarea:focus {
    border-color: #b22222;
    outline: none;
    background: #fff;
}

.dga-form-group input[readonly] {
    background: #f0f0f0;
    color: #888;
}

/* Date Dropdowns (Day / Month / Year) */
.dga-dob-wrap {
    display: flex;
    gap: 8px;
}

.dga-dob-wrap select {
    flex: 1;
}

/* Half width */
.dga-half-width {
    max-width: 45%;
}

.dga-col-1 {
    flex: 0 0 80px;
}

.dga-col-2 {
    flex: 1 1 140px;
}

.dga-col-3 {
    flex: 2 1 240px;
}

/* Radio / checkbox groups */
.dga-radio-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dga-radio-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dga-radio-group input {
    width: auto;
    margin: 0;
}

.dga-radio-inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
}

.dga-radio-inline label {
    display: inline-flex;
}

/* Address copy */
.dga-copy-address-wrap {
    font-size: 0.85em;
    font-weight: normal;
    margin-left: 8px;
}

.dga-copy-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.dga-copy-label input {
    width: auto;
}

/* Hint text */
.dga-field-hint {
    font-size: 0.82em;
    color: #777;
    margin-top: 2px;
    margin-bottom: 4px;
}

/* Required marker */
.required {
    color: #c00;
    margin-left: 2px;
}

/* Conditional fields */
.dga-conditional-field {
    display: none;
    margin-top: 6px;
}

.dga-conditional-section {
    padding-left: 16px;
    border-left: 3px solid #eee;
    margin-top: 8px;
}

.dga-portfolio-upload {
    margin-bottom: 8px;
}

/* Error box */
.dga-form-errors {
    background: #fff3f3;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #721c24;
}

.dga-form-errors ul {
    margin: 6px 0 0 20px;
}

/* Tables */
.dga-repeater-table,
.dga-edu-table,
.dga-lang-table {
    min-width: 850px;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.92em;
    margin-bottom: 8px;
}

.dga-repeater-table th,
.dga-repeater-table td,
.dga-edu-table th,
.dga-edu-table td,
.dga-lang-table th,
.dga-lang-table td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    vertical-align: top;
}

.dga-repeater-table th,
.dga-edu-table th,
.dga-lang-table th {
    background: #f5f5f5;
    font-weight: 600;
    text-align: center;
    font-size: 0.88em;
}

.dga-repeater-table input,
.dga-repeater-table select,
.dga-edu-table input,
.dga-edu-table select,
.dga-lang-table input {
    width: 100%;
    border: 1px solid #ccc;
    padding: 4px 6px;
    border-radius: 2px;
    font-size: 0.95em;
    box-sizing: border-box;
}

.dga-lang-radio-cell {
    text-align: center;
}

.dga-lang-table .dga-lang-radio-cell {
    vertical-align: middle;
}

.dga-lang-extra-name-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dga-lang-extra-name-wrap input {
    flex: 1;
    min-width: 0;
}

.dga-lang-radio-cell input {
    width: auto;
}

.dga-edu-table .dga-transcript-col,
.dga-edu-table .dga-transcript-cell {
    padding: 4px;
    text-align: center;
    vertical-align: middle;
}

.dga-transcript-button {
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #c0c0c0;
    border-radius: 3px;
    color: #555;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.dga-transcript-enhanced .dga-transcript-button {
    display: inline-flex;
}

.dga-transcript-button:hover,
.dga-transcript-button:focus {
    border-color: #b22222;
    color: #b22222;
    background: #fff;
}

.dga-transcript-button.is-selected {
    color: #1f6f43;
    border-color: #8ac8a6;
    background: #f0fdf4;
}

.dga-transcript-enhanced .dga-transcript-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

.dga-transcript-upload-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
}

.dga-transcript-upload-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dga-transcript-hint {
    margin: 6px 0 4px;
    line-height: 1.35;
    text-align: right;
}

/* Family row */
.dga-family-row {
    align-items: flex-start;
}

.dga-repeater-table th,
.dga-repeater-table td {
    width: calc((100% - 30px) / 3);
}

.dga-repeater-row .td-remove-row,
.dga-repeater-table .td-remove-row {
    text-align: center;
    width: 30px;
    vertical-align: middle;
}

/* Work history block */
.dga-work-entry {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fafafa;
}

.dga-work-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* Buttons */
.dga-btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.95em;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.dga-btn-primary {
    background: #b22222;
    color: #fff;
}

.dga-btn-primary:hover {
    background: #8b0000;
}

.dga-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    font-size: 0.9em;
    padding: 6px 16px;
}

.dga-btn-secondary:hover {
    background: #e0e0e0;
}

.dga-btn-small {
    padding: 2px 8px;
    font-size: 0.85em;
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 2px;
    cursor: pointer;
}

.dga-btn-small:hover {
    background: #b71c1c;
}

.dga-remove-row {
    border: 0 none;
    background: none;
    padding: 0;
    color: #e53935;
    font-size: 2em;
}

.dga-remove-row:hover {
    background: none;
    color: #b71c1c;
}

/* Confirm checkbox */
.dga-form-confirm {
    margin: 24px 0 12px;
    padding: 16px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.dga-confirm-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95em;
    line-height: 1.5;
}

.dga-confirm-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Submit area */
.dga-form-submit {
    text-align: center;
    padding: 24px 0 12px;
}

.dga-job-apply {
    margin: 32px 0 12px;
    text-align: center;
}

.dga-form-submit .dga-btn-primary {
    padding: 14px 48px;
    font-size: 1.05em;
}

.dga-job-apply .dga-btn-primary {
    padding: 14px 48px;
    font-size: 1.05em;
}

/* Reference block */
.dga-reference-block {
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fafafa;
}

.dga-reference-block h4 {
    margin-top: 0;
    color: #555;
}

/* Declaration */
.dga-declaration {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px;
    font-size: 0.9em;
    color: #444;
    line-height: 1.7;
    margin-top: 16px;
}

.dga-declaration h4 {
    margin-top: 0;
    font-size: 1em;
}

/* Success page */
.dga-application-success {
    text-align: center;
    padding: 48px 24px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
}

.dga-success-icon {
    font-size: 3em;
    color: #16a34a;
    margin-bottom: 16px;
}

.dga-application-success h2 {
    color: #15803d;
}

/* Responsive */
@media (max-width: 991px) {

    .dga-two-col .dga-form-group,
    .dga-three-col .dga-form-group {
        flex: 1 1 100%;
    }

    .dga-half-width {
        max-width: 100%;
    }

    .dga-table-wrap,
    .dga-lang-table-wrap {
        overflow-x: auto;
    }
}

/* ── Admin autofill panel ───────────────────────────────────────── */
.dga-autofill-panel {
    background: #fff8e1;
    border: 2px dashed #f0a500;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 14px;
}

.dga-autofill-header {
    color: #7a5100;
    margin-bottom: 10px;
    font-size: 15px;
}

.dga-autofill-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.dga-autofill-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.dga-af-count {
    width: 58px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

#dga-autofill-btn {
    background: #f0a500;
    color: #fff;
    border-color: #d48900;
    font-weight: 600;
    padding: 7px 18px;
}

#dga-autofill-btn:hover {
    background: #d48900;
    border-color: #b87000;
}

#dga-autofill-status {
    margin-top: 8px;
    font-size: 13px;
}

.dga-af-ok {
    color: #2a7a2a;
    font-weight: 600;
}

.dga-af-warn {
    color: #b45309;
    font-weight: 600;
}

@media (max-width: 640px) {
    .dga-autofill-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Field error message (hidden by default, shown by JS on validation) */
.dga-field-error {
    color: #c00;
    display: none;
    font-size: 12px;
    margin-top: 3px;
}

/* Married fields section (hidden until marital_status = แต่งงาน) */
#dga-married-fields {
    display: none;
}
