/*
* Demo Request Hero Block
* Request a Demo redesign (brighthire-demo-html handoff). Also the shared base for the
* Demo Thank You Block: fonts, logo-only header, purple hero with line pattern and fade.
*/

/*
 * DM Sans, self-hosted and scoped to these blocks: the Google Fonts variable file (weights 100-1000 and the
 * optical-size axis), as the design loads it. The optical size makes large headings narrower, which is what
 * keeps "See BrightHire in action" on one line. Latin subset, SIL OFL - see fonts/LICENSE-dm-sans.txt.
 */
@font-face {
    font-family: "BrightHire Demo DM Sans";
    src: url("fonts/dm-sans-latin-variable.woff2") format("woff2");
    font-weight: 100 1000;
    font-style: normal;
    font-display: swap;
}

/* The blocks bring their own logo-only header: hide the site header/footer (body class from extra-functions.php) */
body.bh-demo-focus {
    padding-top: 0 !important;
}
.bh-demo-focus header.navbar,
.bh-demo-focus footer.footer-sec,
.bh-demo-focus .top-bar {
    display: none !important;
}

.bh-demo {
    --bh-purple: #4E2BCD;
    --bh-navy: #081528;
    --bh-teal: #28E7C5;
    --bh-teal-hover: #7CF1DA;
    --bh-off-white: #F8F9FB;
    --bh-button-text: #2A2079;
    --bh-font: "BrightHire Demo DM Sans", "DM Sans", "Helvetica Neue", Arial, sans-serif;
    --bh-gutter: clamp(20px, 4.5vw, 64px);
    --bh-pill-bg: rgba(248, 249, 251, .10);
    --bh-pill-border: rgba(248, 249, 251, .30);
    --bh-focus-ring: 0 0 0 3px rgba(40, 231, 197, .36);
    position: relative;
    background: #fff;
    font-family: var(--bh-font);
    font-optical-sizing: auto;
    color: var(--bh-navy);
}
.bh-demo *,
.bh-demo *::before,
.bh-demo *::after {
    box-sizing: border-box;
}
/* wpautop leftovers around the spliced form embed */
.bh-demo__form > br,
.bh-demo__form > p > br,
.bh-demo__form > p:empty {
    display: none;
}
.bh-demo__form > p {
    margin: 0;
}

/* Hero: gradient + line pattern (from 162px above the top, at least 810px tall) + 101px fade to white */
.bh-demo__hero {
    --bh-demo-pattern: url("demo-lines-pattern.svg");
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 680px;
    background: linear-gradient(191deg, var(--bh-purple) 10%, var(--bh-navy) 103%);
    color: var(--bh-off-white);
}
.bh-demo__hero::before {
    content: "";
    position: absolute;
    top: -162px;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 810px;
    background: var(--bh-demo-pattern) center top / cover no-repeat;
    pointer-events: none;
}
.bh-demo__hero::after {
    content: "";
    position: absolute;
    z-index: 1;
    right: 0;
    bottom: 0;
    left: 0;
    height: 101px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 100%);
    pointer-events: none;
}

/*
 * Request a Demo: as in the design, the hero fills the screen above the logo strip and centres the form
 * vertically (design strip height: the 1440x268 artwork scaled to the width, 200px on mobile).
 */
.bh-demo--request .bh-demo__hero {
    min-height: max(680px, calc(100vh - min(268px, 18.6111vw)));
}
@media (max-width: 600px) {
    .bh-demo--request .bh-demo__hero {
        min-height: max(680px, calc(100vh - 200px));
    }
}

.bh-demo__header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1312px;
    margin: 0 auto;
    padding: 20px var(--bh-gutter);
}
.bh-demo__logo {
    display: inline-flex;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    text-decoration: none;
}
.bh-demo__logo:hover {
    color: #fff;
}
.bh-demo__logo img {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
}
.bh-demo__logo:focus-visible {
    outline: 2px solid var(--bh-teal);
    outline-offset: 4px;
    border-radius: 4px;
}

