/* Opulence Home Equity: reverse mortgage calculator page with Kendall chat */

#ophe-rmc {
    --rmc-navy: #00306b;
    --rmc-navy-soft: #e6edf6;
    --rmc-gold: #c8932b;
    --rmc-gold-deep: #b5821f;
    --rmc-gold-soft: #f3e3c2;
    --rmc-ink: #14233f;
    --rmc-muted: #55627a;
    --rmc-line: #d6dde8;
    --rmc-field: #b4bfd0;
    --rmc-band: #f1f4f8;
    --rmc-log: #f7f9fc;
    --rmc-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    background: var(--rmc-band);
    color: var(--rmc-ink);
    font-size: 18px;
    line-height: 1.55;
    padding: 72px 16px 88px;
}

#ophe-rmc *,
#ophe-rmc *::before,
#ophe-rmc *::after {
    box-sizing: border-box;
}

#ophe-rmc label,
#ophe-rmc legend,
#ophe-rmc span,
#ophe-rmc p {
    text-transform: none;
    letter-spacing: normal;
}

#ophe-rmc .rmc-wrap {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

/* ── Calculator ─────────────────────────────────────────────────────── */

#ophe-rmc .rmc-calc {
    background: #fff;
    border: 1px solid var(--rmc-line);
    border-radius: 20px;
    padding: 44px 44px 40px;
}

#ophe-rmc .rmc-title {
    font-family: var(--rmc-serif);
    font-size: clamp(30px, 3.1vw, 42px);
    font-weight: 700;
    line-height: 1.12;
    color: var(--rmc-navy);
    margin: 0 0 14px;
    letter-spacing: -0.01em;
    text-transform: none;
}

#ophe-rmc .rmc-intro {
    color: var(--rmc-muted);
    max-width: 58ch;
    margin: 0 0 32px;
    font-size: 18px;
}

#ophe-rmc .rmc-form {
    display: grid;
    gap: 26px;
    margin: 0;
}

#ophe-rmc .rmc-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

#ophe-rmc .rmc-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

#ophe-rmc .rmc-field > label,
#ophe-rmc .rmc-field > legend {
    display: block;
    font-size: 17px;
    font-weight: 600;
    color: var(--rmc-ink);
    margin: 0 0 8px;
    padding: 0;
    text-transform: none;
    letter-spacing: normal;
}

#ophe-rmc input[type="text"],
#ophe-rmc select,
#ophe-rmc textarea {
    display: block;
    width: 100%;
    height: 56px;
    margin: 0;
    padding: 0 16px;
    font: inherit;
    font-size: 20px;
    color: var(--rmc-ink);
    background: #fff;
    border: 1.5px solid var(--rmc-field);
    border-radius: 12px;
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s ease;
}

#ophe-rmc input[type="text"]::placeholder,
#ophe-rmc textarea::placeholder {
    color: #9aa5b8;
}

#ophe-rmc input[type="text"]:focus,
#ophe-rmc select:focus,
#ophe-rmc textarea:focus {
    border-color: var(--rmc-navy);
    box-shadow: 0 0 0 3px rgba(0, 48, 107, .16);
}

#ophe-rmc input[type="text"]:disabled {
    background: var(--rmc-band);
    color: var(--rmc-muted);
}

#ophe-rmc select {
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2300306b' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    font-size: 18px;
}

#ophe-rmc .rmc-money {
    position: relative;
}

#ophe-rmc .rmc-money > span {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--rmc-muted);
    pointer-events: none;
}

#ophe-rmc .rmc-money input[type="text"] {
    padding-left: 34px;
    font-variant-numeric: tabular-nums;
}

#ophe-rmc .rmc-range {
    display: block;
    width: 100%;
    height: 32px;
    margin: 12px 0 0;
    padding: 0;
    accent-color: var(--rmc-gold);
    background: transparent;
    border: 0;
    cursor: pointer;
    touch-action: pan-y;
}

#ophe-rmc .rmc-range:disabled {
    opacity: .4;
    cursor: default;
}

#ophe-rmc .rmc-help {
    margin: 8px 0 0;
    font-size: 15px;
    color: var(--rmc-muted);
    min-height: 1em;
}

#ophe-rmc .rmc-help:empty {
    display: none;
}

