/*
 * The legacy HubSpot form (resources/views/frontend/capability/partials/legacy-form.blade.php): moved out of
 * capability-page.css on 2026-12-02 so pages without the capability styles (the PEFAG 2027 page) can use it too.
 * Linked by every view that includes the partial. --cap-ink falls back to the capability pages' ink.
 */

/* A page's own legacy HubSpot form (partials/legacy-form, Strategic Planning since 2026-11-09): HubSpot sends it
   unstyled, so it is dressed like the frame's form on the other pages: a #fafafa card, white fields with a #ccc line
   and the label as placeholder, fields side by side as HubSpot groups them, a black Submit. Compact (user,
   2026-11-09): 24px padding, 44px fields 16px apart, the legal text small and grey with Submit beside it. The reserve
   holds the space until the form is in. */
.cap-legacy-form {
    position: relative;
    /* The FAQ list's width (user, 2026-11-09). */
    width: min(100%, 790px);
    min-height: 520px;
    margin: 0 auto;
    padding: 24px;
    background: #fafafa;
    color: var(--cap-ink, #232e33);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

.cap-legacy-form:has(form) {
    min-height: 0;
}

.cap-legacy-form .hs-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px 24px;
    align-items: end;
}

/* Every row spans the card, except the last one: the legal text on the left, Submit beside it. */
.cap-legacy-form .hs-form > * {
    grid-column: 1 / -1;
}

.cap-legacy-form .hs-form > fieldset:has(.legal-consent-container) {
    grid-column: 1;
}

.cap-legacy-form .hs-form > .hs_submit {
    grid-column: 2;
}

/* HubSpot's "Please complete all required fields" comes between the legal text and Submit in the markup: last, so the
   two stay on one row. */
.cap-legacy-form .hs-form > .hs_error_rollup {
    order: 1;
}

.cap-legacy-form .hs-form fieldset {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    max-width: none !important;
    margin: 0;
    padding: 0;
    border: 0;
}

/* No room for what shows nothing: HubSpot's hidden fields (utm_source) and the reCAPTCHA block, whose badge is fixed
   in the corner of the screen. */
.cap-legacy-form .hs-form fieldset:has(> .hs-form-field[style*="display: none"]:only-child) {
    display: none;
}

.cap-legacy-form .hs-form > .hs_recaptcha {
    position: absolute;
}

.cap-legacy-form .hs-form fieldset.form-columns-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cap-legacy-form .hs-form fieldset.form-columns-3 {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(0, 2fr));
}

.cap-legacy-form .hs-form .hs-form-field {
    float: none !important;
    width: 100% !important;
    margin: 0;
    padding: 0;
}

.cap-legacy-form .hs-form .input {
    margin: 0 !important;
}

/* The fields' own labels are empty (the placeholder carries the name): out of the layout, kept for screen readers. */
.cap-legacy-form .hs-form .hs-form-field > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Field text at the page's body size (14px) on mouse devices; touch screens keep 16px and 44px below. */
.cap-legacy-form .hs-form input.hs-input:not([type="checkbox"]):not([type="radio"]),
.cap-legacy-form .hs-form select.hs-input,
.cap-legacy-form .hs-form textarea.hs-input {
    width: 100% !important;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ccc;
    border-radius: 0;
    background: #fff;
    color: var(--cap-ink, #232e33);
    font-family: inherit;
    font-size: 14px;
    box-shadow: none;
}

/* Touch screens: under 16px iOS Safari zooms the page when a field gets focus, and 44px is the touch minimum. */
@media (hover: none), (pointer: coarse) {
    .cap-legacy-form .hs-form input.hs-input:not([type="checkbox"]):not([type="radio"]),
    .cap-legacy-form .hs-form select.hs-input,
    .cap-legacy-form .hs-form textarea.hs-input {
        height: 44px;
        font-size: 16px;
    }
}

.cap-legacy-form .hs-form textarea.hs-input {
    height: 74px;
    padding: 10px;
    resize: vertical;
}

.cap-legacy-form .hs-form select.hs-input {
    appearance: none;
    padding-right: 36px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M0 0h12L6 8z' fill='%23232e33'/%3E%3C/svg%3E") right 14px center / 12px 8px no-repeat;
}

.cap-legacy-form .hs-form select.hs-input.is-placeholder,
.cap-legacy-form .hs-form ::placeholder {
    color: #757575;
}

.cap-legacy-form .hs-form input.hs-input:focus,
.cap-legacy-form .hs-form select.hs-input:focus,
.cap-legacy-form .hs-form textarea.hs-input:focus {
    border-color: #00acc1;
    outline: 2px solid rgba(0, 172, 193, .25);
    outline-offset: 0;
}

/* Phone: the country code beside the number, as one field. */
.cap-legacy-form .hs-form .hs-fieldtype-intl-phone {
    display: flex;
    gap: 0;
    width: 100% !important;
    height: auto;
    padding: 0;
    border: 0;
    background: none;
}

.cap-legacy-form .hs-form .hs-fieldtype-intl-phone select.hs-input {
    flex: 0 0 120px;
    width: 120px !important;
    border-right: 0;
}

.cap-legacy-form .hs-form .hs-fieldtype-intl-phone input.hs-input {
    flex: 1 1 auto;
    min-width: 0;
}

/* Select2 on the dropdowns (assets/js/hubspot-select2.js, user 2026-11-09). The original select is hidden through the
   page's own attribute: HubSpot rewrites its class list, which drops Select2's hiding class. */
.cap-legacy-form select[data-hs-select2],
.cap-legacy-form .hs-form select.hs-input[data-hs-select2] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0 !important;
    white-space: nowrap;
}

