:root {
    --color-blue-light: #0099cc;
    --color-blue: #00529b;
    --color-blue-dark: #00294e;
    --color-white: #fff;
    --color-black: #05050f;
    --color-red-light: #d4554a;
    --color-red: #ff0000;
    --color-cream: #f9f8f5;

    --color-text: var(--color-black);
    --color-text-muted: #292b2c;
    --color-border: #ccc;

    --color-error: var(--color-red);
    --color-success: #258656;

    --font-sans: "Roboto", system-ui, sans-serif;
    --font-serif: Georgia;
    --font-display: "yorkten-slab-normal", sans-serif;

    --leading-none: 1;
    --leading-xs: 1.15;
    --leading-sm: 1.4;
    --leading: 1.6;

    --spacing: 0.25rem;
    --header-height: 4rem;
    --progress-bar-height: 6px;
    --anchor-offset: calc(var(--header-height) + 1.5rem);

    --1fr: minmax(0, 1fr);

    --wrapper-xs: 40rem;
    --wrapper-sm: 50rem;
    --wrapper: 68rem;
    --wrapper-article: 58rem;

    --radius-xs: 0.25rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.625rem;
    --radius-xl: 0.75rem;
    --radius-pill: 9999px;

    --shadow-lg: 0 3px 6px rgb(3 7 18 / 0.04), 0 10px 24px rgb(3 7 18 / 0.08);

    --z-below: -1;
    --z-above: 100;
    --z-header: 500;

    --ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
    --ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    --ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22);
    --ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    --ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035);
    --ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335);
    --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
    --ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
    --ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-out-circ: cubic-bezier(0.075, 0.82, 0.165, 1);
    --ease-in-out-quad: cubic-bezier(0.455, 0.03, 0.515, 0.955);
    --ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1);
    --ease-in-out-quart: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-in-out-quint: cubic-bezier(0.86, 0, 0.07, 1);
    --ease-in-out-expo: cubic-bezier(1, 0, 0, 1);
    --ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.15, 0.86);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    overflow-x: hidden;
    position: relative;
    font-size: 100%;
    scroll-padding-top: var(--anchor-offset);
}

a {
    color: inherit;
}

.page {
    position: relative;
}

.wrapper {
    position: relative;
    width: 100%;
    max-width: var(--wrapper);
    margin-inline: auto;
    padding-inline: 1rem;
}

.icon {
    color: var(--icon-color, inherit);
    display: flex;
    flex-shrink: 0;
}

.list {
    --list-gap: calc(var(--spacing) * 2);
    display: flex;
    flex-direction: column;
    gap: var(--list-gap, 0);
    padding-inline-start: 1em;

    li {
        line-height: var(--leading-none);

        &::marker {
            color: var(--list-bullet-color, inherit);
        }
    }

    &.bullet-square {
        list-style-type: square;
    }
}

.copyright {
    font-size: 14px;
    font-family: var(--font-sans);
    font-style: italic;
}

/**
 * ------------------------------------------
 * prose
 * ------------------------------------------
 **/