#ophe-rmc .rmc-help.is-ok {
    color: #1d6b3e;
    font-weight: 600;
}

#ophe-rmc .rmc-help.is-ok::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 6px;
    margin: 0 8px 3px 2px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
}

#ophe-rmc .rmc-help.is-bad {
    color: #a3261c;
}

#ophe-rmc .rmc-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 0;
    font-size: 17px;
    font-weight: 500;
    color: var(--rmc-ink);
    cursor: pointer;
    text-transform: none;
}

#ophe-rmc .rmc-check input {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--rmc-navy);
}

#ophe-rmc .rmc-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1.5px solid var(--rmc-field);
    border-radius: 12px;
    overflow: hidden;
    height: 56px;
}

#ophe-rmc .rmc-seg label {
    position: relative;
    margin: 0;
    cursor: pointer;
}

#ophe-rmc .rmc-seg label + label {
    border-left: 1.5px solid var(--rmc-field);
}

#ophe-rmc .rmc-seg input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

#ophe-rmc .rmc-seg span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 18px;
    font-weight: 600;
    color: var(--rmc-ink);
    transition: background-color .15s ease, color .15s ease;
}

#ophe-rmc .rmc-seg input:checked + span {
    background: var(--rmc-navy);
    color: #fff;
}

#ophe-rmc .rmc-seg input:focus-visible + span {
    box-shadow: inset 0 0 0 3px var(--rmc-gold);
}

#ophe-rmc .rmc-error {
    margin: 0;
    color: #a3261c;
    font-weight: 600;
    font-size: 16px;
}

#ophe-rmc .rmc-error:empty {
    display: none;
}

#ophe-rmc button {
    font: inherit;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.2;
    box-shadow: none;
    min-width: 0;
    cursor: pointer;
}

#ophe-rmc .rmc-submit {
    justify-self: start;
    height: 60px;
    padding: 0 40px;
    border: 0;
    border-radius: 999px;
    background: var(--rmc-gold);
    color: var(--rmc-ink);
    font-size: 19px;
    font-weight: 700;
    transition: background-color .15s ease;
}

#ophe-rmc .rmc-submit:hover {
    background: var(--rmc-gold-deep);
}

#ophe-rmc .rmc-submit:disabled {
    opacity: .7;
    cursor: progress;
}

#ophe-rmc button:focus-visible,
#ophe-rmc a:focus-visible {
    outline: 3px solid var(--rmc-navy);
    outline-offset: 3px;
}

/* ── Results ────────────────────────────────────────────────────────── */

#ophe-rmc .rmc-results {
    margin-top: 40px;
    padding-top: 36px;
    border-top: 1px solid var(--rmc-line);
}

#ophe-rmc .rmc-results.is-updated {
    animation: rmc-updated 1.4s ease-out;
}

@keyframes rmc-updated {
    0% {
        background: var(--rmc-gold-soft);
    }
    100% {
        background: transparent;
    }
}

#ophe-rmc .rmc-program {
    margin: 0 0 18px;
    padding-left: 12px;
    border-left: 4px solid var(--rmc-gold);
    font-size: 16px;
    font-weight: 600;
    color: var(--rmc-muted);
}

#ophe-rmc .rmc-kicker {
    margin: 0 0 4px;
    font-size: 20px;
    color: var(--rmc-ink);
}

#ophe-rmc .rmc-figure {
    margin: 0 0 12px;
    font-family: var(--rmc-serif);
    font-size: clamp(38px, 4.6vw, 60px);
    font-weight: 700;
    line-height: 1.05;
    color: var(--rmc-navy);
    font-variant-numeric: lining-nums tabular-nums;
    letter-spacing: -0.015em;
}

#ophe-rmc .rmc-figure-text {
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.15;
}

#ophe-rmc .rmc-sub {
    margin: 0 0 28px;
    max-width: 60ch;
    font-size: 18px;
    line-height: 1.55;
    color: var(--rmc-ink);
}

#ophe-rmc .rmc-steps {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

#ophe-rmc .rmc-steps li {
    margin: 0;
    padding: 18px 20px 0 0;
    border-top: 5px solid var(--rmc-navy);
    position: relative;
}

#ophe-rmc .rmc-steps li:nth-child(2) {
    border-top-color: var(--rmc-gold);
}

