/* ASSAN 5.1 components and SABIZ theme tokens; all additions are page-scoped. */
.heloc-page {
    --heloc-ink: #1b1b21;
    --heloc-accent: #835712;
    --heloc-soft: #f5eddb;
    --heloc-cream: #faf8f2;
    color: var(--heloc-ink);
    background: #fff;
    font-family: var(--bs-body-font-family);
}

.heloc-page * {
    box-sizing: border-box;
}

.heloc-page h1,.heloc-page h2,.heloc-page h3 {
    color: inherit;
    letter-spacing: normal;
    line-height: 1.15;
}

.heloc-page h1 {
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 400;
    margin: 0 0 20px;
}

.heloc-page h2 {
    font-size: clamp(1.9rem, 2.8vw, 2.7rem);
    font-weight: 400;
    margin: 0 0 24px;
}

.heloc-page h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.heloc-page p {
    line-height: 1.8;
}

.heloc-wrap {
    position: relative;
}

.heloc-section {
    padding: 88px 0;
}

.heloc-eyebrow {
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: .72rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Hero and application illustration */
.heloc-hero {
    background: #f3f3f3;
    padding: 135px 0 48px;
    overflow: hidden;
}

.heloc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.heloc-page .heloc-brand {
    display: inline-flex;
    gap: .6rem;
    align-items: center;
    font-weight: 600;
    letter-spacing: .12em;
    font-size: .8rem;
}

.heloc-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.heloc-hero h1 em {
    color: var(--heloc-accent);
    font-style: normal;
}

.heloc-partner {
    font-size: .84rem;
    max-width: 450px;
}

.heloc-checks {
    padding: 0;
    list-style: none;
    margin: 1.5rem 0;
}

.heloc-checks li {
    padding: .5rem 0 .5rem 1.8rem;
    position: relative;
    line-height: 1.65;
    font-size: .94rem;
}

.heloc-checks li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--heloc-accent);
    font-weight: bold;
}

.heloc-page .heloc-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    min-height: 54px;
    padding: 14px 30px;
    text-transform: none;
    font-size: 1rem;
    font-weight: 500;
    white-space: normal;
}

.heloc-page .heloc-cta:hover {
    background: #35353f;
    color: white;
}

.heloc-page a:focus-visible,.heloc-page summary:focus-visible {
    outline: 3px solid #cb9b51;
    outline-offset: 5px;
}

.heloc-small {
    font-size: .75rem;
    line-height: 1.7!important;
    margin-top: 14px;
}

.heloc-page sup a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0 2px;
}

.heloc-visual {
    position: relative;
    padding: 15px 48px 0;
    isolation: isolate;
}

.heloc-phone {
    position: relative;
    background: #fff;
    border: 9px solid #202126;
    border-radius: 45px 45px 12px 12px;
    padding: 22px 24px;
    max-width: 330px;
    margin: auto;
    box-shadow: 0 0 0 3px #afb1b3, 0 20px 35px #00000012;
}

.heloc-notch {
    height: 8px;
    width: 70px;
    background: #1b1b21;
    margin: -8px auto 28px;
    border-radius: 8px;
}

.heloc-phone-brand {
    font-size: .72rem;
    letter-spacing: .16em;
    font-weight: 600;
    border-bottom: 1px solid #eaeaef;
    padding-bottom: 16px;
}

.heloc-phone h3 {
    margin: 22px 0 8px;
    font-size: 1.7rem;
}

.heloc-phone p {
    font-size: .82rem;
}

.heloc-phone-step {
    display: flex;
    gap: 12px;
    align-items: center;
    border-top: 1px solid #eaeaef;
    padding: 15px 0;
    font-size: .77rem;
}

.heloc-phone-step span:first-child {
    background: var(--heloc-soft);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: none;
}

.heloc-visual-tag {
    position: absolute;
    right: -12px;
    bottom: 48px;
    background: #1b1b21;
    color: white;
    border-radius: 14px;
    padding: 18px 24px;
    font-size: .83rem;
    box-shadow: 0 10px 25px #1b1b2120;
}

/* Partner statistics */