.prose {
    --flow-gap: calc(var(--spacing) * 6);
    --list-gap: calc(var(--spacing) * 3);
    --prose-hr-color: var(--color-border);
    --prose-heading-color: var(--color-text);
    --prose-body-color: var(--color-text-muted);
    --prose-bold-color: var(--color-text);

    font-size: 1rem;
    line-height: var(--leading);
    font-family: var(--prose-font, inherit);
    color: var(--prose-body-color);

    /* default flow gap */
    :where(:not(.not-prose, .not-prose *)) + :where(:not(.not-prose, .not-prose *)) {
        margin-top: var(--flow-gap);
    }

    /* lists */
    :where(ul, ol):not(.not-prose, .not-prose *) {
        padding-left: calc(var(--spacing) * 6);
        /*list-style-type: square;*/
    }

    :where(ul li, ol li):not(.not-prose, .not-prose *) {
        padding-left: calc(var(--spacing) * 3);
    }

    :where(ul.no-gap, ol.no-gap):not(.not-prose, .not-prose *) {
        --list-gap: 0;
    }

    :where(ol li):not(.not-prose, .not-prose *) {
        &::marker {
            font-weight: 700;
        }
    }

    :where(ul li + li, ol li + li):not(.not-prose, .not-prose *) {
        margin-top: var(--list-gap);
    }

    /* divider */
    hr:where(:not(.not-prose, .not-prose *)) {
        margin-block: calc(var(--spacing) * 10);
        border-color: var(--prose-hr-color);
        height: 0;
        border-width: 0;
        border-top-width: 1px;
    }

    /* headings */
    :is(h1, h2, h3, h4, h5) {
        font-family: var(--font-display);
        color: var(--prose-heading-color);
    }

    h2 {
        --prose-heading-color: var(--color-blue);
        font-size: clamp(22px, 4vw, 36px);
        line-height: var(--leading-xs);
        font-weight: 900;
        text-wrap: pretty;
        margin-top: calc(var(--spacing) * 6);
        margin-bottom: calc(var(--spacing) * 5);
    }

    h3 {
        font-size: clamp(20px, 3vw, 28px);
        line-height: var(--leading-xs);
        font-weight: 900;
        text-wrap: pretty;
        margin-top: calc(var(--spacing) * 6);
        margin-bottom: calc(var(--spacing) * 5);
    }

    h4 {
        font-size: clamp(18px, 3vw, 24px);
        line-height: var(--leading-xs);
        font-weight: 900;
        text-wrap: pretty;
        margin-top: calc(var(--spacing) * 4);
        margin-bottom: calc(var(--spacing) * 3);
    }

    ul,
    ol {
        font-family: var(--font-sans);
    }

    strong {
        color: var(--prose-bold-color);
        font-weight: 700;
    }

    /* table */
    table {
        --list-gap: calc(var(--spacing) * 1);
        margin-block: calc(var(--spacing) * 4);
        border-radius: var(--radius-lg);
        overflow: hidden;
        border: 1px solid var(--color-border);
        width: 100%;
        table-layout: auto;
        font-size: 0.875rem;
        line-height: var(--leading-sm);
        font-family: var(--font-sans);
        text-align: left;
        color: var(--prose-body-color);
        border-collapse: separate;
        border-spacing: 0;
    }

    thead {
        background-color: #f0f0f0;

        th {
            padding-inline: calc(var(--spacing) * 4);
            padding-block: calc(var(--spacing) * 2);
            font-weight: 600;
            color: var(--prose-heading-color);
            border-bottom: 1px solid var(--color-border);
            text-transform: uppercase;
            font-size: 0.75rem;
        }
    }

    tbody {
        td,
        th {
            border-top: 1px solid var(--color-border);
            padding-inline: calc(var(--spacing) * 4);
            padding-block: calc(var(--spacing) * 2);
            vertical-align: top;
        }
    }

    tr {
        &:first-child td,
        &:first-child th {
            border-top-width: 0;
        }

        & > td:not(:first-child),
        & > th:not(:first-child) {
            border-left: 1px solid var(--color-border);
        }
    }
}

/**
 * ------------------------------------------
 * components
 * ------------------------------------------
 **/
.button {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    text-transform: var(--button-text-transform, none);
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: 999px;
    background-color: var(--button-bg, var(--color-blue));
    color: var(--button-fg, var(--color-white));
    padding-inline: var(--button-padding-x, 32px);
    height: var(--button-height, 48px);
    width: var(--button-width, fit-content);
    outline: none;
    box-shadow: none;
    border: none;
    transition: background-color 0.2s var(--ease-out-cubic);

    &:hover {
        background-color: color-mix(
            in lch,
            var(--button-bg, var(--color-blue)),
            var(--color-black) 10%
        );
    }

    &.type-success {
        --button-bg: var(--color-success);
    }
    &.type-white {
        --button-fg: var(--color-blue);
        --button-bg: var(--color-white);
    }
    &.type-outline {
        --button-bg: var(--color-blue);
        --button-fg: var(--color-blue);
        background-color: transparent;
        border: 1.5px solid var(--button-border, var(--button-bg));
    }

    &.size-small {
        font-size: 12px;
        --button-height: 32px;
        --button-padding-x: 14px;
    }
}