#ophe-rmc .rmc-steps li:nth-child(3) {
    border-top-color: var(--rmc-gold-soft);
}

#ophe-rmc .rmc-steps li::before {
    content: "";
    position: absolute;
    top: -11px;
    left: 0;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--rmc-navy);
}

#ophe-rmc .rmc-steps li:nth-child(2)::before {
    border-color: var(--rmc-gold);
}

#ophe-rmc .rmc-steps li:nth-child(3)::before {
    border-color: var(--rmc-gold-soft);
}

#ophe-rmc .rmc-steps strong {
    display: block;
    font-size: 17px;
    color: var(--rmc-ink);
    margin-bottom: 4px;
}

#ophe-rmc .rmc-steps span {
    display: block;
    font-size: 16px;
    color: var(--rmc-muted);
    line-height: 1.5;
}

#ophe-rmc .rmc-how {
    margin: 0 0 28px;
    color: var(--rmc-muted);
    font-size: 16px;
}

#ophe-rmc .rmc-compare {
    margin: 0 0 24px;
}

#ophe-rmc .rmc-compare-title {
    margin: 0 0 8px;
    font-weight: 600;
    font-size: 17px;
}

#ophe-rmc .rmc-compare ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rmc-line);
}

#ophe-rmc .rmc-compare li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--rmc-line);
    font-size: 16px;
}

#ophe-rmc .rmc-compare li span:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

#ophe-rmc .rmc-compare em {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--rmc-navy-soft);
    color: var(--rmc-navy);
    font-style: normal;
    font-size: 14px;
    font-weight: 600;
}

#ophe-rmc .rmc-note {
    margin: 0 0 12px;
    padding: 12px 16px;
    background: var(--rmc-band);
    border-radius: 10px;
    font-size: 16px;
    color: var(--rmc-ink);
}

#ophe-rmc .rmc-basis {
    margin: 16px 0 24px;
    font-size: 15px;
    color: var(--rmc-muted);
}

#ophe-rmc .rmc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 24px;
    margin: 0 0 24px;
}

#ophe-rmc .rmc-talk {
    height: 52px;
    padding: 0 26px;
    border: 2px solid var(--rmc-navy);
    border-radius: 999px;
    background: #fff;
    color: var(--rmc-navy);
    font-size: 17px;
    font-weight: 700;
}

#ophe-rmc .rmc-talk:hover {
    background: var(--rmc-navy-soft);
}

#ophe-rmc .rmc-call {
    color: var(--rmc-navy);
    font-weight: 700;
    font-size: 17px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

#ophe-rmc .rmc-legal {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--rmc-muted);
}

/* ── Chat ───────────────────────────────────────────────────────────── */

#ophe-rmc .rmc-chat {
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    height: min(720px, calc(100vh - 140px));
    min-height: 520px;
    background: #fff;
    border: 1px solid var(--rmc-line);
    border-radius: 20px;
    overflow: hidden;
    scroll-margin-top: 110px;
}

#ophe-rmc .rmc-chat-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    background: var(--rmc-navy);
    color: #fff;
}

#ophe-rmc .rmc-avatar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--rmc-gold);
    color: var(--rmc-navy);
    font-family: var(--rmc-serif);
    font-size: 22px;
    font-weight: 700;
}

#ophe-rmc .rmc-chat-name {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

#ophe-rmc .rmc-chat-role {
    margin: 2px 0 0;
    font-size: 14px;
    color: #c9d6ea;
    line-height: 1.3;
}

#ophe-rmc .rmc-log {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--rmc-log);
    overscroll-behavior: contain;
}

#ophe-rmc .rmc-msg {
    max-width: 88%;
    padding: 12px 16px;
    font-size: 17px;
    line-height: 1.55;
    word-wrap: break-word;
}

#ophe-rmc .rmc-msg p {
    margin: 0 0 .6em;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

#ophe-rmc .rmc-msg p:last-child {
    margin-bottom: 0;
}

#ophe-rmc .rmc-msg-kendall {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--rmc-line);
    border-radius: 4px 16px 16px 16px;
    color: var(--rmc-ink);
}

#ophe-rmc .rmc-msg-visitor {
    align-self: flex-end;
    background: var(--rmc-navy);
    border-radius: 16px 4px 16px 16px;
    color: #fff;
}

