/* Regional loan marketplace landing page. Loaded only when the loan marketplace feature is on. */
.mkt {
    --mkt-width: 1160px;
    --mkt-gutter: clamp(16px, 4vw, 32px);
    --mkt-radius: 16px;
    --mkt-hero-ink: #f8fbff;
    --mkt-hero-muted: rgba(226, 236, 248, 0.82);
    --mkt-hero-line: rgba(148, 190, 235, 0.22);
    --mkt-warm: #e8692c;
    --mkt-warm-hover: #d1561c;
    --mkt-warm-text: #ffffff;
    --mkt-tint: color-mix(in srgb, var(--theme-brand-soft, #eaf4ff) 55%, var(--theme-bg-page, #f0f4f8));
    --mkt-card: var(--theme-bg-elevated, #ffffff);
    --mkt-card-line: var(--theme-border, #e5eaf0);
    --mkt-kicker: var(--theme-brand, #0d47a1);
    background: var(--theme-bg-page, #f0f4f8);
    color: var(--theme-text-primary, #172033);
}

:root[data-theme="dark"] .mkt {
    --mkt-warm: #ff9a65;
    --mkt-warm-hover: #ffb18a;
    --mkt-warm-text: #281006;
    --mkt-tint: var(--theme-bg-inset, #111b29);
    --mkt-card: var(--theme-bg-panel, #162131);
}

.mkt h1,
.mkt h2,
.mkt h3 {
    padding: 0;
    letter-spacing: -0.01em;
}

/* Hero */
.mkt-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(56px, 9vw, 104px) var(--mkt-gutter) 0;
    background:
        radial-gradient(60% 70% at 85% 10%, rgba(117, 186, 255, 0.22), transparent 70%),
        radial-gradient(45% 60% at 0% 100%, rgba(232, 105, 44, 0.16), transparent 70%),
        linear-gradient(160deg, #0b1a33 0%, #0e2547 55%, #0a1730 100%);
    color: var(--mkt-hero-ink);
}

.mkt-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
    width: min(var(--mkt-width), 100%);
    margin: 0 auto;
}

.mkt-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid var(--mkt-hero-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--mkt-hero-ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mkt-eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mkt-warm);
    box-shadow: 0 0 0 4px rgba(232, 105, 44, 0.22);
}

.mkt-hero h1 {
    margin: 20px 0 18px;
    color: var(--mkt-hero-ink);
    font-size: clamp(34px, 5.2vw, 58px);
    font-weight: 700;
    line-height: 1.06;
}

.mkt-hero__lead {
    max-width: 600px;
    color: var(--mkt-hero-muted);
    font-size: clamp(17px, 1.6vw, 19px);
    line-height: 1.6;
}

.mkt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.mkt-actions--center {
    justify-content: center;
}

.mkt .mkt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 12px 26px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.mkt .mkt-btn--primary {
    background: var(--mkt-warm);
    color: var(--mkt-warm-text);
    box-shadow: 0 10px 24px rgba(232, 105, 44, 0.28);
}

.mkt .mkt-btn--primary:hover {
    background: var(--mkt-warm-hover);
    color: var(--mkt-warm-text);
    transform: translateY(-1px);
}

.mkt .mkt-btn--ghost {
    border-color: rgba(226, 236, 248, 0.38);
    background: rgba(255, 255, 255, 0.06);
    color: var(--mkt-hero-ink);
}

.mkt .mkt-btn--ghost:hover {
    border-color: rgba(226, 236, 248, 0.7);
    background: rgba(255, 255, 255, 0.12);
    color: var(--mkt-hero-ink);
}

.mkt .mkt-btn:focus-visible {
    outline: 3px solid #8ec5ff;
    outline-offset: 3px;
}

.mkt-hero__markets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.mkt-hero__markets li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 8px;
    border: 1px solid var(--mkt-hero-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--mkt-hero-ink);
    font-size: 14px;
    font-weight: 500;
}

.mkt-hero__markets img,
.mkt-market img {
    display: block;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16);
}

/* Illustrative comparison card: shapes only, never figures, because lenders set the terms. */
.mkt-compare {
    margin: 0;
    padding: 20px;
    border: 1px solid var(--mkt-hero-line);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
    box-shadow: 0 30px 60px rgba(2, 8, 23, 0.45);
}

.mkt-compare__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 4px 16px;
    color: var(--mkt-hero-ink);
    font-size: 15px;
}

.mkt-compare__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18);
}

.mkt-compare__pill {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(142, 197, 255, 0.16);
    color: #cfe6ff;
    font-size: 12px;
    font-weight: 600;
}

.mkt-compare__list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mkt-compare__offer {
    padding: 14px 16px;
    border: 1px solid rgba(148, 190, 235, 0.16);
    border-radius: 14px;
    background: rgba(8, 20, 40, 0.55);
}

.mkt-compare__offer.is-chosen {
    border-color: rgba(255, 154, 101, 0.6);
    background: rgba(8, 20, 40, 0.75);
    box-shadow: inset 0 0 0 1px rgba(255, 154, 101, 0.25);
}

.mkt-compare__lender {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--mkt-hero-ink);
    font-size: 14px;
}

.mkt-compare__avatar {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(142, 197, 255, 0.18);
    color: #cfe6ff;
    font-size: 13px;
    font-weight: 700;
}

.mkt-compare__chosen {
    margin-left: auto;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(255, 154, 101, 0.18);
    color: #ffc6a8;
    font-size: 12px;
    font-weight: 600;
}

.mkt-compare__terms {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 0;
}

.mkt-compare__terms dt {
    color: rgba(226, 236, 248, 0.62);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mkt-compare__terms dd {
    margin: 6px 0 0;
}

.mkt-bar {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(142, 197, 255, 0.75), rgba(142, 197, 255, 0.3));
}

.mkt-bar--1 { width: 92%; }
.mkt-bar--2 { width: 70%; }
.mkt-bar--3 { width: 52%; }

.mkt-compare figcaption {
    margin-top: 14px;
    color: rgba(226, 236, 248, 0.66);
    font-size: 13px;
    line-height: 1.5;
}

.mkt-assurances {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(var(--mkt-width), 100%);
    margin: clamp(48px, 7vw, 80px) auto 0;
    padding: 0;
    border-top: 1px solid var(--mkt-hero-line);
    list-style: none;
}

.mkt-assurances li {
    display: grid;
    gap: 4px;
    padding: 24px 20px 28px 0;
}

.mkt-assurances li + li {
    padding-left: 20px;
    border-left: 1px solid var(--mkt-hero-line);
}

.mkt-assurances strong {
    color: var(--mkt-hero-ink);
    font-size: 15px;
}

.mkt-assurances span {
    color: var(--mkt-hero-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Sections */
.mkt-section {
    padding: clamp(56px, 8vw, 96px) var(--mkt-gutter);
    scroll-margin-top: 96px;
}

.mkt-section--tinted {
    background: var(--mkt-tint);
}

.mkt-section > *,
.mkt-split {
    width: min(var(--mkt-width), 100%);
    margin-left: auto;
    margin-right: auto;
}

.mkt-section__head {
    max-width: 720px;
    margin-bottom: clamp(32px, 4vw, 48px);
    text-align: center;
}

.mkt-section > .mkt-section__head {
    max-width: 720px;
}

.mkt-section__head--start {
    margin: 0;
    text-align: left;
}

.mkt-kicker {
    margin-bottom: 10px;
    color: var(--mkt-kicker);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mkt-section h2 {
    color: var(--theme-text-primary, #172033);
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 700;
    line-height: 1.15;
}

.mkt-section__head p:not(.mkt-kicker) {
    margin-top: 14px;
    color: var(--theme-text-muted, #5b6b7f);
    font-size: 17px;
    line-height: 1.6;
}

.mkt-section h3 {
    color: var(--theme-text-primary, #172033);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.mkt-split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(32px, 6vw, 80px);
    align-items: start;
}

/* Markets */
.mkt-markets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 0;
    padding: 0;
    list-style: none;
}

.mkt-market {
    display: grid;
    gap: 6px;
    padding: 24px;
    border: 1px solid var(--mkt-card-line);
    border-radius: var(--mkt-radius);
    background: var(--mkt-card);
    box-shadow: var(--theme-shadow-sm, 0 1px 3px rgba(15, 39, 71, 0.08));
}

.mkt-market img {
    margin-bottom: 10px;
}

.mkt-market strong {
    font-size: 19px;
    font-weight: 600;
}

.mkt-market span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--theme-success, #166534);
    font-size: 14px;
    font-weight: 500;
}

.mkt-market span::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

/* Steps */
.mkt-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.mkt-step {
    position: relative;
    padding: 28px 24px;
    border: 1px solid var(--mkt-card-line);
    border-radius: var(--mkt-radius);
    background: var(--mkt-card);
    box-shadow: var(--theme-shadow-sm, 0 1px 3px rgba(15, 39, 71, 0.08));
}

.mkt-step__number {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 18px;
    border-radius: 12px;
    background: var(--theme-brand-soft, #eaf4ff);
    color: var(--theme-brand, #0d47a1);
    font-size: 17px;
    font-weight: 700;
}

.mkt-step p,
.mkt-feature p {
    margin-top: 8px;
    color: var(--theme-text-muted, #5b6b7f);
    font-size: 15px;
    line-height: 1.6;
}

/* Why compare */
.mkt-features {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mkt-feature {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 18px;
    padding: 22px 24px;
    border: 1px solid var(--mkt-card-line);
    border-radius: var(--mkt-radius);
    background: var(--mkt-card);
}

.mkt-feature__icon {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--theme-brand-soft, #eaf4ff);
    color: var(--theme-brand, #0d47a1);
}

.mkt-feature__icon svg,
.mkt-security__icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* What you need */
.mkt-checklist-card {
    padding: clamp(24px, 3vw, 32px);
    border: 1px solid var(--mkt-card-line);
    border-radius: 20px;
    background: var(--mkt-card);
    box-shadow: var(--theme-shadow, 0 16px 38px rgba(15, 39, 71, 0.14));
}

.mkt-checklist {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mkt-checklist li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--theme-divider, #edf0f4);
}

.mkt-checklist li:first-child {
    padding-top: 0;
}

.mkt-checklist li::before {
    content: "";
    grid-row: span 2;
    width: 24px;
    height: 24px;
    margin-top: 1px;
    border-radius: 50%;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 12.5 3.2 3.2L17 9'/%3E%3C/svg%3E") center / 16px no-repeat,
        var(--theme-success, #166534);
}

/* The dark-theme success colour is light, so the check mark turns dark to keep its contrast. */
:root[data-theme="dark"] .mkt-checklist li::before {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306241a' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 12.5 3.2 3.2L17 9'/%3E%3C/svg%3E") center / 16px no-repeat,
        var(--theme-success, #4ade80);
}

.mkt-checklist strong {
    font-size: 16px;
    font-weight: 600;
}

.mkt-checklist span {
    color: var(--theme-text-muted, #5b6b7f);
    font-size: 15px;
    line-height: 1.5;
}

.mkt-checklist-card__note {
    margin-top: 18px;
    color: var(--theme-text-muted, #5b6b7f);
    font-size: 14px;
    line-height: 1.55;
}

/* Security */
.mkt-security {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(32px, 5vw, 64px);
    padding: clamp(28px, 5vw, 56px);
    border-radius: 24px;
    background:
        radial-gradient(60% 80% at 100% 0%, rgba(117, 186, 255, 0.16), transparent 70%),
        linear-gradient(160deg, #0b1a33, #0e2547);
    color: var(--mkt-hero-ink);
}

.mkt-security__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 20px;
    border-radius: 14px;
    background: rgba(74, 222, 128, 0.14);
    color: #86efac;
}

.mkt-security .mkt-kicker {
    color: #8ec5ff;
}

.mkt-security h2 {
    color: var(--mkt-hero-ink);
}

.mkt-security__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mkt-security__list li {
    display: grid;
    align-content: start;
    gap: 6px;
    padding-top: 16px;
    border-top: 1px solid var(--mkt-hero-line);
}

.mkt-security__list strong {
    color: var(--mkt-hero-ink);
    font-size: 16px;
}

.mkt-security__list span {
    color: var(--mkt-hero-muted);
    font-size: 15px;
    line-height: 1.6;
}

/* FAQ */
.mkt-faq {
    display: grid;
    gap: 12px;
    max-width: 820px;
}

.mkt-faq details {
    border: 1px solid var(--mkt-card-line);
    border-radius: 14px;
    background: var(--mkt-card);
}

.mkt-faq summary {
    position: relative;
    padding: 20px 56px 20px 24px;
    color: var(--theme-text-primary, #172033);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    list-style: none;
    cursor: pointer;
}

.mkt-faq summary::-webkit-details-marker {
    display: none;
}

.mkt-faq summary::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 24px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--theme-text-muted, #5b6b7f);
    border-bottom: 2px solid var(--theme-text-muted, #5b6b7f);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.2s ease;
}

.mkt-faq details[open] summary::after {
    transform: translateY(-30%) rotate(-135deg);
}

.mkt-faq summary:focus-visible {
    border-radius: 14px;
    outline: 3px solid var(--theme-focus, #155eef);
    outline-offset: 2px;
}

.mkt-faq details p {
    padding: 0 24px 22px;
    color: var(--theme-text-muted, #5b6b7f);
    font-size: 16px;
    line-height: 1.65;
}

/* Closing call to action */
.mkt-cta {
    padding: 0 var(--mkt-gutter) clamp(56px, 8vw, 96px);
    background: var(--mkt-tint);
}

.mkt-cta__inner {
    width: min(var(--mkt-width), 100%);
    margin: 0 auto;
    padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 64px);
    border-radius: 24px;
    background:
        radial-gradient(50% 90% at 100% 100%, rgba(232, 105, 44, 0.22), transparent 70%),
        radial-gradient(50% 90% at 0% 0%, rgba(117, 186, 255, 0.2), transparent 70%),
        linear-gradient(160deg, #0b1a33, #0e2547);
    text-align: center;
}

.mkt-cta h2 {
    color: var(--mkt-hero-ink);
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 700;
    line-height: 1.15;
}

.mkt-cta p {
    margin-top: 12px;
    color: var(--mkt-hero-muted);
    font-size: 17px;
}

.mkt-cta .mkt-actions {
    margin-top: 28px;
}

@media (prefers-reduced-motion: reduce) {
    .mkt .mkt-btn,
    .mkt-faq summary::after {
        transition: none;
    }
}

@media (max-width: 1024px) {
    .mkt-hero__inner,
    .mkt-split,
    .mkt-security {
        grid-template-columns: 1fr;
    }

    .mkt-compare {
        max-width: 560px;
    }

    .mkt-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mkt-assurances {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mkt-assurances li:nth-child(odd) {
        padding-left: 0;
        border-left: 0;
    }

    .mkt-assurances li:nth-child(n + 3) {
        border-top: 1px solid var(--mkt-hero-line);
    }
}

@media (max-width: 640px) {
    .mkt-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .mkt-steps,
    .mkt-security__list,
    .mkt-assurances {
        grid-template-columns: 1fr;
    }

    .mkt-assurances li,
    .mkt-assurances li + li {
        padding: 18px 0;
        border-left: 0;
    }

    .mkt-assurances li + li {
        border-top: 1px solid var(--mkt-hero-line);
    }

    .mkt-markets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .mkt-market {
        padding: 18px;
    }

    .mkt-compare {
        padding: 14px;
    }

    .mkt-compare__terms {
        gap: 8px;
    }

    .mkt-feature {
        grid-template-columns: 1fr;
        row-gap: 12px;
    }

    .mkt-feature__icon {
        grid-row: auto;
    }

    .mkt-faq summary {
        padding: 18px 48px 18px 18px;
        font-size: 16px;
    }

    .mkt-faq details p {
        padding: 0 18px 18px;
    }
}