.bh-demo__main {
    position: relative;
    z-index: 2;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px clamp(20px, 4vw, 48px) 150px;
}
.bh-demo__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    width: 100%;
    max-width: 600px;
}
.bh-demo__intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}
.bh-demo .bh-demo__title {
    margin: 0;
    font-family: var(--bh-font);
    font-size: clamp(2.25rem, 4.5vw, 3.5rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--bh-off-white);
}
.bh-demo .bh-demo__title span {
    color: var(--bh-teal);
}
.bh-demo .bh-demo__desc {
    max-width: 520px;
    margin: 0;
    font-family: var(--bh-font);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
    color: var(--bh-off-white);
}
.bh-demo .bh-demo__desc strong,
.bh-demo .bh-demo__desc b {
    font-weight: 700;
    white-space: nowrap;
}
.bh-demo .bh-demo__desc a {
    color: var(--bh-teal);
}
.bh-demo .bh-demo__desc a:hover {
    color: var(--bh-teal-hover);
}

/* Frosted form panel */
.bh-demo__panel {
    width: 100%;
    padding: clamp(24px, 3.5vw, 40px);
    background: linear-gradient(125.56deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .06) 100%);
    border: 1px solid rgba(248, 249, 251, .16);
    border-radius: 24px;
    -webkit-backdrop-filter: blur(32px);
    backdrop-filter: blur(32px);
    box-shadow: 0 7px 20px -5px rgba(0, 0, 0, .04);
}
.bh-demo__panel-heading {
    margin: 0 0 20px;
    font-family: var(--bh-font);
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    color: var(--bh-off-white);
}

/*
 * HubSpot form (rendered by the embed, so the markup is HubSpot's). HubSpot injects its own
 * stylesheet after ours, hence the extra specificity throughout.
 */
.bh-demo .bh-demo__form .hs-form,
.bh-demo .bh-demo__form form {
    margin: 0;
    font-family: var(--bh-font);
}
.bh-demo .bh-demo__form .hs-form fieldset {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
}
.bh-demo .bh-demo__form .hs-form fieldset.form-columns-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    column-gap: 12px;
}
/* A textarea next to a pill looks unbalanced: stack that row */
.bh-demo .bh-demo__form .hs-form fieldset.form-columns-2:has(textarea) {
    grid-template-columns: 1fr;
}
.bh-demo .bh-demo__form .hs-form fieldset .hs-form-field,
.bh-demo .bh-demo__form .hs-form fieldset.form-columns-2 .hs-form-field {
    float: none;
    width: auto;
    margin: 0 0 12px;
    padding: 0;
}
/* HubSpot form shortening hides First/Last name until an email is typed: no empty row meanwhile */
.bh-demo .bh-demo__form .hs-form fieldset .hs-form-field:has(.hs-input[style*="display: none"]) {
    margin: 0;
}
.bh-demo .bh-demo__form .hs-form fieldset .input {
    position: relative;
    margin: 0;
}
/* Labels are visually hidden (the placeholder carries them) but stay for screen readers */
.bh-demo .bh-demo__form .hs-form .hs-form-field > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.bh-demo .bh-demo__form .hs-form .hs-form-field .hs-field-desc {
    margin: 0 0 6px 20px;
    font-size: 14px;
    color: var(--bh-off-white);
}

/* Field pills */
.bh-demo .bh-demo__form .hs-form input.hs-input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.bh-demo .bh-demo__form .hs-form select.hs-input,
.bh-demo .bh-demo__form .hs-form textarea.hs-input {
    display: block;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 20px;
    background: var(--bh-pill-bg);
    border: 1px solid var(--bh-pill-border);
    border-radius: 280px;
    box-shadow: none;
    outline: none;
    font-family: var(--bh-font);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
    color: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.bh-demo .bh-demo__form .hs-form textarea.hs-input {
    height: 120px;
    padding: 14px 20px;
    border-radius: 24px;
    resize: vertical;
}
.bh-demo .bh-demo__form .hs-form .hs-input::placeholder {
    color: #fff;
    opacity: 1;
}
/* Same :not() chain as the pill rule, otherwise the pill's border/box-shadow win over :focus */
.bh-demo .bh-demo__form .hs-form .hs-input.invalid.error:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    border-color: #FFB4AB;
}
.bh-demo .bh-demo__form .hs-form input.hs-input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.bh-demo .bh-demo__form .hs-form select.hs-input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.bh-demo .bh-demo__form .hs-form textarea.hs-input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus {
    border-color: var(--bh-teal);
    box-shadow: var(--bh-focus-ring);
}
/* Browser autofill would paint the pill yellow/white */
.bh-demo .bh-demo__form .hs-form input.hs-input:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 100px #3a2a9a inset;
    caret-color: #fff;
}

