/* ── Page Wrapper ─────────────────────────────────────── */
.creg-section {
    background: #f5f0eb;
    padding: 50px 20px;
    min-height: 100vh;
}

.creg-wrap {
    max-width: 860px;
    margin: 0 auto;
}

/* ── Applying For Banner ──────────────────────────────── */
.creg-applying-for {
    background: #fff;
    border-left: 4px solid #D9000F;
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
}

.creg-applying-for strong {
    color: #D9000F;
}

/* ── Card ─────────────────────────────────────────────── */
.creg-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* ── Header ───────────────────────────────────────────── */
.creg-header {
    padding: 28px 40px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 20px;
}

.creg-logo {
    height: 44px;
    width: auto;
}

.creg-title {
    font-size: 26px;
    font-weight: 800;
    color: #D9000F;
    letter-spacing: 1px;
    margin: 0;
    font-family: Georgia, serif;
}

/* ── Form Body ────────────────────────────────────────── */
#creg-form {
    padding: 10px 40px 40px;
}

#creg-edit-form {
    padding: 10px 40px 40px;
}

/* ── Section Bar ──────────────────────────────────────── */
.creg-section-bar {
    background: #D9000F;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 9px 16px;
    border-radius: 3px;
    margin: 24px 0 18px;
}

/* ── Fields Wrapper ───────────────────────────────────── */
.creg-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Row ──────────────────────────────────────────────── */
.creg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* ── Field ────────────────────────────────────────────── */
.creg-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.creg-field.full {
    grid-column: 1 / -1;
}

.creg-field label {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    min-width: 160px;
    flex-shrink: 0;
    line-height: 1.4;
}

.creg-field label small {
    font-weight: 400;
    font-size: 11px;
    color: #777;
}

.creg-field .sep {
    color: #333;
    font-weight: 600;
    flex-shrink: 0;
}

.req {
    color: #D9000F;
}

/* ── Inputs ───────────────────────────────────────────── */
.creg-field input[type="text"],
.creg-field input[type="email"],
.creg-field input[type="tel"],
.creg-field input[type="number"],
.creg-field input[type="date"],
.creg-field select {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 8px 10px;
    font-size: 13px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s;
    width: 100%;
}

.creg-field input:focus,
.creg-field select:focus {
    border-color: #D9000F;
    outline: none;
}

.creg-field input.creg-error,
.creg-field select.creg-error {
    border-color: #D9000F;
    background: #fff5f5;
}

.creg-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    cursor: pointer;
}

/* ── File Input ───────────────────────────────────────── */
.creg-field input[type="file"] {
    flex: 1;
    font-size: 13px;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 6px 10px;
    background: #fff;
    cursor: pointer;
}

/* ── Checkboxes (Employment Type) ─────────────────────── */
.creg-checkboxes {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    flex: 1;
}

.creg-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    font-weight: 400;
}

.creg-check-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #D9000F;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid #999;
}

/* ── Terms Row ────────────────────────────────────────── */
.creg-terms-row {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin: 24px 0 16px;
}

.creg-terms-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}

.creg-terms-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #D9000F;
    flex-shrink: 0;
    cursor: pointer;
}

.creg-terms-label a {
    color: #333;
    text-decoration: underline;
}

.creg-terms-label a:hover {
    color: #D9000F;
}

/* ── Submit Button ────────────────────────────────────── */
.creg-submit {
    text-align: center;
    padding: 15px;
}

#creg-btn {
    background: #D9000F;
    color: #fff;
    border: none;
    padding: 13px 70px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-transform: uppercase;
}

#creg-btn:hover {
    background: #b8000d;
}

#creg-btn:active {
    transform: scale(0.98);
}

#creg-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#creg-edit-btn {
    background: #D9000F;
    color: #fff;
    border: none;
    padding: 13px 70px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-transform: uppercase;
}

#creg-edit-btn:hover {
    background: #b8000d;
}

#creg-edit-btn:active {
    transform: scale(0.98);
}

#creg-edit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ── Messages ─────────────────────────────────────────── */
#creg-message {
    margin: 10px 0;
}

.creg-msg-success {
    background: #e6f9ed;
    border: 1px solid #34c759;
    color: #1a7a38;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.creg-msg-error {
    background: #fff5f5;
    border: 1px solid #D9000F;
    color: #D9000F;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.creg-dob {
    display: flex;
    gap: 8px;
    flex: 1;
}

.creg-dob input {
    width: 100% !important;
    text-align: center;
    padding: 8px 0px !important;
}

/* Select2 error state */
.creg-error + .select2-container .select2-selection,
.select2-container.creg-error .select2-selection {
    border-color: #D9000F !important;
    background: #fff5f5 !important;
}
.select2-container--open .select2-dropdown{
    top:33px !important;
}