/**
 * ------------------------------------------
 * other
 * ------------------------------------------
 **/
.adv-modal {
    border: none;
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    width: 100dvw;
    height: 100dvh;
    background: transparent;
}

.adv-modal:not([open]) {
    display: none;
}

.adv-modal[open] {
    display: grid;
    place-items: center;
    padding: 16px;
}

.adv-modal::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.adv-modal-content {
    width: min(90vw, 520px);
    max-width: 520px;
    background: #fff;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    display: grid;
    gap: 12px;
}

.adv-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.adv-modal-header p {
    margin: 0;
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 18px;
}

.adv-modal-close {
    appearance: none;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.adv-modal-body {
    display: grid;
    gap: 12px;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
}

.adv-modal-body [data-variant] {
    display: none;
}

.adv-modal[data-state="mortgage"] .adv-modal-body [data-variant="mortgage"] {
    display: grid;
    gap: 12px;
}

.adv-modal[data-state="credit"] .adv-modal-body [data-variant="credit"] {
    display: grid;
    gap: 12px;
}

.star-rating {
    --rating: 0;
    --star-size: 16px;
    --star-gap: 2px;
    --star-empty: #d1d5db;
    --star-fill: var(--color-blue);
    position: relative;
    display: inline-block;
    font-size: var(--star-size);
    line-height: 1;
    color: var(--star-empty);
    letter-spacing: var(--star-gap);
    font-family: var(--font-sans);

    &::before {
        content: "★★★★★";
    }

    &::after {
        content: "★★★★★";
        position: absolute;
        left: 0;
        top: 0;
        width: calc(clamp(0, var(--rating), 5) / 5 * 100%);
        color: var(--star-fill);
        overflow: hidden;
        white-space: nowrap;
    }

    &.type-success {
        --star-fill: var(--color-success);
    }
}

.star-rating-value {
    margin-left: 6px;
    font-weight: 600;
    color: var(--color-text);
    font-size: 14px;
}

.star-rating-wrapper {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
}

.accordion-group {
    position: relative;
    border-top: 1px solid var(--color-border);
}

.accordion-item {
    --accordion-space: calc(var(--spacing) * 4);
    font-family: var(--font-sans);
    border-bottom: 1px solid var(--color-border);

    .accordion-title {
        padding-block: var(--accordion-space);
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 32px;
        cursor: pointer;
        font-size: clamp(18px, 3vw, 22px);
        font-weight: 700;
        line-height: var(--leading-xs);
        text-wrap: pretty;

        @media (min-width: 768px) {
            --accordion-space: calc(var(--spacing) * 6);
        }

        /* disable default marker */
        &::marker {
            content: "";
        }

        /* custom marker */
        &::after {
            content: "";
            background-image: url("data:image/svg+xml,%3Csvg%20width%3D'24'%20height%3D'24'%20viewBox%3D'0%200%2024%2024'%20xmlns%3D'http%3A//www.w3.org/2000/svg'%3E%3Cpath%20fill%3D'none'%20stroke%3D'currentColor'%20stroke-width%3D'2'%20d%3D'm2%208.35l10.173%209.823L21.997%208'/%3E%3C/svg%3E");
            height: 14px;
            width: 14px;
            background-repeat: no-repeat;
            background-size: contain;
            background-position: center;
            transition: transform 150ms ease;
            flex-shrink: 0;
        }
    }

    /* state: open */
    &[open] > .accordion-title::after {
        transform: rotate(180deg);
    }

    .accordion-content {
        padding-bottom: var(--accordion-space);
    }
}

.adv-disclaimer {
    display: flex;
    color: var(--color-white);

    button {
        appearance: none;
        padding: 0;
        color: inherit;
        background-color: transparent;
        border: none;
        text-decoration: underline;
        font-size: 12px;
        cursor: pointer;
    }

    a {
        color: inherit;
        text-decoration: underline;
        font-size: 12px;
    }
}

@media (max-width: 1024px) {
    .desktop-only {
        display: none;
    }
}

#frequently-asked-questions + .accordion-group .accordion-content > *:not(:last-child) {
    margin-bottom: 1rem;
}