/* Dropdown: native select, white chevron 20px from the right, options in navy on white */
.bh-demo .bh-demo__form .hs-form select.hs-input {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 48px;
    cursor: pointer;
    text-overflow: ellipsis;
}
.bh-demo .bh-demo__form .hs-form select.hs-input option {
    color: var(--bh-navy);
    background: #fff;
}
/* The theme draws its own grey arrow (down-arrow.svg) on .input::before */
.bh-demo .bh-demo__form .hs-form .hs-fieldtype-select .input::before {
    display: none;
}
.bh-demo .bh-demo__form .hs-form .hs-fieldtype-select .input::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 23px;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    border-radius: 1px;
    transform: rotate(45deg);
    pointer-events: none;
}

/* Checkboxes / consent text, if the HubSpot form ever adds them */
.bh-demo .bh-demo__form .hs-form .inputs-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.bh-demo .bh-demo__form .hs-form .hs-richtext,
.bh-demo .bh-demo__form .hs-form .legal-consent-container,
.bh-demo .bh-demo__form .hs-form .inputs-list label {
    font-size: 14px;
    line-height: 1.5;
    color: var(--bh-off-white);
}
.bh-demo .bh-demo__form .hs-form .hs-richtext a,
.bh-demo .bh-demo__form .hs-form .legal-consent-container a {
    color: var(--bh-teal);
}

/* Validation */
.bh-demo .bh-demo__form .hs-form ul.hs-error-msgs {
    margin: 6px 0 0;
    padding: 0 0 0 20px;
    list-style: none;
}
.bh-demo .bh-demo__form .hs-form ul.hs-error-msgs label,
.bh-demo .bh-demo__form .hs-form ul.hs-error-msgs li {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    margin: 0;
    font-family: var(--bh-font);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: #FFB4AB;
}
.bh-demo .bh-demo__form .hs-form .hs_error_rollup {
    display: none;
}

/* Submit: own row, full width */
.bh-demo .bh-demo__form .hs-form .hs_submit,
.bh-demo .bh-demo__form .hs-form .hs_submit .actions {
    margin: 0;
    padding: 0;
}
.bh-demo .bh-demo__form .hs-form .hs_submit {
    margin-top: 4px;
}
/* main.css / theme-common.css set .hs-submit input[type="submit"] to position: absolute site-wide */
.bh-demo .bh-demo__form .hs-form .hs_submit input.hs-button,
.bh-demo .bh-demo__form .hs-form input[type="submit"] {
    position: static;
    display: block;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 40px;
    background: var(--bh-teal);
    border: 0;
    border-radius: 80px;
    box-shadow: none;
    font-family: var(--bh-font);
    font-size: 1rem;
    font-weight: 600;
    line-height: 52px;
    letter-spacing: 0;
    text-align: center;
    color: var(--bh-button-text);
    cursor: pointer;
    transition: background-color .15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.bh-demo .bh-demo__form .hs-form .hs_submit input.hs-button:hover,
.bh-demo .bh-demo__form .hs-form input[type="submit"]:hover {
    background: var(--bh-teal-hover);
    color: var(--bh-button-text);
}
.bh-demo .bh-demo__form .hs-form .hs_submit input.hs-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(248, 249, 251, .6);
}

/* Inline thank-you message after submit */
.bh-demo .bh-demo__form .submitted-message {
    font-family: var(--bh-font);
    font-size: 1.125rem;
    line-height: 1.5;
    text-align: center;
    color: var(--bh-off-white);
}
.bh-demo .bh-demo__form .submitted-message p {
    margin: 0;
}