.creg-terms-error {
    color: #D9000F;
}

.creg-terms-error input[type="checkbox"] {
    outline: 2px solid #D9000F;
    border-radius: 2px;
}

/* Select2 match creg-field input style */
.creg-field .select2-container {
    flex: 1;
}

.creg-field .select2-container .select2-selection--single {
    height: auto !important;
    border: 1px solid #ccc !important;
    border-radius: 3px !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    color: #333 !important;
    background: #fff !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    line-height: 1.4 !important;
}

.creg-field .select2-container .select2-selection--single .select2-selection__rendered {
    padding: 0 !important;
    line-height: 1.4 !important;
    color: #333 !important;
    font-size: 13px !important;
}

.creg-field .select2-container .select2-selection--single .select2-selection__arrow {
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 8px !important;
}

.creg-field .select2-container .select2-selection--single .select2-selection__placeholder {
    color: #999 !important;
    font-size: 13px !important;
}

.creg-field .select2-container--open .select2-selection--single,
.creg-field .select2-container--focus .select2-selection--single {
    border-color: #D9000F !important;
    outline: none !important;
}

.select2-dropdown {
    border: 1px solid #D9000F !important;
    border-radius: 3px !important;
    font-size: 13px !important;
    font-family: inherit !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #D9000F !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #ccc !important;
    border-radius: 3px !important;
    padding: 6px 8px !important;
    font-size: 13px !important;
    font-family: inherit !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #D9000F !important;
    outline: none !important;
}

.file-upload-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-error {
    color: #D9000F;
    font-size: 12px;
    font-weight: 600;
}

.file-success {
    color: #1a7a38;
    font-size: 12px;
    font-weight: 600;
}

.file-upload-area small {
    color: #999;
    font-size: 11px;
}

.file-upload-area.creg-error {
    border: 1px solid #D9000F;
    background: #fff5f5;
    border-radius: 3px;
    padding: 4px;
}

/* Select2 error state - using class for higher specificity */
.select2-container.select2-error .select2-selection--single {
    border: 1px solid #D9000F !important;
    background-color: #fff5f5 !important;
}

button.select2-selection__clear span {
    display: none !important;
}

/* Salary input wrapper */
.salary-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s;
}

.salary-input-wrapper:focus-within {
    border-color: #D9000F;
}

.salary-input-wrapper input {
    border: none !important;
    border-radius: 0 !important;
    flex: 1;
    padding: 8px 10px !important;
    font-size: 13px !important;
    background: transparent !important;
    outline: none !important;
}

.salary-suffix {
    padding: 8px 10px;
    background: #f5f5f5;
    color: #666;
    font-size: 12px;
    font-weight: 600;
    border-left: 1px solid #ccc;
    white-space: nowrap;
    flex-shrink: 0;
}

.salary-hint {
    color: #999;
    font-size: 11px;
}

.salary-converted {
    color: #1a7a38;
    font-size: 12px;
    font-weight: 600;
}

.salary-error-msg {
    color: #D9000F;
    font-size: 12px;
}

/* Error state on wrapper */
.salary-input-wrapper.creg-error {
    border-color: #D9000F !important;
    background: #fff5f5 !important;
}

/* Square radio buttons */
.creg-check-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border: 1px solid #999;
    border-radius: 2px; /* square with slight rounding */
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
}

.creg-check-label input[type="radio"]:checked {
    background: #D9000F;
    border-color: #D9000F;
}

/* Checkmark inside */
.creg-check-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.creg-check-label input[type="radio"]:hover {
    border-color: #D9000F;
}

/* ── Special Certifications ──────────────────────── */
.creg-certifications {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.creg-others-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}
.creg-others-input:focus { border-color: #c0201e; }
.creg-others-input.creg-error { border-color: #D9000F; background: #fff5f5; }

/* ── Special Certifications Others input ─────────── */
.creg-others-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
    margin-top: 4px;
}
.creg-others-input:focus  { border-color: #c0201e; }
.creg-others-input.creg-error { 
    border-color: #D9000F; 
    background: #fff5f5; 
}
/* ── Special Certifications — match other Select2 fields ── */
#special_certifications + .select2-container .select2-selection--multiple {
    min-height: 36px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0px;
    font-size: 14px;
    background: #fff;
}

#special_certifications + .select2-container .select2-selection--multiple
.select2-selection__rendered {
    padding: 0;
    display: contents;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

#special_certifications + .select2-container .select2-selection--multiple
.select2-selection__choice {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #c0201e;
    border-radius: 4px;
    padding: 2px 12px;
    font-size: 13px;
    margin: 2px;
}

#special_certifications + .select2-container .select2-selection--multiple
.select2-selection__choice__remove {
    color: #c0201e;
    margin-right: 4px;
}

#special_certifications + .select2-container--focus .select2-selection--multiple,
#special_certifications + .select2-container--open .select2-selection--multiple {
    border-color: #c0201e;
    outline: none;
}

/* Match height with single select fields */
#special_certifications + .select2-container {
    width: 100% !important;
}

