/* IFUNDA Version 44 — shared navigation, help dock and decision guide. */
:root {
    --ifunda-tools-gold: #e8bb68;
    --ifunda-tools-gold-light: #ffe4a3;
    --ifunda-tools-ink: #24140d;
    --ifunda-tools-border: rgba(255, 224, 164, .28);
    --ifunda-tools-cream: #fff5e5;
    --ifunda-tools-muted: #d8c5b2;
    --ifunda-whatsapp: #25d366;
}
.ifunda-page-tools,.ifunda-help-dock,.ifunda-guide-panel{font-family:Aptos,"Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,sans-serif}
.ifunda-page-tools {
    position: fixed;
    z-index: 82;
    top: 8.15rem;
    left: 1.55rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .38rem;
    border: 1px solid var(--ifunda-tools-border);
    border-radius: 999px;
    background: rgba(32, 18, 12, .8);
    box-shadow: 0 16px 42px rgba(0, 0, 0, .26), inset 0 1px rgba(255,255,255,.07);
    backdrop-filter: blur(16px) saturate(125%);
    -webkit-backdrop-filter: blur(16px) saturate(125%);
}

.ifunda-page-tool {
    display: inline-flex;
    min-height: 2.55rem;
    align-items: center;
    justify-content: center;
    gap: .48rem;
    padding: .58rem .82rem;
    border: 0;
    border-radius: 999px;
    color: var(--ifunda-tools-cream);
    background: transparent;
    font: inherit;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.ifunda-page-tool svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ifunda-page-tool.is-home {
    color: var(--ifunda-tools-ink);
    background: linear-gradient(145deg, #f3ce82, #d99b45);
    box-shadow: 0 7px 18px rgba(190, 119, 41, .23);
}

.ifunda-page-tool:hover,
.ifunda-page-tool:focus-visible {
    transform: translateY(-2px);
    outline: 2px solid var(--ifunda-tools-gold-light);
    outline-offset: 2px;
}

.ifunda-page-tool:not(.is-home):hover,
.ifunda-page-tool:not(.is-home):focus-visible {
    background: rgba(255,255,255,.08);
}
.ifunda-help-dock {
    position: relative;
    z-index: 4;
    display: grid;
    align-self: center;
    justify-self: center;
    justify-items: center;
    gap: .65rem;
    margin: 0 auto;
    transition: opacity 180ms ease, transform 180ms ease;
}
.ifunda-help-dock.is-suppressed{opacity:0;pointer-events:none;transform:translateY(.35rem)}
.ifunda-help-launch {
    display:inline-flex;min-height:3.45rem;align-items:center;justify-content:center;gap:.62rem;
    padding:.72rem 1rem;border:1px solid rgba(255,255,255,.15);border-radius:999px;
    color:#fff;background:linear-gradient(145deg,#6b4127,#2c180f);box-shadow:0 16px 38px rgba(0,0,0,.3),inset 0 1px rgba(255,255,255,.14);
    font:inherit;font-size:.79rem;font-weight:800;cursor:pointer;transition:transform 180ms ease,filter 180ms ease;
}
.ifunda-help-launch svg{width:1.35rem;height:1.35rem;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.ifunda-help-launch:hover,.ifunda-help-launch:focus-visible{transform:translateY(-3px);filter:brightness(1.08);outline:2px solid #fff4cd;outline-offset:3px}
.ifunda-help-menu {
    display:grid;width:min(315px,calc(100vw - 1.5rem));gap:.45rem;padding:.55rem;border:1px solid var(--ifunda-tools-border);border-radius:20px;
    background:rgba(31,17,11,.95);box-shadow:0 24px 70px rgba(0,0,0,.42),inset 0 1px rgba(255,255,255,.08);
    backdrop-filter:blur(18px) saturate(125%);-webkit-backdrop-filter:blur(18px) saturate(125%);
    position:absolute;left:50%;bottom:calc(100% + .7rem);
    opacity:0;pointer-events:none;transform:translate(-50%,.7rem) scale(.98);transform-origin:bottom center;transition:opacity 180ms ease,transform 180ms ease;
}
.ifunda-help-dock.is-open .ifunda-help-menu{opacity:1;pointer-events:auto;transform:translate(-50%,0) scale(1)}
.ifunda-help-menu>a,.ifunda-help-menu>button{display:grid;grid-template-columns:2.55rem minmax(0,1fr);align-items:center;gap:.72rem;width:100%;padding:.68rem;border:0;border-radius:14px;color:#fff5e5;background:transparent;text-align:left;text-decoration:none;font:inherit;cursor:pointer}
.ifunda-help-menu>a:hover,.ifunda-help-menu>a:focus-visible,.ifunda-help-menu>button:hover,.ifunda-help-menu>button:focus-visible{background:rgba(255,255,255,.075);outline:2px solid var(--ifunda-tools-gold-light);outline-offset:1px}
.ifunda-help-menu svg{width:1.45rem;height:1.45rem;justify-self:center;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.ifunda-help-menu a[href*="wa.me"] svg{fill:var(--ifunda-whatsapp);stroke:none}
.ifunda-help-menu span,.ifunda-help-menu strong,.ifunda-help-menu small{display:block;min-width:0}
.ifunda-help-menu strong{font-size:.82rem}.ifunda-help-menu small{margin-top:.12rem;color:#cdb9a6;font-size:.68rem;line-height:1.35}
html.ifunda-guide-open{overflow:hidden}
.ifunda-guide-panel {
    position: fixed;
    z-index: 98;
    left: 50%;
    right: auto;
    bottom: 1.15rem;
    display: grid;
    width: min(390px, calc(100vw - 2rem));
    max-height: min(690px, calc(100vh - 7rem));
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--ifunda-tools-border);
    border-radius: 26px;
    color: var(--ifunda-tools-cream);
    background:
        radial-gradient(circle at 8% 0%, rgba(240,190,94,.17), transparent 34%),
        linear-gradient(155deg, rgba(53,30,19,.97), rgba(24,13,9,.98));
    box-shadow: 0 30px 90px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.09);
    backdrop-filter: blur(22px) saturate(125%);
    -webkit-backdrop-filter: blur(22px) saturate(125%);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 1rem) scale(.97);
    transform-origin: bottom center;
    transition: opacity 220ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
}

.ifunda-guide-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
}

.ifunda-guide-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1rem .9rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.025);
}

.ifunda-guide-avatar {
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    flex: 0 0 2.7rem;
    place-items: center;
    border: 1px solid rgba(255,223,157,.28);
    border-radius: 14px;
    color: var(--ifunda-tools-gold-light);
    background: linear-gradient(145deg, rgba(120,72,39,.9), rgba(49,27,17,.96));
}

.ifunda-guide-avatar svg {
    width: 1.55rem;
    height: 1.55rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ifunda-guide-title {
    min-width: 0;
    flex: 1;
}

.ifunda-guide-title strong,
.ifunda-guide-title small {
    display: block;
}

.ifunda-guide-title strong {
    font-size: .96rem;
    letter-spacing: .03em;
}

.ifunda-guide-title small {
    margin-top: .16rem;
    color: #cbb8a6;
    font-size: .69rem;
}

.ifunda-guide-close {
    display: grid;
    width: 2.3rem;
    height: 2.3rem;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #f8ead8;
    background: rgba(255,255,255,.06);
    cursor: pointer;
}

.ifunda-guide-close svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.ifunda-guide-close:hover,
.ifunda-guide-close:focus-visible {
    background: rgba(255,255,255,.12);
    outline: 2px solid var(--ifunda-tools-gold-light);
    outline-offset: 2px;
}

.ifunda-guide-messages {
    min-height: 250px;
    padding: 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(232,187,104,.45) transparent;
}

.ifunda-guide-message {
    display: flex;
    margin-bottom: .78rem;
}

.ifunda-guide-message.is-user {
    justify-content: flex-end;
}

.ifunda-guide-bubble {
    max-width: 88%;
    padding: .78rem .9rem;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px 16px 16px 5px;
    color: #f5e8d9;
    background: rgba(255,255,255,.055);
    font-size: .84rem;
    line-height: 1.52;
}

.ifunda-guide-message.is-user .ifunda-guide-bubble {
    border-color: rgba(240,196,110,.24);
    border-radius: 16px 16px 5px 16px;
    color: #2b1a10;
    background: linear-gradient(145deg, #f1ca7b, #dca04b);
    font-weight: 680;
}

.ifunda-guide-bubble strong {
    color: #ffe3a6;
}

.ifunda-guide-message.is-user .ifunda-guide-bubble strong {
    color: inherit;
}

.ifunda-guide-actions,
.ifunda-guide-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: .42rem;
    margin-top: .72rem;
}

.ifunda-guide-chip,
.ifunda-guide-link {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    justify-content: center;
    padding: .42rem .66rem;
    border: 1px solid rgba(255,222,157,.25);
    border-radius: 999px;
    color: #ffe6b3;
    background: rgba(239,190,94,.08);
    font: inherit;
    font-size: .68rem;
    font-weight: 780;
    text-decoration: none;
    cursor: pointer;
}

.ifunda-guide-chip:hover,
.ifunda-guide-chip:focus-visible,
.ifunda-guide-link:hover,
.ifunda-guide-link:focus-visible {
    color: #2a190f;
    background: var(--ifunda-tools-gold);
    outline: 2px solid #ffe6ad;
    outline-offset: 2px;
}

.ifunda-guide-composer {
    padding: .8rem;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(16,9,6,.44);
}

.ifunda-guide-form {
    display: grid;
    grid-template-columns: minmax(0,1fr) 2.65rem;
    gap: .5rem;
}

.ifunda-guide-input {
    min-width: 0;
    min-height: 2.65rem;
    padding: .68rem .8rem;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 13px;
    color: #fff5e5;
    background: rgba(255,255,255,.055);
    font: inherit;
    font-size: .82rem;
}

.ifunda-guide-input::placeholder {
    color: #bba795;
}

.ifunda-guide-input:focus {
    border-color: rgba(247,207,130,.7);
    outline: 2px solid rgba(247,207,130,.25);
    outline-offset: 2px;
}

.ifunda-guide-send {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 13px;
    color: #2b180e;
    background: linear-gradient(145deg, #f1cc80, #d69a43);
    cursor: pointer;
}

.ifunda-guide-send svg {
    width: 1.18rem;
    height: 1.18rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ifunda-guide-send:hover,
.ifunda-guide-send:focus-visible {
    outline: 2px solid #fff0c2;
    outline-offset: 2px;
}

.ifunda-guide-disclaimer {
    margin: .55rem .15rem 0;
    color: #aa9787;
    font-size: .62rem;
    line-height: 1.4;
}

.ifunda-guide-typing {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    min-height: 1rem;
}

.ifunda-guide-typing i {
    width: .35rem;
    height: .35rem;
    border-radius: 50%;
    background: #e5bb6b;
    animation: ifunda-guide-dot 900ms infinite ease-in-out;
}

.ifunda-guide-typing i:nth-child(2) { animation-delay: 120ms; }
.ifunda-guide-typing i:nth-child(3) { animation-delay: 240ms; }

@keyframes ifunda-guide-dot {
    0%, 70%, 100% { opacity: .35; transform: translateY(0); }
    35% { opacity: 1; transform: translateY(-3px); }
}

/* Version 45 — place the Help dock inside the footer instead of over page links. */
.site-footer.ifunda-help-footer,
.legal-footer.ifunda-help-footer {
    overflow: visible;
}
.site-footer.ifunda-help-footer.is-help-open,
.legal-footer.ifunda-help-footer.is-help-open {
    position: relative;
    z-index: 97;
}
.footer-inner.ifunda-has-help {
    grid-template-columns: auto minmax(220px, 1fr) auto auto;
    gap: clamp(14px, 1.7vw, 26px);
    padding-right: 34px;
}
.footer-inner.ifunda-has-help .ifunda-help-dock {
    grid-column: 3;
    grid-row: 1;
}
.footer-inner.ifunda-has-help .footer-links {
    grid-column: 4;
    grid-row: 1;
}
.legal-footer .legal-container.ifunda-has-help {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto minmax(260px, 1fr);
    align-items: center;
    gap: 22px;
}
.legal-footer .legal-container.ifunda-has-help > p { justify-self: start; }
.legal-footer .legal-container.ifunda-has-help > .ifunda-help-dock { justify-self: center; }
.legal-footer .legal-container.ifunda-has-help > nav { justify-self: end; }

@media (max-width: 1040px) {
    .footer-inner.ifunda-has-help {
        min-height: 126px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding-right: 28px;
    }
    .footer-inner.ifunda-has-help .ifunda-help-dock { grid-column: 3; grid-row: 1; }
    .footer-inner.ifunda-has-help .footer-links {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: center;
        margin-top: -2px;
        padding-left: 0;
    }
}

@media (max-width: 760px) {
    .legal-footer .legal-container.ifunda-has-help {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
    .legal-footer .legal-container.ifunda-has-help > p,
    .legal-footer .legal-container.ifunda-has-help > nav { justify-self: center; }
    .legal-footer .legal-container.ifunda-has-help > nav { justify-content: center; }
}

@media (max-width: 640px) {
    .footer-inner.ifunda-has-help {
        min-height: 154px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 8px 10px;
        padding: 12px 14px 10px;
    }
    .footer-inner.ifunda-has-help .footer-copy { text-align: center; }
    .footer-inner.ifunda-has-help .ifunda-help-dock { grid-column: 3; grid-row: 1; }
    .footer-inner.ifunda-has-help .footer-links {
        grid-column: 1 / -1;
        grid-row: 2;
        gap: 5px 12px;
        justify-content: center;
        margin-top: 0;
        padding: 0;
    }
}

.ifunda-tools-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
@media (max-width:900px){.ifunda-page-tools{top:6.7rem;left:.75rem}}
@media (max-width:620px){
    .ifunda-page-tools{top:6.8rem;left:.55rem;gap:.25rem;padding:.28rem}
    .ifunda-page-tool{width:2.55rem;min-height:2.55rem;padding:.55rem}
    .ifunda-page-tool span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
    .legal-body .ifunda-page-tools{top:auto;bottom:.75rem}
    .ifunda-help-launch{min-height:2.85rem;padding:.55rem .78rem;font-size:.72rem}
    .ifunda-help-launch svg{width:1.15rem;height:1.15rem}
    .ifunda-help-menu{width:min(305px,calc(100vw - 1.25rem))}
    .ifunda-guide-panel{left:50%;right:auto;bottom:.65rem;width:calc(100vw - 1.1rem);max-height:min(650px,calc(100vh - 2rem));border-radius:22px}
}
@media (max-height:650px) and (min-width:621px){.ifunda-guide-panel{max-height:calc(100vh - 2rem);bottom:1rem}}
@media (prefers-reduced-motion:reduce){.ifunda-page-tool,.ifunda-help-launch,.ifunda-help-menu,.ifunda-guide-panel,.ifunda-guide-typing i{animation:none!important;transition:none!important}}