/* The closed box: the other fields' look (40px / 14px; touch 44px / 16px below). */
.cap-legacy-form .select2-container--default .select2-selection--single {
    display: flex;
    align-items: center;
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 0;
    background: #fff;
    outline: none;
}

.cap-legacy-form .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0 36px 0 12px;
    color: var(--cap-ink, #232e33);
    font-size: 14px;
    line-height: 38px;
}

.cap-legacy-form .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #757575;
}

.cap-legacy-form .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 0;
    right: 0;
    width: 36px;
    height: 100%;
}

.cap-legacy-form .select2-container--default .select2-selection--single .select2-selection__arrow b {
    margin: -4px 0 0 -6px;
    border-width: 8px 6px 0;
    border-color: #232e33 transparent transparent;
}

.cap-legacy-form .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-width: 0 6px 8px;
    border-color: transparent transparent #232e33;
}

.cap-legacy-form .select2-container--default.select2-container--focus .select2-selection--single,
.cap-legacy-form .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #00acc1;
    outline: 2px solid rgba(0, 172, 193, .25);
}

/* Phone: the prefix box beside the number. */
.cap-legacy-form .hs-fieldtype-intl-phone .select2-container {
    flex: 0 0 150px;
    width: 150px !important;
}

.cap-legacy-form .hs-fieldtype-intl-phone .select2-selection--single {
    border-right: 0;
}

@media (hover: none), (pointer: coarse) {
    .cap-legacy-form .select2-container--default .select2-selection--single {
        height: 44px;
    }

    .cap-legacy-form .select2-container--default .select2-selection--single .select2-selection__rendered {
        font-size: 16px;
        line-height: 42px;
    }
}

/* The open list sits at the end of <body> (Select2 4.0.0 places it from the page offset), outside .cap-page and its
   tokens: plain values here. */
.select2-container--default .cap-select2-dropdown.select2-dropdown {
    border: 1px solid #ccc;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 8px 24px rgba(17, 22, 26, .08);
    font-family: Poppins, "Poppins Fallback", sans-serif;
    font-size: 14px;
}

.select2-container--default .cap-select2-dropdown--phone.select2-dropdown {
    min-width: 280px;
}

.select2-container--default .cap-select2-dropdown .select2-search--dropdown {
    padding: 8px;
}

.select2-container--default .cap-select2-dropdown .select2-search--dropdown .select2-search__field {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ccc;
    border-radius: 0;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.select2-container--default .cap-select2-dropdown .select2-search--dropdown .select2-search__field:focus {
    border-color: #00acc1;
}

.select2-container--default .cap-select2-dropdown .select2-results > .select2-results__options {
    max-height: 280px;
}

.select2-container--default .cap-select2-dropdown .select2-results__option {
    padding: 8px 12px;
    color: #232e33;
    line-height: 1.4;
}

.select2-container--default .cap-select2-dropdown .select2-results__option[aria-selected="true"] {
    background: #f2f4f5;
    font-weight: 600;
}

.select2-container--default .cap-select2-dropdown .select2-results__option.select2-results__option--highlighted[aria-selected] {
    background: #e6f7f9;
    color: #232e33;
}

@media (hover: none), (pointer: coarse) {
    .select2-container--default .cap-select2-dropdown.select2-dropdown,
    .select2-container--default .cap-select2-dropdown .select2-search--dropdown .select2-search__field {
        font-size: 16px;
    }

    .select2-container--default .cap-select2-dropdown .select2-results__option {
        padding: 12px;
    }
}

.cap-legacy-form .hs-form .hs-error-msgs {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.cap-legacy-form .hs-form .hs-error-msg,
.cap-legacy-form .hs-form .hs-main-font-element {
    color: #c62828;
    font-size: 13px;
}

/* Secondary: one size down, in a grey that keeps WCAG AA on the #fafafa card (4.84:1; the subtitle's #6e767a was
   4.44:1 there). */
.cap-legacy-form .hs-form .legal-consent-container,
.cap-legacy-form .hs-form .hs-richtext {
    margin: 0;
    color: #687074;
    font-size: 12px;
    line-height: 1.5;
}

.cap-legacy-form .hs-form .hs-richtext p {
    margin: 0;
}

.cap-legacy-form .hs-form .legal-consent-container a,
.cap-legacy-form .hs-form .hs-richtext a {
    color: inherit;
    text-decoration: underline;
}

.cap-legacy-form .hs-form .actions {
    margin: 0;
    padding: 0;
    text-align: right;
}

.cap-legacy-form .hs-form .hs-button {
    height: 44px;
    padding: 0 24px;
    border: 0;
    border-radius: 0;
    background: #101518;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease;
}

.cap-legacy-form .hs-form .hs-button:hover,
.cap-legacy-form .hs-form .hs-button:focus-visible {
    background: #2b3438;
}

.cap-legacy-form .submitted-message {
    padding: 24px 0;
    font-size: 16px;
    text-align: center;
}

@media (max-width: 767px) {
    /* The page's own legacy form: one field a row, the legal text above a full-width Submit. */
    .cap-legacy-form {
        /* The FAQ's 24px gutters. */
        width: calc(100% - 48px);
        min-height: 920px;
        padding: 16px;
    }

    .cap-legacy-form .hs-form {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 12px;
    }

    .cap-legacy-form .hs-form > fieldset:has(.legal-consent-container),
    .cap-legacy-form .hs-form > .hs_submit {
        grid-column: 1;
    }

    .cap-legacy-form .hs-form fieldset,
    .cap-legacy-form .hs-form fieldset.form-columns-2,
    .cap-legacy-form .hs-form fieldset.form-columns-3 {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .cap-legacy-form .hs-form .actions {
        text-align: left;
    }

    .cap-legacy-form .hs-form .hs-button {
        width: 100%;
    }
}