/* ── Special Certifications Dropdown ─────────────── */

/* Arrow icon on the select2 */
#special_certifications + .select2-container .select2-selection--multiple {
    min-height: 36px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 36px 4px 8px; /* right padding for arrow */
    font-size: 14px;
    background: #fff;
    position: relative;
    cursor: pointer;
}

/* Custom arrow icon */
#special_certifications + .select2-container .select2-selection--multiple::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #888;
    pointer-events: none;
}

/* Arrow points up when open */
#special_certifications + .select2-container--open .select2-selection--multiple::after {
    border-top: none;
    border-bottom: 6px solid #888;
}

/* ── Languages — match other Select2 fields ── */
#candidate_languages + .select2-container .select2-selection--multiple {
    min-height: 36px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0px;
    font-size: 14px;
    background: #fff;
}

#candidate_languages + .select2-container .select2-selection--multiple
.select2-selection__rendered {
    padding: 0;
    display: contents;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

#candidate_languages + .select2-container .select2-selection--multiple
.select2-selection__choice {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #c0201e;
    border-radius: 4px;
    padding: 2px 12px;
    font-size: 13px;
    margin: 2px;
}

#candidate_languages + .select2-container .select2-selection--multiple
.select2-selection__choice__remove {
    color: #c0201e;
    margin-right: 4px;
}

#candidate_languages + .select2-container--focus .select2-selection--multiple,
#candidate_languages + .select2-container--open .select2-selection--multiple {
    border-color: #c0201e;
    outline: none;
}

/* Match height with single select fields */
#candidate_languages + .select2-container {
    width: 100% !important;
}

/* ── Special Certifications Dropdown ─────────────── */

/* Arrow icon on the select2 */
#candidate_languages + .select2-container .select2-selection--multiple {
    min-height: 36px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 36px 4px 8px; /* right padding for arrow */
    font-size: 14px;
    background: #fff;
    position: relative;
    cursor: pointer;
}

/* Custom arrow icon */
#candidate_languages + .select2-container .select2-selection--multiple::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #888;
    pointer-events: none;
}

/* Arrow points up when open */
#candidate_languages + .select2-container--open .select2-selection--multiple::after {
    border-top: none;
    border-bottom: 6px solid #888;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{
        border-right: none !important;
}

/* Make the multi-select container look like single select */
#candidate_languages + .select2-container 
.select2-selection--multiple 
.select2-selection__rendered {
    padding-right: 30px;
}

/* ── CV View button ──────────────────────────────── */
.ps-cv-view-btn {
    display: inline-flex;
    align-items: center;
    color: #2563eb;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color .2s;
    flex-shrink: 0;
}
.ps-cv-view-btn:hover { color: #c0201e; }

/* Alerts in edit profile */
.ps-alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 8px;
}
.ps-alert-error   { background:#fef2f2; color:#b91c1c; border:1px solid #fca5a5; }
.ps-alert-success { background:#f0fdf4; color:#15803d; border:1px solid #86efac; }
.ps-cv-max-notice {
    background: #fef9c3;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #92400e;
}
.ps-cv-count-msg {
    font-size: 12px;
    color: #888;
    margin: 4px 0 0;
}
button.ps-cv-remove-btn.reg-file-remove {
    padding: 2px 9px;
}


/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .creg-section {
        padding: 30px 15px;
    }

    .creg-header {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }

    .creg-title {
        font-size: 20px;
    }

    #creg-form {
        padding: 10px 20px 30px;
    }

    #creg-edit-form{
        padding: 10px 20px 30px;
    }

    .creg-row {
        grid-template-columns: 1fr;
    }

    .creg-field.full {
        grid-column: 1;
    }

    .creg-field {
        flex-wrap: wrap;
    }

    .creg-field label {
        min-width: unset;
        width: 100%;
    }

    .creg-field .sep {
        display: none;
    }

    .creg-checkboxes {
        gap: 16px;
    }

    .creg-terms-row {
        flex-direction: column;
        gap: 12px;
    }

    #creg-btn {
        width: 100%;
        padding: 13px 20px;
    }

    #creg-edit-btn{
        width: 100%;
        padding: 13px 20px;
    }
}