.heloc-source {
    font-size: .68rem;
    text-align: center;
    color: #5c5d6f;
    margin: 18px 0 0;
}

.heloc-intro {
    max-width: 730px;
    margin: 0 auto 42px;
    text-align: center;
}

/* Benefits */
.heloc-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 40px;
}

.heloc-card {
    padding: 0;
    border: 0;
    background: transparent;
}

.heloc-card p {
    font-size: .95rem;
    margin-bottom: 0;
}

.heloc-icon {
    font-size: 2.4rem;
    margin-bottom: 24px;
    color: #1b1b21;
}

.heloc-center {
    text-align: center;
    margin-top: 35px;
}

.heloc-tint {
    background: var(--heloc-cream);
}

/* Product comparison: Four-column layout in SABIZ's palette. */
.heloc-comparison {
    background: #f3f3f3;
}

.heloc-table-wrap {
    max-width: 980px;
    margin: 0 auto;
    overflow-x: auto;
    border-radius: 24px;
}

.heloc-table {
    width: 100%;
    min-width: 720px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    font-size: .95rem;
    line-height: 1.7;
}

.heloc-table th,
.heloc-table td {
    width: 25%;
    padding: 20px 18px;
    border-bottom: 1px solid #cbd0d4;
    border-right: 1px solid #e1e4e7;
    vertical-align: middle;
    text-align: center;
}

.heloc-table thead th {
    background: #e2e7eb;
    font-weight: 600;
}

.heloc-table tbody th {
    text-align: left;
    font-weight: 400;
}

.heloc-table tr > :nth-child(2) {
    background: #1b1b21;
    color: #fff;
    border-color: #69696b;
}

.heloc-table thead th:nth-child(2) {
    border-radius: 24px 24px 0 0;
    color: #f6e27a;
}

.heloc-table tr:last-child > * {
    border-bottom: 0;
}

.heloc-table-notes {
    max-width: 980px;
    margin: 20px auto 0;
    font-size: .75rem;
}

.heloc-table-notes a {
    color: inherit;
    text-decoration: underline;
}

/* Loan uses */
.heloc-uses {
    display: block;
    max-width: 780px;
    margin: auto;
    text-align: center;
}

.heloc-use {
    border-top: 2px solid #cb9b51;
    padding: 24px 8px 0;
}

.heloc-use span {
    font-size: .75rem;
    color: var(--heloc-accent);
}

.heloc-use h3 {
    margin-top: 20px;
    font-size: 1.15rem;
}

.heloc-use p {
    font-size: .8rem;
}

/* FAQs and disclosures */

.heloc-final {
    background: #f3f3f3;
    padding: 0 0 70px;
}

.heloc-final p {
    margin: 0;
}

.heloc-disclosures {
    padding: 48px 0 60px;
    color: #5c5d6f;
    font-size: .75rem;
}

.heloc-disclosures h2 {
    font-size: 1.3rem;
    letter-spacing: -.02em;
}

.heloc-disclosures li {
    padding: 6px 0;
    line-height: 1.8;
    scroll-margin-top: 130px;
}

.heloc-disclosures a {
    color: #835712;
    text-decoration: underline;
}

@media(max-width:991px) {
    .heloc-grid {
        gap: 32px;
    }
    .heloc-hero {
        padding-top: 145px;
    }
    .heloc-visual {
        padding: 25px 14px;
    }
    .heloc-cards {
        grid-template-columns: repeat(2,1fr);
    }
    .heloc-uses {
        grid-template-columns: repeat(3,1fr);
    }
}

@media(max-width:767px) {
    .heloc-grid {
        grid-template-columns: 1fr;
    }
    .heloc-hero {
        padding-top: 135px;
    }
    .heloc-visual {
        margin: 12px 10px 0;
        min-height: 440px;
    }
    .heloc-visual-tag {
        right: -8px;
    }
    .heloc-section {
        padding: 56px 0;
    }
    .heloc-cards {
        gap: 14px;
    }
    .heloc-card {
        padding: 22px 17px;
    }
    .heloc-card h3 {
        font-size: 1.1rem;
    }
    .heloc-uses {
        grid-template-columns: repeat(2,1fr);
    }
    .heloc-page .heloc-cta {
        font-size: .85rem;
        padding: 16px 20px;
    }
}

