/* nv_stakeholders: stakeholder registration form.
   Reuses the host theme's CSS custom properties (--bg-surface, --text-muted,
   --border-subtle, etc. - see the sitepackage's layout.css :root) so the form
   inherits light/dark theming without duplicating colours here; falls back
   to sane values if a host project doesn't define them. */

.nv-stakeholder-form .nv-form-errors {
    background: var(--c-burnt-tint, color-mix(in srgb, #c0392b 12%, transparent));
    border: 1px solid var(--c-burnt-deep, #c0392b);
    color: var(--text-primary, inherit);
    border-radius: 6px 20px 6px 20px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.nv-stakeholder-form .nv-form-errors ul { margin: .5rem 0 0; padding-left: 1.25rem; }

/* Left-aligned, not centered: matches the sitepackage's own convention for
   width-capped text (.hero .lede, and now .ce-bodytext in layout.css) - so
   the form lines up on the same left edge as the intro text above it on
   Get Involved, instead of the two starting from different points. */
.nv-stakeholder-form__form {
    max-width: 860px;
}

/* Each part is its own bounded card (like the rest of the site's card
   language) rather than a thin divider in one continuous scroll, so the
   four-step structure of the form is obvious even skimming past it - the
   #1 complaint about the previous version. Alternating corner direction
   matches the same left/right rhythm .wp-flow-card/.news-card use for
   their own repeating cards. */
.nv-stakeholder-form__form { counter-reset: nv-part; }
.nv-form-part {
    counter-increment: nv-part;
    border: 1px solid var(--border-subtle, #ddd);
    border-radius: 6px 28px 6px 28px;
    background: var(--bg-surface, #fff);
    padding: 1.75rem 1.5rem;
    margin: 0 0 1.5rem;
    /* The sitepackage header is position:fixed (layout.css), so
       scrollIntoView({block:'start'}) in stakeholder-form.js's goTo()
       would otherwise align the part's top edge with the very top of the
       viewport - right behind the header, forcing a manual scroll back up
       to actually see the part's own heading. scroll-margin-top is read
       natively by scrollIntoView, no JS offset math needed. */
    scroll-margin-top: calc(var(--header-height, 84px) + 1rem);
}
.nv-form-part:nth-of-type(even) { border-radius: 28px 6px 28px 6px; }

.nv-form-part > legend {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--font-heading, inherit);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary, inherit);
    padding: 0;
    margin-bottom: .75rem;
    width: 100%;
}
/* Clickable accordion header: the chevron flips per aria-expanded (kept in
   sync by stakeholder-form.js) rather than a sibling-selector trick, so it
   stays correct however the state was reached (Continue button, clicking
   the header itself, or the initial render picking up restored answers). */
.nv-form-part__legend { cursor: pointer; margin-bottom: 0; }
.nv-form-part__legend::after {
    content: "";
    margin-left: auto;
    width: .6em;
    height: .6em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: .5;
    flex-shrink: 0;
    transform: rotate(45deg);
    transition: transform .2s ease;
}
.nv-form-part__legend[aria-expanded="false"]::after { transform: rotate(-45deg); }
/* grid-template-rows 0fr->1fr animates to/from an unknown content height
   without JS ever measuring scrollHeight; the inner wrapper's own
   overflow:hidden is what clips the content while the row is
   collapsing/expanding - the outer grid element's row track IS the
   content's box, so it has nothing of its own left to overflow. */
.nv-form-part__body {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: 0;
    transition: grid-template-rows .3s ease, margin-top .3s ease;
}
.nv-form-part__body.is-open {
    grid-template-rows: 1fr;
    margin-top: .75rem;
}
.nv-form-part__body-inner {
    overflow: hidden;
    min-height: 0;
}
/* Swaps the numbered badge for a checkmark once a part's own fields are all
   valid - set/cleared by stakeholder-form.js from each field's own native
   validity, never by hand, so it can't drift from what's actually still
   required. */
.nv-form-part--done .nv-form-part__eyebrow::before { content: "\2713"; }
/* The "Part N" label used to be plain small text, easy to miss while
   scrolling - a filled numbered badge reads at a glance, and echoes the
   same cut-corner badge shape as .resource-card__filetype. The number is
   CSS-generated (counter(nv-part)) so it can't drift from the actual
   fieldset order; the "Part N" text already in the markup is kept as a
   screen-reader-visible label but visually hidden behind the badge. */
.nv-form-part__eyebrow {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    /* Centering this against the heading text relies on the legend's own
       flex layout (align-items: center above) rather than vertical-align:
       with no "Part N" text left inside this container for a text
       baseline to anchor to, baseline-relative tricks here are one font's
       metrics away from drifting again. Flex alignment is geometric, not
       baseline-based, so it stays centered regardless of font/line-height. */
    font-size: 0;
}
.nv-form-part__eyebrow::before {
    content: counter(nv-part);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 4px 12px 4px 12px;
    background: var(--c-moss, #559827);
    color: var(--c-white, #fff);
    font-size: .95rem;
    font-weight: 700;
}
.nv-form-part:nth-of-type(even) .nv-form-part__eyebrow::before {
     background: var(--c-moss, #559827);
    color: var(--c-white, #fff);
    border-radius: 12px 4px 12px 4px;
}
.nv-form-part__intro {
    color: var(--text-muted, #666);
    max-width: 62ch;
    margin-bottom: 1.25rem;
}

.nv-form-part__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}
/* Part 1 has nowhere to go back to, so it's the only row without a Back
   button and stays right-aligned; every other row puts Back on the left
   and Next/Submit on the right. */
.nv-form-part__actions--split {
    justify-content: space-between;
}
/* Disabled until the part's own required fields validate (stakeholder-
   form.js toggles the attribute) - the only cue that "not yet" isn't a
   dead button is this visual state, so it needs to read clearly. */
[data-nv-part-continue]:disabled,
[data-nv-submit]:disabled {
    opacity: .45;
    cursor: not-allowed;
}
/* Submitting (or checking the email on Part 1) is also disabled, but must
   not read as the same dead "not valid yet" state above - full opacity
   plus a spinner says "working", not "blocked". .btn-colibri already lays
   out as inline-flex with a gap (for its arrow icon), so the spinner just
   becomes another flex child instead of needing its own positioning.
   Shared by [data-nv-submit] and [data-nv-part-continue] rather than
   scoped to one, since both buttons use the same .is-loading toggle. */
[data-nv-submit].is-loading:disabled,
[data-nv-part-continue].is-loading:disabled {
    opacity: 1;
    cursor: wait;
}
[data-nv-submit].is-loading::after,
[data-nv-part-continue].is-loading::after {
    content: "";
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: nv-spin .6s linear infinite;
}
@keyframes nv-spin {
    to { transform: rotate(360deg); }
}
/* Secondary action, not .btn-colibri-outline: that variant is a white
   outline meant for dark hero backgrounds and would be invisible on this
   card's light background. */
.nv-form-part__back {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.65rem 1.75rem;
    border-radius: 4px 16px 4px 16px;
    background: transparent;
    border: 2px solid var(--border-subtle, #ddd);
    color: var(--text-primary, inherit);
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.nv-form-part__back:hover {
    border-color: var(--c-moss, #559827);
    color: var(--c-moss, #559827);
}

.nv-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem 1.25rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 600px) {
    .nv-form-grid { grid-template-columns: 1fr; }
}

.nv-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-bottom: 1rem;
}
.nv-field span { font-weight: 600; }
.nv-field em, legend em { color: var(--c-burnt-deep, #c0392b); font-style: normal; }
.nv-field input[type="text"],
.nv-field input[type="email"],
.nv-field input[type="tel"],
.nv-field input[type="url"],
.nv-field textarea {
    font: inherit;
    padding: .65rem .9rem;
    border: 1px solid var(--border-subtle, #ccc);
    border-radius: 6px 16px 6px 16px;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, inherit);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.nv-field input:focus-visible,
.nv-field textarea:focus-visible {
    outline: none;
    border-color: var(--c-moss, #559827);
    box-shadow: 0 0 0 3px var(--c-moss-tint, rgba(85, 152, 39, .2));
}
.nv-field input:disabled { opacity: .5; }
.nv-field input:read-only { background: var(--bg-tinted, #f4f4f2); color: var(--text-muted, #666); }

.nv-field--full { grid-column: 1 / -1; }
#nv-place-autocomplete {
    /* The widget is a native Google web component that otherwise follows
       the browser/OS's own dark-mode preference (prefers-color-scheme)
       regardless of this site's own light/dark toggle, rendering with a
       black background for any visitor whose system is set to dark - this
       is the documented way to pin it to Google's light skin instead. */
    color-scheme: light;
}
#nv-place-autocomplete gmp-place-autocomplete { width: 100%; }
.nv-place-autocomplete-status { margin: .3rem 0 0; font-size: .85rem; color: var(--text-muted, #666); min-height: 1.2em; }
.nv-place-autocomplete-status--error { color: var(--c-burnt-deep, #c0392b); font-weight: 600; }

.nv-field-group {
    border: 1px solid var(--border-subtle, #ddd);
    border-radius: 6px 24px 6px 24px;
    background: var(--bg-tinted, #f7f7f7);
    padding: 1.25rem 1.5rem;
    margin: 0 0 1rem;
}
.nv-field-group > legend {
    padding: 0 .5rem;
    font-family: var(--font-heading, inherit);
    font-weight: 700;
    color: var(--text-primary, inherit);
}
.nv-field-group__subheading {
    font-weight: 600;
    margin: .75rem 0 .35rem;
}
.nv-field-group__subheading:first-child { margin-top: 0; }
.nv-field-hint {
    color: var(--text-muted, #666);
    font-size: .85rem;
    margin: .5rem 0 0;
}

.nv-category-groups .nv-field-group { margin-bottom: .75rem; }

.nv-checkbox-list, .nv-radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
}
/* One option per row - used where labels are long or a scannable vertical
   list reads better than the default wrapped inline flow. */
.nv-checkbox-list--stacked {
    flex-direction: column;
    flex-wrap: nowrap;
}
.nv-checkbox, .nv-radio {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-weight: 400;
    cursor: pointer;
}
.nv-checkbox input, .nv-radio input {
    accent-color: var(--c-moss, #559827);
    width: 1.15em;
    height: 1.15em;
    margin-top: .1em;
    flex-shrink: 0;
    cursor: pointer;
}
.nv-checkbox--required {
    margin-top: 1.5rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
    background: var(--bg-tinted, #f7f7f7);
    border: 1px solid var(--border-subtle, #ddd);
    border-radius: 6px 20px 6px 20px;
}

.nv-yesno-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.nv-yesno {
    background: var(--bg-tinted, #f7f7f7);
    border: 1px solid var(--border-subtle, #ddd);
    border-radius: 6px 20px 6px 20px;
    padding: .9rem 1.25rem;
}
.nv-yesno p { font-weight: 600; margin-bottom: .6rem; }

/* Privacy policy popup - same scrim + fixed-panel pattern already used for
   .partner-modal in the host sitepackage, kept self-contained here under the
   nv- prefix so this extension doesn't depend on that project's CSS. */
.nv-privacy-modal-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 1035;
}
.nv-privacy-modal-scrim.is-visible { opacity: 1; pointer-events: auto; }

.nv-privacy-modal {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(680px, 92vw);
    max-height: min(80vh, 720px);
    /* Clips to the rounded corners below - the scrollbar itself lives on
       .nv-privacy-modal__body instead, so it never overlaps/interrupts the
       curve like it did when this element scrolled directly. */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1036;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-subtle, #ddd);
    border-radius: 6px 24px 6px 24px;
    box-shadow: 0 2rem 4rem rgba(0, 0, 0, .35);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}
.nv-privacy-modal.is-visible { opacity: 1; transform: translateY(0); }
.nv-privacy-modal[hidden] { display: none; }
.nv-privacy-modal__body {
    overflow-y: auto;
    min-height: 0;
    padding: 2.5rem;
}
.nv-privacy-modal__body h3 { margin-top: 1.5rem; }
.nv-privacy-modal__close {
    all: unset;
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted, #666);
    font-size: 1.3rem;
    line-height: 1;
}
.nv-privacy-modal__close:hover { background: var(--bg-tinted, #f2f2f2); }

/* A plain paragraph in the same tinted box as everything else on the page
   read as more of the same text, not confirmation that the submission went
   through - the moss tint/border and the checkmark badge below (echoing
   the same cut-corner badge already used for a completed accordion part)
   are what make this one specifically read as a success state. */
.nv-stakeholder-thankyou__card {
    padding: 2.5rem;
    border-radius: 6px 24px 6px 24px;
    background: var(--c-moss-tint, rgba(85, 152, 39, .08));
    border: 1px solid var(--c-moss, #559827);
    border-left-width: 6px;
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .08);
}
.nv-stakeholder-thankyou__card h2 {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.nv-stakeholder-thankyou__card h2::before {
    content: "\2713";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 4px 12px 4px 12px;
    background: var(--c-moss, #559827);
    color: var(--c-white, #fff);
    font-size: 1.1rem;
    font-weight: 700;
}
