/*
 * Heartland Forms. Colors and type follow the site's Elementor kit
 * (navy primary, gold accent, "Now"), with fallbacks.
 */
.hhf-form {
    --hhf-navy: var(--e-global-color-primary, #141f2e);
    --hhf-gold: var(--e-global-color-accent, #f2c94b);
    --hhf-cream: #fefcf2;
    --hhf-ink: #2a3442;
    --hhf-muted: #5d6877;
    --hhf-line: #d5dbe3;
    --hhf-field: #ffffff;
    --hhf-error: #b42318;
    --hhf-error-bg: #fef3f2;
    --hhf-display: var(--e-global-typography-primary-font-family, "Now"), system-ui, sans-serif;

    max-width: 720px;
    margin: 0 auto;
    color: var(--hhf-ink);
    font-size: 17px;
    line-height: 1.55;
}

.hhf-form *,
.hhf-form *::before,
.hhf-form *::after {
    box-sizing: border-box;
}

/* Intro */
.hhf-intro p {
    margin: 0 0 1em;
}
.hhf-intro .hhf-callout {
    margin: 1.5em 0 0;
    padding: 16px 20px;
    background: var(--hhf-cream);
    border-left: 4px solid var(--hhf-gold);
    border-radius: 0 6px 6px 0;
    color: var(--hhf-navy);
}

.hhf-required-note {
    margin: 28px 0 0;
    color: var(--hhf-muted);
    font-size: 15px;
}

/* Sections */
.hhf-section {
    min-width: 0;
    margin: 0;
    padding: 0 0 8px;
    border: 0;
}
.hhf-section-title {
    /* Floating the legend lets its margins work like a normal heading */
    float: left;
    display: block;
    width: 100%;
    margin: 48px 0 4px;
    padding: 0 0 12px;
    border-bottom: 2px solid var(--hhf-navy);
    color: var(--hhf-navy);
    font-family: var(--hhf-display);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
}
.hhf-section-title + * {
    clear: both;
    padding-top: 2px;
}
.hhf-section-title + .hhf-field {
    margin-top: 0;
    padding-top: 22px;
}
.hhf-section-desc {
    margin: 14px 0 0;
    color: var(--hhf-muted);
    font-size: 16px;
}

/* Fields */
.hhf-field {
    margin-top: 26px;
    scroll-margin-top: 120px;
}
.hhf-label {
    display: block;
    margin: 0 0 8px;
    color: var(--hhf-navy);
    font-family: var(--hhf-display);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
}
.hhf-optional {
    color: var(--hhf-muted);
    font-family: inherit;
    font-weight: 400;
}
.hhf-hint {
    margin: -4px 0 10px;
    color: var(--hhf-muted);
    font-size: 15px;
}
.hhf-caption {
    display: block;
    margin: 0 0 5px;
    color: var(--hhf-muted);
    font-size: 14px;
}

.hhf-form .hhf-input {
    display: block;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 12px 14px;
    border: 1.5px solid var(--hhf-line);
    border-radius: 6px;
    background: var(--hhf-field);
    color: var(--hhf-ink);
    font: inherit;
    font-size: 17px;
    line-height: 1.4;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hhf-form textarea.hhf-input {
    min-height: 120px;
    resize: vertical;
}
.hhf-form .hhf-input::placeholder {
    color: #98a2b0;
}
.hhf-form .hhf-input:hover {
    border-color: #aab4c1;
}
.hhf-form .hhf-input:focus {
    border-color: var(--hhf-navy);
    outline: none;
    box-shadow: 0 0 0 3px var(--hhf-gold);
}
.hhf-short .hhf-input {
    max-width: 200px;
}

.hhf-grid {
    display: grid;
    gap: 14px 14px;
}
.hhf-grid-2 {
    grid-template-columns: 1fr 1fr;
}
.hhf-grid-phone {
    grid-template-columns: 120px minmax(0, 1fr);
    max-width: 440px;
}
.hhf-grid-address {
    grid-template-columns: 2fr 1.4fr 1fr;
}
.hhf-span-all {
    grid-column: 1 / -1;
}

/* Choice tiles */
.hhf-choices {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.hhf-choice {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border: 1.5px solid var(--hhf-line);
    border-radius: 8px;
    background: var(--hhf-field);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.hhf-choice:hover {
    border-color: #aab4c1;
}
.hhf-choice > input[type="radio"],
.hhf-choice > input[type="checkbox"] {
    position: absolute;
    top: 50%;
    left: 16px;
    width: 22px;
    height: 22px;
    margin: -11px 0 0;
    border: 2px solid #8792a2;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.hhf-choice-other > input[type="radio"],
.hhf-choice-other > input[type="checkbox"] {
    top: 26px;
}
.hhf-choice > input[type="radio"] {
    border-radius: 50%;
}
.hhf-choice > input[type="checkbox"] {
    border-radius: 5px;
}
.hhf-choice > label {
    flex: 1 1 100%;
    margin: 0;
    padding: 13px 16px 13px 50px;
    color: var(--hhf-ink);
    font-size: 16px;
    line-height: 1.35;
    cursor: pointer;
}
.hhf-choice > input:checked {
    border-color: var(--hhf-gold);
    background: var(--hhf-gold) no-repeat center / 14px 14px;
}
.hhf-choice > input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.5l3 3 6-7' fill='none' stroke='%23141f2e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.hhf-choice > input[type="radio"]:checked {
    background-image: radial-gradient(circle, var(--hhf-navy) 0 4px, transparent 4.5px);
    background-size: auto;
}
.hhf-choice > input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--hhf-gold), 0 0 0 5px var(--hhf-navy);
}
.hhf-choice:has(> input:checked) {
    border-color: var(--hhf-navy);
    background: var(--hhf-navy);
}
.hhf-choice:has(> input:checked) > label {
    color: #fff;
}
.hhf-choice-other {
    grid-column: 1 / -1;
}
.hhf-form .hhf-choice .hhf-other {
    flex: 1 1 100%;
    min-height: 44px;
    margin: 0 12px 12px 50px;
    width: auto;
}
.hhf-choice-other:not(:has(> input:checked)) .hhf-other {
    display: none;
}

/* Errors */
.hhf-has-error .hhf-input,
.hhf-has-error .hhf-choice {
    border-color: var(--hhf-error);
}
.hhf-error {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: -2px 0 10px;
    color: var(--hhf-error);
    font-size: 15px;
    font-weight: 600;
}
.hhf-error::before {
    content: "!";
    display: inline-grid;
    place-items: center;
    flex: 0 0 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--hhf-error);
    color: #fff;
    font-size: 12px;
    line-height: 1;
}
.hhf-error-summary {
    margin: 24px 0 8px;
    padding: 18px 22px;
    border: 2px solid var(--hhf-error);
    border-radius: 8px;
    background: var(--hhf-error-bg);
}
.hhf-error-summary:focus {
    outline: 3px solid var(--hhf-gold);
}
.hhf-error-summary-title {
    margin: 0;
    color: var(--hhf-error);
    font-weight: 700;
}
.hhf-error-summary ul {
    margin: 8px 0 0;
    padding-left: 20px;
}
.hhf-error-summary a {
    color: var(--hhf-error);
    text-decoration: underline;
}

/* Back-and-resubmit with changed answers */
.hhf-resubmit-notice {
    margin: 24px 0 8px;
    padding: 18px 22px;
    border: 2px solid var(--hhf-navy);
    border-left-width: 6px;
    border-left-color: var(--hhf-gold);
    border-radius: 8px;
    background: var(--hhf-cream);
    color: var(--hhf-navy);
    font-weight: 600;
}
.hhf-resubmit-notice p {
    margin: 0;
}
.hhf-resubmit-notice:focus {
    outline: 3px solid var(--hhf-gold);
}

/* Footer */
.hhf-footer {
    margin-top: 44px;
    padding-top: 28px;
    border-top: 2px solid var(--hhf-navy);
}
.hhf-outro {
    margin-bottom: 24px;
    padding: 18px 20px;
    background: var(--hhf-cream);
    border-radius: 6px;
    font-size: 15px;
}
.hhf-outro p {
    margin: 0 0 0.75em;
}
.hhf-outro p:last-child {
    margin-bottom: 0;
}
.hhf-outro .hhf-agree-title {
    color: var(--hhf-navy);
    font-family: var(--hhf-display);
    font-size: 17px;
    font-weight: 700;
}
.hhf-form .hhf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    min-height: 56px;
    padding: 14px 36px;
    border: 2px solid var(--hhf-navy);
    border-radius: 999px;
    background: var(--hhf-navy);
    color: #fff;
    font-family: var(--hhf-display);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.hhf-form .hhf-button:hover {
    border-color: var(--hhf-navy);
    background: var(--hhf-gold);
    color: var(--hhf-navy);
}
.hhf-form .hhf-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--hhf-gold);
}

/* Confirmation */
.hhf-success {
    padding: 48px 32px;
    border-top: 4px solid var(--hhf-gold);
    border-radius: 8px;
    background: var(--hhf-cream);
    text-align: center;
}
.hhf-success:focus {
    outline: none;
}
.hhf-success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
}
.hhf-success-icon circle {
    fill: var(--hhf-navy);
}
.hhf-success-icon path {
    stroke: var(--hhf-gold);
}
.hhf-form .hhf-success-title {
    margin: 0 0 8px;
    color: var(--hhf-navy);
    font-family: var(--hhf-display);
    font-size: 28px;
    font-weight: 700;
}
.hhf-success p {
    max-width: 34em;
    margin: 0 auto;
}

/* Spam trap */
.hhf-form .hhf-hp {
    display: none !important;
}

@media (max-width: 640px) {
    .hhf-form {
        font-size: 16px;
    }
    .hhf-section-title {
        margin-top: 32px;
        font-size: 21px;
    }
    .hhf-grid-2,
    .hhf-grid-address {
        grid-template-columns: 1fr;
    }
    .hhf-choices {
        grid-template-columns: 1fr;
    }
    .hhf-form .hhf-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hhf-form * {
        transition: none !important;
    }
}

.hhf-form .hhf-button[aria-disabled="true"] {
    opacity: 0.7;
    cursor: progress;
}
