/* ─── Promo section ────────────────────────────────────────────────────── */

.job-alert-section {
    padding-block: 100px;
}

.job-alert-section__wave {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    z-index: 0;
}

.job-alert-section .container {
    position: relative;
    z-index: 1;
}

.job-alert-section:not(.job-alert-section--no-wave)::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: #ffffff;
}

/* ─── Modal shell ──────────────────────────────────────────────────────── */

.job-alert-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
}

.job-alert-modal--open {
    display: flex;
}

.job-alert-modal__inner {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90dvh;
    overflow-y: auto;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    padding: 44px;
}

@media (max-width: 600px) {
    .job-alert-modal__inner {
        padding: 28px 20px;
        border-radius: var(--radius-md);
    }
}

.job-alert-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--color-primary);
    background: #F1F3F5;
    border: none;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease);
}

.job-alert-modal__close:hover {
    background: #E4E6E9;
}

.job-alert-modal__title {
    padding-right: 40px;
    margin-bottom: 24px;
}

/* ─── Third-party plugin form ([pd_job_alert] shortcode) ─────────────────
   The Job Alert plugin owns this markup — selectors below key off its
   fixed class names (#jobAlertForm, .contact-form__*, .catCheckboxContainer,
   .pjaBttn*) and can only be restyled, not restructured. */

.job-alert-modal #jobAlertForm {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.job-alert-modal .fieldsWrapper,
.job-alert-modal .contact-form__body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.job-alert-modal .contact-form__name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 600px) {
    .job-alert-modal .contact-form__name-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

.job-alert-modal .contact-form__input {
    width: 100%;
    height: 52px;
    padding: 0 18px;
    background: #F4F5F7;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    font-family: var(--font-body);
    color: var(--color-primary);
    outline: none;
    transition: border-color var(--duration-fast) var(--ease),
                background var(--duration-fast) var(--ease);
}

.job-alert-modal .contact-form__input::placeholder {
    color: #8A8F98;
}

.job-alert-modal .contact-form__input:hover {
    background: #ECEEF1;
}

.job-alert-modal .contact-form__input:focus {
    background: var(--color-white);
    border-color: var(--color-accent);
}

/* Category dropdown (built by script.js from the plugin's checkbox grid) */
.pja-cat-dropdown {
    position: relative;
}

.pja-cat-dropdown__trigger {
    width: 100%;
    height: 52px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #F4F5F7;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    font-family: var(--font-body);
    color: var(--color-primary);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease),
                background var(--duration-fast) var(--ease);
}

.pja-cat-dropdown__trigger:hover {
    background: #ECEEF1;
}

.pja-cat-dropdown--open .pja-cat-dropdown__trigger {
    background: var(--color-white);
    border-color: var(--color-accent);
}

.pja-cat-dropdown__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pja-cat-dropdown__label--placeholder {
    color: #8A8F98;
}

.pja-cat-dropdown__chevron {
    flex-shrink: 0;
    color: #8A8F98;
    transition: transform var(--duration-fast) var(--ease);
}

.pja-cat-dropdown--open .pja-cat-dropdown__chevron {
    transform: rotate(180deg);
}

.pja-cat-dropdown__panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 260px;
    overflow-y: auto;
    padding: 14px;
    background: var(--color-white);
    border: 1px solid #E4E6E9;
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.pja-cat-dropdown--open .pja-cat-dropdown__panel {
    display: block;
}

.pja-cat-dropdown__panel .contact-form__checkbox-grid-flex {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Checkbox (category list items + privacy consent) */
.job-alert-modal .contact-form__checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-sm);
    color: var(--color-primary);
    cursor: pointer;
    line-height: var(--leading-normal);
}

.job-alert-modal .contact-form__checkbox-label a {
    font-weight: var(--font-weight-semibold);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--duration-fast) var(--ease);
}

.job-alert-modal .contact-form__checkbox-label a:hover {
    color: var(--color-accent);
}

/* Hide native checkbox; .contact-form__checkbox is the visual */
.job-alert-modal input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.job-alert-modal .contact-form__checkbox {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: #F4F5F7;
    border: 1.5px solid #D5D8DC;
    transition: background var(--duration-fast) var(--ease),
                border-color var(--duration-fast) var(--ease);
}

/* Checked state — covers both the sibling-checkbox selector AND the
   data-checked attribute the plugin toggles via its own JS. */
.job-alert-modal input[type="checkbox"]:checked + .contact-form__checkbox,
.job-alert-modal .contact-form__checkbox[data-checked="true"] {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.job-alert-modal input[type="checkbox"]:checked + .contact-form__checkbox::after,
.job-alert-modal .contact-form__checkbox[data-checked="true"]::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 11px;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 9' fill='none'%3E%3Cpath d='M1 4.5L4.5 8L11 1' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Submit */
.job-alert-modal .button-primary,
.job-alert-modal .pjaBttnSubmit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding-inline: 32px;
    margin-top: 6px;
    align-self: flex-start;
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    border-radius: 9999px;
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: filter var(--duration-fast) var(--ease);
}

.job-alert-modal .button-primary:hover,
.job-alert-modal .pjaBttnSubmit:hover {
    filter: brightness(0.92);
}

@media (max-width: 600px) {
    .job-alert-modal .button-primary,
    .job-alert-modal .pjaBttnSubmit {
        width: 100%;
    }
}

/* Validation / success messages */
.job-alert-modal .formMessages {
    font-size: var(--text-sm);
    color: var(--color-error);
}

.job-alert-modal .formMessages:empty {
    display: none;
}