#ophe-rmc .rmc-typing {
    display: flex;
    gap: 5px;
    padding: 16px 18px;
}

#ophe-rmc .rmc-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rmc-muted);
    animation: rmc-dot 1.2s infinite ease-in-out;
}

#ophe-rmc .rmc-typing span:nth-child(2) {
    animation-delay: .15s;
}

#ophe-rmc .rmc-typing span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes rmc-dot {
    0%, 80%, 100% {
        opacity: .25;
    }
    40% {
        opacity: 1;
    }
}

#ophe-rmc .rmc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 14px;
    background: var(--rmc-log);
}

#ophe-rmc .rmc-chips[hidden] {
    display: none;
}

#ophe-rmc .rmc-chips button {
    padding: 9px 14px;
    border: 1px solid var(--rmc-line);
    border-radius: 999px;
    background: #fff;
    color: var(--rmc-navy);
    font-size: 15px;
    font-weight: 600;
    text-align: left;
}

#ophe-rmc .rmc-chips button:hover {
    border-color: var(--rmc-navy);
}

#ophe-rmc .rmc-compose {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 0;
    padding: 14px 16px;
    border-top: 1px solid var(--rmc-line);
    background: #fff;
}

#ophe-rmc .rmc-compose textarea {
    flex: 1 1 auto;
    height: 52px;
    max-height: 140px;
    padding: 13px 14px;
    font-size: 17px;
    line-height: 1.45;
    resize: none;
}

#ophe-rmc .rmc-compose button {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--rmc-navy);
    color: #fff;
}

#ophe-rmc .rmc-compose.is-busy button {
    opacity: .5;
    cursor: progress;
}

#ophe-rmc .rmc-chat-foot {
    margin: 0;
    padding: 0 18px 14px;
    background: #fff;
    font-size: 15px;
    color: var(--rmc-muted);
}

#ophe-rmc .rmc-chat-foot a {
    color: var(--rmc-navy);
    font-weight: 700;
}

#ophe-rmc .rmc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

#ophe-rmc .rmc-jump {
    display: none;
}

/* ── Smaller screens ────────────────────────────────────────────────── */

@media (max-width: 991px) {
    #ophe-rmc {
        padding: 40px 16px 96px;
    }

    #ophe-rmc .rmc-wrap {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    #ophe-rmc .rmc-calc {
        padding: 30px 22px 28px;
    }

    #ophe-rmc .rmc-chat {
        position: relative;
        top: 0;
        height: 600px;
        min-height: 0;
        scroll-margin-top: 16px;
    }

    #ophe-rmc .rmc-jump {
        display: block;
        position: fixed;
        right: 16px;
        bottom: 16px;
        z-index: 50;
        padding: 14px 22px;
        border-radius: 999px;
        background: var(--rmc-navy);
        color: #fff;
        font-size: 17px;
        font-weight: 700;
        text-decoration: none;
        box-shadow: 0 6px 20px rgba(0, 31, 70, .28);
    }

    #ophe-rmc .rmc-jump.is-hidden {
        display: none;
    }
}

@media (max-width: 600px) {
    #ophe-rmc .rmc-row-2 {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    #ophe-rmc .rmc-submit {
        justify-self: stretch;
    }

    #ophe-rmc .rmc-steps {
        grid-template-columns: 1fr;
        gap: 0;
        padding-left: 6px;
    }

    #ophe-rmc .rmc-steps li {
        border-top: 0;
        border-left: 5px solid var(--rmc-navy);
        padding: 0 0 18px 22px;
    }

    #ophe-rmc .rmc-steps li:nth-child(2) {
        border-left-color: var(--rmc-gold);
    }

    #ophe-rmc .rmc-steps li:nth-child(3) {
        border-left-color: var(--rmc-gold-soft);
        padding-bottom: 0;
    }

    #ophe-rmc .rmc-steps li::before {
        top: 0;
        left: -11px;
    }

    #ophe-rmc .rmc-compare li {
        flex-direction: column;
        gap: 2px;
    }

    #ophe-rmc .rmc-compare li span:last-child {
        text-align: left;
    }

    #ophe-rmc .rmc-chat {
        height: 560px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #ophe-rmc .rmc-results.is-updated,
    #ophe-rmc .rmc-typing span {
        animation: none;
    }
}