@media(prefers-reduced-motion:reduce) {
    .heloc-page * {
        scroll-behavior: auto!important;
        transition: none!important;
    }
}

/* Equity estimator: two vertical controls, following the reference layout. */
.heloc-calculator {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    align-items: start;
}

.heloc-chart-instruction {
    font-size: .85rem;
    color: var(--bs-secondary);
    margin-bottom: 24px;
}

.heloc-chart {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.heloc-column {
    position: relative;
    height: 470px;
    border: 1px solid var(--bs-gray-300);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.heloc-column-fill {
    position: absolute;
    inset: auto 0 0;
    height: calc(77px + (100% - 104px) * var(--heloc-ratio));
    border-radius: 12px 12px 0 0;
    background: #e7d2a9;
    pointer-events: none;
}

.heloc-field:nth-child(2) .heloc-column-fill {
    background: #d7d7dd;
}

.heloc-slider-value {
    position: absolute;
    bottom: calc(23px + (100% - 104px) * var(--heloc-ratio) / 2);
    left: 0;
    width: 100%;
    text-align: center;
    font-size: clamp(1.2rem, 2.2vw, 1.9rem);
    font-weight: 500;
    color: var(--heloc-ink);
    pointer-events: none;
}

.heloc-column-max {
    position: absolute;
    top: 10px;
    width: 100%;
    text-align: center;
    color: var(--bs-gray-600);
    font-size: .7rem;
    pointer-events: none;
}

/* Override ASSAN's horizontal form-range dimensions only within this chart.
   Native vertical ranges retain pointer, touch and arrow-key behavior. */
.heloc-column .heloc-range {
    position: absolute;
    inset: 0 auto 50px calc(50% - 27px);
    width: 54px;
    height: calc(100% - 50px);
    margin: 0;
    padding: 0;
    writing-mode: vertical-lr;
    direction: rtl;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: ns-resize;
}

.heloc-column .heloc-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 100%;
    background: transparent;
    border: 0;
}

/* Large, round handles make the drag affordance visible, for touch and pointer input. */
.heloc-column .heloc-range::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 54px;
    height: 54px;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='54' height='54' viewBox='0 0 54 54'%3E%3Ccircle cx='27' cy='27' r='26' fill='white'/%3E%3Cpath d='M20 21l7-6 7 6M18 27h18M20 33l7 6 7-6' fill='none' stroke='%23835712' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    box-shadow: 0 3px 14px #1b1b2114;
}

.heloc-column .heloc-range::-moz-range-track {
    width: 100%;
    height: 100%;
    background: transparent;
    border: 0;
}

.heloc-column .heloc-range::-moz-range-thumb {
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 50%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='54' height='54' viewBox='0 0 54 54'%3E%3Ccircle cx='27' cy='27' r='26' fill='white'/%3E%3Cpath d='M20 21l7-6 7 6M18 27h18M20 33l7 6 7-6' fill='none' stroke='%23835712' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    box-shadow: 0 3px 14px #1b1b2114;
}

.heloc-column:focus-within {
    outline: 3px solid #835712;
    outline-offset: 4px;
}

.heloc-field .form-label {
    display: block;
    margin: 18px 0 12px;
    font-size: .9rem;
    min-height: 3em;
}

.heloc-field .form-control {
    min-width: 0;
    font-variant-numeric: tabular-nums;
}

.heloc-estimate {
    border-top: 1px solid var(--bs-gray-300);
    padding-top: 26px;
    margin-top: 26px;
}

.heloc-estimate output {
    display: block;
    font-family: var(--bs-font-serif);
    font-size: clamp(3.5rem, 5vw, 5rem);
    line-height: 1.1;
    color: var(--heloc-ink);
    margin: 12px 0 20px;
}

.heloc-estimate #heloc-assumption {
    font-size: .82rem;
}

@media (max-width: 991px) {
    .heloc-calculator {
        gap: 32px;
    }
    .heloc-column {
        height: 340px;
    }
}

