/* Job application button + modal (career listings only).
   Enqueued site-wide via a tplHeader rlCustom hook (includes/classes/rlCustom.class.php);
   the markup itself (custom/tpl/job_apply_modal.tpl) only renders on career listing
   detail pages, so loading this small stylesheet everywhere is harmless.
   Uses the theme's existing CSS custom properties (see templates/general_sunny/css/style.css
   and light.css/dark.css) so light/dark mode and brand colors stay in sync automatically. */

.job-apply-block {
    margin: 20px 0;
}

a.job-apply-btn.button {
    display: inline-flex;
}

/* Overlay */
.job-apply-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--popup-mask-background-color, rgba(0, 0, 0, 0.6));
    z-index: 10060;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.job-apply-modal-overlay.is-open {
    display: flex;
}

body.job-apply-no-scroll {
    overflow: hidden;
}

/* Modal box */
.job-apply-modal {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--content-background-color, #fff);
    color: var(--body-font-color, #222);
    border-radius: 10px;
    padding: 32px;
    box-sizing: border-box;
    box-shadow: 0 20px 60px rgba(17, 17, 17, 0.3);
}

.job-apply-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    line-height: 30px;
    text-align: center;
    background: transparent;
    border: none;
    font-size: 1.5em;
    color: var(--body-font-color, #222);
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
}

.job-apply-modal-close:hover {
    background: rgba(128, 128, 128, 0.15);
}

.job-apply-modal-title {
    margin: 0 32px 20px 0;
    font-size: 1.375em;
    font-weight: 600;
}

.job-apply-messages {
    margin-bottom: 16px;
}

.job-apply-messages:empty {
    display: none;
}

.job-apply-messages.job-apply-success {
    padding: 10px 14px;
    border-radius: 6px;
    background: rgba(69, 177, 80, 0.12);
    color: #2f7d38;
}

.job-apply-messages.job-apply-fail {
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--form-error-background-color, #fbe7e7);
    color: var(--form-error-text-color, #a33a3a);
}

/* Form layout */
.job-apply-form .job-apply-field {
    margin-bottom: 16px;
}

.job-apply-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9375em;
    font-weight: 500;
}

.job-apply-required {
    color: #c51c1c;
}

.job-apply-form input[type="text"],
.job-apply-form input[type="email"],
.job-apply-form input[type="tel"],
.job-apply-form input[type="file"],
.job-apply-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 0.9375em;
    font-family: inherit;
    color: var(--body-font-color, #222);
    background: var(--form-background-color, #fff);
    border: 1px solid var(--form-field-line-color, #d4d4d4);
    border-radius: 6px;
}

.job-apply-form textarea {
    resize: vertical;
    min-height: 100px;
}

.job-apply-form input:focus,
.job-apply-form textarea:focus {
    outline: none;
    border-color: var(--form-field-line-color-focus, var(--button-color, #4eaeb9));
}

.job-apply-form input.error,
.job-apply-form textarea.error {
    border-color: #c51c1c;
}

.job-apply-hint {
    margin-top: 6px;
    font-size: 0.8125em;
    color: var(--info-field-color, #888);
}

.job-apply-error {
    margin-top: 6px;
    font-size: 0.8125em;
    color: #c51c1c;
}

.job-apply-error:empty {
    display: none;
}

/* Honeypot: kept in the DOM/tab-flow-adjacent but invisible to sighted users
   and out of the tab order (see tabindex="-1" in the markup). Not display:none
   / visibility:hidden, which some bots special-case. */
.job-apply-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.job-apply-consent label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
}

.job-apply-consent input[type="checkbox"] {
    margin-top: 3px;
    flex: 0 0 auto;
}

.job-apply-submit-row {
    margin-top: 20px;
    margin-bottom: 0;
}

.job-apply-submit-row .button {
    width: 100%;
}

@media screen and (max-width: 600px) {
    .job-apply-modal {
        padding: 24px 18px;
        border-radius: 8px;
    }

    .job-apply-modal-title {
        font-size: 1.1875em;
    }
}
