/* Accent word in the heading — `font-size`/`line-height: inherit` defeat the
   global `span { font-size }` reset in app.css (CSS-only exception per
   CLAUDE.md) so the word tracks the heading's size instead of dropping to the
   base text size. */
.job-application-form__accent {
    font-size: inherit;
    line-height: inherit;
}

/* ─────────────────────────────────────────────────────────────────────────
   Direct Job Application Form — pill-style skin matching the Figma design.
   Scoped via the form's own cssClass (see pd_gf_form_definitions() in
   includes/functions/seed-gravity-forms.php) so other Gravity Forms on the
   site (Contact, Employer Contact) keep the shared rectangular skin from
   assets/css/components.css.
   ───────────────────────────────────────────────────────────────────────── */

form.pd-form--job-application .gform_fields {
    row-gap: 24px;
    column-gap: 24px;
}

/* Validation error messages — red text.
   Per-field messages (.validation_message) live inside the field markup, so
   they're descendants of <form>. The top-of-form validation summary (only
   shown if the form's `validationSummary` setting is on) is rendered before
   the <form> tag opens like the required-legend above, so it needs the same
   `_wrapper` targeting instead. */
form.pd-form--job-application .validation_message {
    color: var(--color-error);
}

.pd-form--job-application_wrapper .gform_validation_errors,
.pd-form--job-application_wrapper .gform_validation_errors * {
    color: var(--color-error);
}

/* Space it away from the form/fields below — it's a sibling of <form>, so
   margin-bottom here pushes the whole form (not just the first field) down. */
.pd-form--job-application_wrapper .gform_validation_errors {
    margin-bottom: 24px;
}

/* GF auto-renders this "'*' indicates required fields" legend whenever
   requiredIndicator isn't 'text' (see pd_gf_form_definitions()) — not part
   of the Figma design, so hide it here.
   Note: GF renders the heading/legend block BEFORE the <form> tag opens —
   both are siblings inside the outer .gform_wrapper div, so a `form.pd-form-
   -job-application .gform_required_legend` selector never matches. GF does
   append `_wrapper`-suffixed classes (from the form's own cssClass) to that
   wrapper div, so target that instead. */
.pd-form--job-application_wrapper .gform_required_legend {
    display: none;
}

form.pd-form--job-application .gfield_label {
    display: block !important;
    margin-bottom: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: -0.15px;
    color: var(--color-dark);
}

/* Required asterisk — GF's own native indicator span (a sibling right after
   </label>, not baked into the label/placeholder text — see requiredIndicator
   in pd_gf_form_definitions()), un-hidden and colored just for this form. */
form.pd-form--job-application .gfield_required {
    display: inline !important;
    margin-left: 4px;
    color: var(--color-green);
}

form.pd-form--job-application input[type="text"],
form.pd-form--job-application input[type="email"],
form.pd-form--job-application input[type="tel"] {
    height: 50px;
    padding: 12px 16px;
    background: var(--color-cream);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: 16px;
    letter-spacing: -0.31px;
    color: var(--color-dark);
}

form.pd-form--job-application input[type="text"]::placeholder,
form.pd-form--job-application input[type="email"]::placeholder,
form.pd-form--job-application input[type="tel"]::placeholder {
    color: rgba(26, 26, 26, 0.5);
    opacity: 1;
}

form.pd-form--job-application textarea {
    height: 122px;
    padding: 12px 16px;
    background: var(--color-cream);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 24px;
    letter-spacing: -0.31px;
    color: var(--color-dark);
    resize: none;
}

form.pd-form--job-application textarea::placeholder {
    color: rgba(26, 26, 26, 0.5);
    opacity: 1;
}

/* ── File upload — dashed dropzone ────────────────────────────────────────
   The native <input type="file"> is stretched invisibly over the whole box
   (position:absolute, opacity:0) so click-to-browse and native drag-and-drop
   both work with zero JS for the interaction itself.

   The decorative icon + copy is drawn entirely with CSS (::before/::after,
   a CSS-only exception per CLAUDE.md) anchored to GF's own always-present
   markup, rather than injected via a gform_field_content PHP filter — that
   approach didn't reliably survive Gravity Forms' AJAX validation reload
   (a full server re-render inside a hidden iframe, then DOM-swapped back
   in), so the whole dropzone visual would vanish after a failed submit.
   Pure CSS has no render path to fail on: it's just always there. */
form.pd-form--job-application .gfield--type-fileupload,
form.pd-form--job-application .gfield--type-consent {
    grid-column: 1 / -1;
}