@media (max-width: 767px) {
    .heloc-calculator {
        grid-template-columns: minmax(0, 1fr);
    }
    .heloc-calculator-copy {
        grid-row: 1;
    }
    .heloc-chart {
        gap: 14px;
    }
    .heloc-slider-value {
        font-size: 1.5rem;
    }
}

/* Reference section composition, with local Bootstrap carousel components. */
.heloc-hero .language-selector {
    margin-bottom: 24px;
}
.heloc-brand {
    margin-bottom: 16px;
}
.heloc-hero-actions {
    display: flex;
    align-items: end;
    gap: 16px;
    margin-top: 28px;
}
.heloc-purpose {
    position: relative;
    flex: 1;
    min-width: 0;
}
.heloc-purpose label {
    position: absolute;
    top: -10px;
    left: 22px;
    background: #f3f3f3;
    padding: 0 5px;
    font-size: .75rem;
}
.heloc-purpose select {
    border-radius: 40px;
    min-height: 54px;
    padding-left: 24px;
    font-size: .85rem;
}
.heloc-hero-actions .heloc-cta {
    flex: 1;
}
.heloc-visual::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 34% 0 25px;
    border-radius: 22px;
    background: linear-gradient(125deg, #292931, #b18a46 65%, #f5e7cb);
}
.heloc-visual-badge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 230px;
    padding: 15px 20px;
    border-radius: 10px;
    background: #e8d6b0;
    box-shadow: 0 8px 18px #00000018;
    font-size: .85rem;
    line-height: 1.4;
}
.heloc-visual-badge i {
    font-size: 1.7rem;
}
.heloc-badge-online {
    right: 0;
    top: 80px;
}
.heloc-badge-support {
    right: -8px;
    top: 57%;
}
.heloc-badge-redraw {
    left: 0;
    bottom: 0;
}
.heloc-phone-amount {
    background: #f5f5f5;
    padding: 16px;
    margin: 22px 0;
    border-radius: 8px;
}
.heloc-phone-amount strong {
    display: block;
    font-size: 1.7rem;
}
.heloc-phone-amount small {
    font-size: .65rem;
}
.heloc-phone-track {
    height: 4px;
    background: #b18a46;
    margin-top: 16px;
    position: relative;
}
.heloc-phone-track::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 40%;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid #835712;
}
.heloc-benefits .heloc-intro {
    text-align: left;
    margin-left: 0;
    max-width: 100%;
}
.heloc-benefits .heloc-eyebrow, .heloc-use-section .heloc-eyebrow, .heloc-faq-section .heloc-eyebrow {
    display: none;
}
.heloc-benefits .heloc-center .heloc-cta, .heloc-use-section .heloc-center .heloc-cta {
    min-width: min(380px, 100%);
}
.heloc-use-section, .heloc-faq-section {
    background: #f3f3f3;
}
.heloc-carousel-controls {
    display: flex;
    justify-content: center;
    padding: 20px 0 0;
}
.heloc-page .carousel-control-prev, .heloc-page .carousel-control-next {
    width: 48px;
    color: #1b1b21;
    font-size: 3rem;
    opacity: 1;
    border: 0;
    background: transparent;
}
.heloc-page .carousel-control-prev:hover,
.heloc-page .carousel-control-prev:focus,
.heloc-page .carousel-control-next:hover,
.heloc-page .carousel-control-next:focus {
    color: #1b1b21;
}

