/* =============================================================================
   Resource Library: the Program Portal's forms and messages.

   Extends the Program Portal block's card and field styles
   (acf-blocks/program-portal/raw/style.scss: .wdx-pp__card, .wdx-pp__ff …)
   with what the design doesn't draw: the message above the cards, a select,
   the show-password toggle, small print and links under a form. Plain CSS
   (no build step), brand tokens only, so every color mode follows.
   ============================================================================= */

/* ---- The message above the cards ------------------------------------------ */
.wdx-rl-msg {
    grid-column: 1 / -1;
    padding: 16px 20px;
    background: var(--wdx-paper);
    border: 1px solid var(--wdx-forest-ink);
    border-left-width: 6px;
    border-radius: 8px;
    color: var(--wdx-forest-ink);
    font: 400 16px/1.6 var(--wdx-font-sans);
    scroll-margin-top: calc(var(--wdx-hdr, 80px) + 24px);
}

.wdx-rl-msg p {
    margin: 0;
}

.wdx-rl-msg p + p {
    margin-top: 8px;
}

.wdx-rl-msg a {
    color: inherit;
    font-weight: 500;
    text-underline-offset: 3px;
}

/* Errors: apricot edge and an "!" so the tone never rests on color alone. */
.wdx-rl-msg--error {
    border-color: var(--wdx-apricot-ink);
}

.wdx-rl-msg--error p:first-child::before {
    content: "! ";
    font-weight: 600;
    color: var(--wdx-apricot-ink);
}

.wdx-rl-msg:focus {
    outline: 2px solid var(--wdx-forest-ink);
    outline-offset: 3px;
}

/* ---- Inside the cards ----------------------------------------------------- */
.wdx-rl-intro {
    margin: -8px 0 24px;
    font: 400 16px/1.6 var(--wdx-font-sans);
    color: var(--wdx-text);
}

.wdx-rl-info .wdx-rl-intro {
    margin: 0 0 12px;
}

.wdx-rl-alt {
    margin: 20px 0 0;
    font: 400 16px/1.6 var(--wdx-font-sans);
    color: var(--wdx-text);
}

.wdx-rl-alt a {
    display: inline-block;
    min-height: 24px;
    color: var(--wdx-forest-ink);
    font-weight: 500;
    text-underline-offset: 3px;
}

.wdx-rl-fine {
    margin: 16px 0 0;
    font: 400 14px/1.5 var(--wdx-font-sans);
    color: var(--wdx-muted);
}

.wdx-rl-opt {
    font-weight: 400;
    color: var(--wdx-muted);
}

.wdx-rl-form-err:not([hidden]) {
    margin-bottom: 16px;
}

/* A select in the field box: the box draws the edge, the select fills it. */
.wdx-pp__c.wdx-rl-select {
    position: relative;
    padding: 0;
}

.wdx-pp__c.wdx-rl-select select {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 44px 0 18px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: 400 16px/1.2 var(--wdx-font-sans);
    color: var(--wdx-forest-ink);
    appearance: none;
    outline: none;
    cursor: pointer;
}

.wdx-pp__c.wdx-rl-select::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    width: 9px;
    height: 9px;
    margin-top: -7px;
    border-right: 2px solid var(--wdx-forest-ink);
    border-bottom: 2px solid var(--wdx-forest-ink);
    transform: rotate(45deg);
    pointer-events: none;
}

.wdx-pp__c select option {
    color: var(--wdx-ink);
    background: var(--wdx-paper);
}

/* Show / Hide beside a password. */
.wdx-rl-reveal {
    flex: none;
    min-width: 48px;
    min-height: 32px;
    padding: 4px 8px;
    border: 0;
    border-radius: 6px;
    background: none;
    font: 500 14px/1 var(--wdx-font-sans);
    color: var(--wdx-forest-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.wdx-rl-reveal:focus-visible {
    outline: 2px solid var(--wdx-forest-ink);
    outline-offset: 2px;
}

.wdx-rl-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    font: 400 16px/1.4 var(--wdx-font-sans);
    color: var(--wdx-text);
    cursor: pointer;
}

.wdx-rl-check input {
    width: 24px;
    height: 24px;
    margin: 0;
    accent-color: var(--wdx-forest-ink);
}

/* The bot trap: out of sight and out of reach for people. */
.wdx-rl-hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Sending: the button shows it, and can't be pressed twice. */
.wdx-rl-form[aria-busy="true"] .wdx-btn {
    opacity: .6;
    pointer-events: none;
}

.cf-turnstile {
    margin-top: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .wdx-rl-msg {
        scroll-behavior: auto;
    }
}