/* display:flex column (rather than fixed-height + absolutely-positioned
   children at fixed `top` offsets) so a wrapped label line pushes the hint
   line down instead of the two overlapping — see the mask icon/label/hint
   rules below, which rely on being flex items rather than absolute. */
form.pd-form--job-application .ginput_container_fileupload {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 160px;
    padding: 24px 34px;
    background: var(--color-cream);
    border: 2px dashed rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    transition: border-color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}

form.pd-form--job-application .ginput_container_fileupload.is-dragover {
    border-color: var(--color-green);
    background: color-mix(in srgb, var(--color-green) 8%, var(--color-cream));
}

form.pd-form--job-application .ginput_container_fileupload input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

form.pd-form--job-application .ginput_container_fileupload input[type="file"]::file-selector-button {
    display: none;
}

/* Upload icon (Feather/Lucide "upload" glyph) — a 40x40 mask so it can be
   recolored with a plain background-color instead of baking a fill/stroke
   color into the data URI. */
form.pd-form--job-application .ginput_container_fileupload::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    background-color: #6B6B6B;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    pointer-events: none;
}

/* Main label — repurposes GF's own "accepted file types" copy (always
   rendered since allowedExtensions is set on this field, see
   pd_gf_form_definitions()): its real generated text is collapsed to
   font-size:0 and our copy is drawn via ::before instead, so this line
   gets its own independent styling distinct from the hint line below. */
form.pd-form--job-application .gform_fileupload_rules {
    display: block !important;
    font-size: 0;
    line-height: 0;
    text-align: center;
    pointer-events: none;
}

form.pd-form--job-application .gform_fileupload_rules::before {
    /* --pd-cv-filename is set inline by script.js once a file is chosen
       (holding an already-quoted string), falling back to the prompt copy. */
    content: var(--pd-cv-filename, "Sleep je CV hierheen of klik om te uploaden");
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.15px;
    color: rgba(26, 26, 26, 0.7);
}

form.pd-form--job-application .ginput_container_fileupload::after {
    content: "PDF, DOC, DOCX (max 5MB)";
    display: block;
    font-family: var(--font-body);
    font-size: 12px;
    line-height: 16px;
    color: #6B6B6B;
    text-align: center;
    pointer-events: none;
}

/* ── Consent checkbox — circular, per Figma ──────────────────────────────── */
form.pd-form--job-application .gfield--type-consent .gfield_label {
    display: none !important;
}

/* The checkbox <input> and its <label> are siblings inside this container
   (GF does not wrap them in a shared parent), so the flex row has to live
   here — flexing the label alone leaves the checkbox and text unaligned. */
form.pd-form--job-application .ginput_container_consent {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 4px;
}

form.pd-form--job-application .ginput_container_consent label {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.15px;
    color: rgba(26, 26, 26, 0.6);
    cursor: pointer;
}

/* font-size/line-height: inherit defeat the global `a { font-size:
   var(--text-base) }` reset in app.css (CSS-only exception per CLAUDE.md) so
   the link matches the surrounding 14px label text instead of jumping to the
   base type size. */
form.pd-form--job-application .ginput_container_consent label a {
    font-size: inherit;
    line-height: inherit;
    color: var(--color-green);
    text-decoration: underline;
}

form.pd-form--job-application .ginput_container_consent input[type="checkbox"] {
    appearance: none;
    width: 15px;
    height: 15px;
    margin: 0;
    background: #D9D9D9;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    flex-shrink: 0;
}

form.pd-form--job-application .ginput_container_consent input[type="checkbox"]:checked {
    background: var(--color-green);
}

/* ── Submit button — full-width rounded pill with icon ───────────────────── */
form.pd-form--job-application .gform_footer {
    margin-top: 24px;
}

form.pd-form--job-application .gform_footer .gform_button {
    width: 100%;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ja-theme, var(--color-green));
    color: #FFFFFF;
    border: none;
    border-radius: 9999px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.31px;
    cursor: pointer;
    transition: filter var(--duration-fast) var(--ease);
}

/* The button's label is a bare <span> injected via gform_submit_button (see
   components/job-application-form.php) — the global `span { color }` reset
   in app.css otherwise forces it dark regardless of the button's own color. */
form.pd-form--job-application .gform_footer .gform_button span {
    color: inherit;
}

form.pd-form--job-application .gform_footer .gform_button:hover {
    filter: brightness(0.9);
}