.heloc-page .carousel-indicators {

    position: static;

    margin: 0;

    gap: 6px;

}
.heloc-page .carousel-indicators button {
    width: 25px;
    height: 4px;
    background-color: #1b1b21;
    border: 0;
    border-radius: 3px;
    padding: 0;
    margin: 8px 0;
}
.heloc-page .carousel button:focus-visible {
    outline: 3px solid #835712;
    outline-offset: 5px;
}
.heloc-uses .carousel-item {
    padding: 0 65px;
}
.heloc-uses img {
    display: block;
    width: min(440px, 100%);
    height: 340px;
    object-fit: contain;
    margin: 0 auto 32px;
}
.heloc-uses h3 {
    font-size: 1.55rem;
    margin: 20px 0;
}
.heloc-uses p {
    max-width: 550px;
    margin: auto;
    min-height: 80px;
}
.heloc-use-section {
    padding-top: 50px;
}
.heloc-final-panel {
    border-radius: 20px;
    padding: 56px;
    color: white;
    background: linear-gradient(115deg, #1b1b21, #504024 75%, #835712);
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px 60px;
    align-items: center;
}
.heloc-final-panel > .heloc-eyebrow {
    grid-column: 1 / -1;
}
.heloc-final-panel h2 {
    margin: 0;
}
.heloc-final-panel > p:not(.heloc-eyebrow) {
    grid-column: 1;
}
.heloc-final-panel > .heloc-cta {
    grid-column: 2;
    grid-row: 2 / 4;
    background: white;
    color: #1b1b21;
}
.heloc-sticky-apply {
    position: fixed;
    z-index: 1030;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 10px 20px max(10px, env(safe-area-inset-bottom));
    background: #1b1b21;
    color: white;
    font-size: .85rem;
    box-shadow: 0 -2px 16px #00000015;
}
.heloc-sticky-apply[hidden] {
    display: none;
}
.heloc-sticky-apply .heloc-cta {
    min-height: 40px;
    padding: 8px 24px;
    background: #e8d6b0;
    color: #1b1b21;
    font-size: .85rem;
}
/* Keep the shared back-to-top control above the application bar. */
body:has(.heloc-page) .toTop {
    bottom: 90px;
}

body:has(.heloc-page) {
    padding-bottom: 70px;
}
.heloc-page section[id] {
    scroll-margin-top: 110px;
}
@media (max-width: 991px) {
    .heloc-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .heloc-visual {
        padding: 25px 20px;
    }
    .heloc-visual-badge {
        font-size: .7rem;
        padding: 12px;
        max-width: 180px;
    }
    .heloc-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .heloc-final-panel {
        padding: 32px;
        gap: 20px;
    }
}
@media (max-width: 767px) {
    .heloc-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .heloc-hero-actions {
        flex-direction: row;
    }
    .heloc-visual {
        max-width: 480px;
        margin: 25px auto 0;
        width: 100%;
    }
    .heloc-uses .carousel-item {
        padding: 0 35px;
    }
    .heloc-uses img {
        height: 260px;
    }
    .heloc-final-panel {
        grid-template-columns: minmax(0, 1fr);
    }
    .heloc-final-panel > * {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
    .heloc-sticky-apply {
        gap: 12px;
        font-size: .75rem;
    }
    .heloc-sticky-apply .heloc-cta {
        font-size: .75rem;
        padding: 8px 16px;
    }
}

/* Partner proof is explicitly separated from SABIZ/PRMG achievements. */
.heloc-proof {
    padding: 30px 0 45px;
    background: #f3f3f3;
    text-align: center;
}
.heloc-proof-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
    align-items: center;
    margin: 22px 0;
}
.heloc-proof-grid strong {
    display: block;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: #835712;
}
.heloc-proof-grid span {
    display: block;
    font-size: .85rem;
}
.heloc-partner-award img {
    width: 112px;
    height: auto;
    margin-bottom: 12px;
}
.heloc-partner-award span {
    font-size: .7rem;
}
.heloc-calculator-copy > p {
    margin-bottom: 28px;
}
.heloc-estimate #heloc-assumption {
    margin-top: 20px;
}
.heloc-final-panel > h2 {
    grid-column: 1;
}
.heloc-final-panel > .heloc-cta {
    grid-column: 2;
    grid-row: 1 / 3;
}
.heloc-sticky-apply .heloc-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
@media (max-width: 767px) {
    .heloc-proof-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 16px;
    }
}

/* Media strip; attribution is in the lending-partner disclosure. */
.heloc-press {
    background: #e2e7eb;
    text-align: center;
    padding: 28px 0;
}
.heloc-press p {
    font-size: .85rem;
    margin-bottom: 18px;
}
.heloc-press-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 28px 40px;
    opacity: .7;
}
.heloc-press-logos img {
    max-width: 170px;
    width: auto;
    height: 24px;
}
.heloc-press-wordmark {
    font-weight: 600;
    font-size: 1.25rem;
}
