:root {
    --fvm-primary: #0f766e;
    --fvm-secondary: #1d4ed8;
    --fvm-accent: #f59e0b;
    --fvm-ink: #162033;
    --fvm-muted: #667085;
    --fvm-soft: #f4f7fb;
    --fvm-line: #d9e2ef;
    --fvm-radius: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--fvm-ink);
    background: #fff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--fvm-primary);
}

.btn {
    border-radius: var(--fvm-radius);
    font-weight: 700;
}

.btn-primary {
    --bs-btn-bg: var(--fvm-primary);
    --bs-btn-border-color: var(--fvm-primary);
    --bs-btn-hover-bg: #0b5f59;
    --bs-btn-hover-border-color: #0b5f59;
}

.btn-outline-primary {
    --bs-btn-color: var(--fvm-primary);
    --bs-btn-border-color: var(--fvm-primary);
    --bs-btn-hover-bg: var(--fvm-primary);
    --bs-btn-hover-border-color: var(--fvm-primary);
}

.site-navbar {
    border-bottom: 1px solid rgba(15, 118, 110, .12);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
}

.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--fvm-primary), var(--fvm-secondary));
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 900;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.hero-section {
    background:
        linear-gradient(90deg, rgba(8, 28, 45, .88), rgba(8, 28, 45, .62) 46%, rgba(8, 28, 45, .12)),
        var(--hero-image, none),
        radial-gradient(circle at 78% 22%, rgba(245, 158, 11, .18), transparent 28%),
        #0b1f2f;
    background-position: center;
    background-size: cover;
    border-bottom: 1px solid var(--fvm-line);
    color: #fff;
    overflow: hidden;
    position: relative;
}

.hero-section .text-secondary,
.hero-section .lead {
    color: rgba(255, 255, 255, .82) !important;
}

.hero-section .glass-panel {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .24);
    color: #fff;
}

.hero-section .glass-panel .text-secondary {
    color: rgba(255, 255, 255, .72) !important;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 4rem);
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.05;
}

.section-band {
    background: var(--fvm-soft);
}

.feature-card,
.metric-card,
.auth-card,
.dashboard-card {
    border: 1px solid var(--fvm-line);
    border-radius: var(--fvm-radius);
    box-shadow: 0 14px 36px rgba(22, 32, 51, .06);
    transition: transform .18s ease, box-shadow .18s ease;
}

.feature-card {
    height: 100%;
}

.feature-card:hover,
.dashboard-card:hover {
    box-shadow: 0 20px 46px rgba(22, 32, 51, .1);
    transform: translateY(-2px);
}

.glass-panel {
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: var(--fvm-radius);
    box-shadow: 0 22px 60px rgba(22, 32, 51, .12);
    backdrop-filter: blur(16px);
}

.simulator-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.9)),
        #fff;
    border: 1px solid rgba(15, 118, 110, .16);
    border-radius: var(--fvm-radius);
    box-shadow: 0 24px 70px rgba(15, 118, 110, .15);
    color: var(--fvm-ink);
}

.hero-section .simulator-card,
.hero-section .simulator-card h1,
.hero-section .simulator-card h2,
.hero-section .simulator-card h3,
.hero-section .simulator-card h4,
.hero-section .simulator-card h5,
.hero-section .simulator-card h6,
.hero-section .simulator-card p,
.hero-section .simulator-card label,
.hero-section .simulator-card span,
.hero-section .simulator-card strong,
.hero-section .simulator-card small,
.hero-section .simulator-card .form-label,
.hero-section .simulator-card .small {
    color: var(--fvm-ink);
}

.simulator-card .text-secondary {
    color: var(--fvm-muted) !important;
}

.simulator-card .form-label,
.simulator-card .small,
.simulator-card span {
    color: var(--fvm-ink);
}

.simulator-card .form-label {
    display: block;
    margin-bottom: .55rem;
}

.simulator-card .form-range {
    display: block;
    margin-bottom: .45rem;
}

.simulator-card .form-select {
    background-color: #fff;
    border-color: var(--fvm-line);
    color: var(--fvm-ink);
}

.simulator-card .simulator-value {
    background: linear-gradient(135deg, rgba(15, 118, 110, .1), rgba(29, 78, 216, .08));
    border: 1px solid rgba(15, 118, 110, .14);
    border-radius: var(--fvm-radius);
    box-shadow: 0 16px 42px rgba(22, 32, 51, .08);
    min-height: 118px;
}

.simulator-card .simulator-value span,
.simulator-card .simulator-value strong {
    color: var(--fvm-ink);
}

.simulator-card .simulator-value .d-flex {
    gap: 1rem;
    min-height: 28px;
}

.simulator-card .simulator-value strong {
    font-size: 1.08rem;
    text-align: right;
}

.hero-section .simulator-card .glass-panel {
    background: linear-gradient(135deg, rgba(15, 118, 110, .1), rgba(29, 78, 216, .08));
    border-color: rgba(15, 118, 110, .14);
    color: var(--fvm-ink);
}

.trust-strip {
    background: #fff;
    border-bottom: 1px solid var(--fvm-line);
}

.trust-item {
    align-items: center;
    display: flex;
    gap: .75rem;
}

.trust-item i {
    color: var(--fvm-primary);
    font-size: 1.4rem;
}

.icon-pill {
    align-items: center;
    background: rgba(15, 118, 110, .1);
    border-radius: 8px;
    color: var(--fvm-primary);
    display: inline-flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.admin-chart-shell {
    min-height: 260px;
}

.mobile-action-bar {
    background: rgba(255,255,255,.94);
    border-top: 1px solid var(--fvm-line);
    bottom: 0;
    box-shadow: 0 -10px 30px rgba(22, 32, 51, .08);
    left: 0;
    padding: .65rem;
    position: sticky;
    right: 0;
    z-index: 10;
}

.install-banner {
    background: #fff;
    border: 1px solid var(--fvm-line);
    border-radius: var(--fvm-radius);
    box-shadow: 0 18px 50px rgba(22, 32, 51, .12);
    bottom: 86px;
    display: none;
    left: 16px;
    max-width: 380px;
    padding: 1rem;
    position: fixed;
    right: 16px;
    z-index: 1060;
}

.install-banner.show {
    display: block;
}

.offline-page {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .16), rgba(29, 78, 216, .12)),
        #f8fbff;
    display: flex;
    min-height: 100vh;
}

.loan-stepper {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    padding-bottom: .25rem;
}

.loan-step {
    align-items: center;
    background: #fff;
    border: 1px solid var(--fvm-line);
    border-radius: var(--fvm-radius);
    color: var(--fvm-muted);
    display: flex;
    gap: .65rem;
    padding: .75rem;
    min-width: 180px;
    text-align: left;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.loan-step span {
    align-items: center;
    background: #eef4ff;
    border-radius: 999px;
    color: var(--fvm-secondary);
    display: inline-flex;
    flex-shrink: 0;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.loan-step.active,
.loan-step.done {
    border-color: rgba(15, 118, 110, .35);
    color: var(--fvm-ink);
}

.loan-step.active {
    box-shadow: 0 14px 34px rgba(15, 118, 110, .12);
    transform: translateY(-1px);
}

.loan-step.active span,
.loan-step.done span {
    background: var(--fvm-primary);
    color: #fff;
}

.loan-panel {
    display: none;
}

.loan-panel.active {
    display: block;
}

.upload-card {
    background: #fff;
    border: 1px dashed #a8b5c7;
    border-radius: var(--fvm-radius);
    cursor: pointer;
    display: grid;
    gap: .5rem;
    min-height: 168px;
    padding: 1rem;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.upload-card:hover,
.upload-card.has-file {
    border-color: var(--fvm-primary);
    box-shadow: 0 16px 38px rgba(15, 118, 110, .1);
    transform: translateY(-1px);
}

.upload-card input[type="file"] {
    height: 1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.upload-preview {
    align-items: center;
    background: var(--fvm-soft);
    border-radius: 8px;
    color: var(--fvm-muted);
    display: flex;
    font-size: .88rem;
    gap: .5rem;
    justify-content: space-between;
    min-height: 42px;
    padding: .6rem .75rem;
}

.upload-thumb {
    border-radius: 6px;
    height: 34px;
    object-fit: cover;
    width: 46px;
}

.consent-check {
    background: var(--fvm-soft);
    border: 1px solid var(--fvm-line);
    border-radius: var(--fvm-radius);
    padding: 1rem 1rem 1rem 2.75rem;
}

@media (max-width: 767.98px) {
    .loan-step {
        align-items: flex-start;
        min-width: 150px;
    }
}

.status-badge {
    border-radius: 999px;
    font-size: .78rem;
    padding: .35rem .65rem;
}

.footer {
    background: #101828;
    color: #d0d5dd;
}

.footer a {
    color: #f2f4f7;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.whatsapp-float {
    align-items: center;
    background: #16a34a;
    border-radius: 999px;
    bottom: 18px;
    box-shadow: 0 12px 32px rgba(22, 163, 74, .3);
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    gap: .45rem;
    padding: .75rem 1rem;
    position: fixed;
    right: 18px;
    text-decoration: none;
    z-index: 1040;
}

.whatsapp-float:hover {
    color: #fff;
    transform: translateY(-1px);
}

.ai-chat-widget {
    bottom: 86px;
    position: fixed;
    right: 18px;
    z-index: 1050;
}

.ai-chat-bubble {
    align-items: center;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(15, 118, 110, .18);
    border-radius: 999px;
    box-shadow: 0 20px 55px rgba(16, 24, 40, .18);
    color: var(--fvm-ink);
    display: flex;
    gap: .75rem;
    padding: .55rem .65rem .55rem 1rem;
}

.ai-chat-bubble span {
    font-weight: 750;
}

.ai-chat-bubble img,
.ai-chat-header img {
    background: #fff;
    border-radius: 50%;
    object-fit: cover;
}

.ai-chat-bubble img {
    height: 60px;
    width: 60px;
}

.ai-chat-panel {
    background: #fff;
    border: 1px solid rgba(16, 24, 40, .12);
    border-radius: 8px;
    bottom: 0;
    box-shadow: 0 28px 80px rgba(16, 24, 40, .25);
    display: none;
    flex-direction: column;
    height: min(620px, calc(100vh - 120px));
    overflow: hidden;
    position: absolute;
    right: 0;
    width: min(420px, calc(100vw - 24px));
}

.ai-chat-widget.open .ai-chat-bubble {
    display: none;
}

.ai-chat-widget.open .ai-chat-panel {
    display: flex;
}

.ai-chat-header {
    align-items: center;
    background: linear-gradient(135deg, var(--fvm-primary), var(--fvm-secondary));
    color: #fff;
    display: flex;
    gap: .75rem;
    padding: .85rem 1rem;
}

.ai-chat-header img {
    height: 52px;
    width: 52px;
}

.ai-chat-header span {
    display: block;
    opacity: .85;
}

.ai-chat-header button {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.2rem;
    margin-left: auto;
}

.ai-chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .75rem;
    overflow-y: auto;
    padding: 1rem;
}

.ai-chat-message {
    border-radius: 8px;
    max-width: 86%;
    padding: .75rem .9rem;
}

.ai-chat-message.bot {
    align-self: flex-start;
    background: #eef4ff;
}

.ai-chat-message.user {
    align-self: flex-end;
    background: var(--fvm-primary);
    color: #fff;
}

.ai-chat-options {
    align-self: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    justify-content: flex-end;
}

.ai-chat-options button {
    background: #fff;
    border: 1px solid var(--fvm-secondary);
    border-radius: 999px;
    color: var(--fvm-secondary);
    font-weight: 650;
    padding: .35rem .8rem;
}

.ai-chat-form {
    align-items: center;
    border-top: 1px solid var(--fvm-line);
    display: flex;
    gap: .45rem;
    padding: .65rem;
}

.ai-chat-form input {
    border: 0;
    flex: 1;
    min-width: 0;
    outline: 0;
}

.ai-chat-form button {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--fvm-muted);
    display: inline-flex;
    font-size: 1.35rem;
    justify-content: center;
    min-height: 38px;
    min-width: 38px;
}

.ai-chat-form button[type="submit"] {
    color: var(--fvm-primary);
}

.auth-page {
    background: linear-gradient(140deg, #eefdf9, #f6f8ff 54%, #fff);
    min-height: 100vh;
}

.admin-shell {
    background: #f6f8fb;
    min-height: 100vh;
}

.admin-sidebar {
    background: #101828;
    color: #e4e7ec;
    min-height: calc(100vh - 58px);
}

.admin-sidebar a {
    border-radius: 8px;
    color: #e4e7ec;
    display: block;
    font-weight: 650;
    padding: .7rem .85rem;
    text-decoration: none;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
    background: rgba(255, 255, 255, .12);
}

.table-card {
    background: #fff;
    border: 1px solid var(--fvm-line);
    border-radius: var(--fvm-radius);
    overflow: hidden;
}

.timeline-list {
    display: grid;
    gap: .85rem;
    position: relative;
}

.timeline-item {
    border-left: 3px solid rgba(15, 118, 110, .22);
    padding-left: 1rem;
    position: relative;
}

.timeline-item::before {
    background: var(--fvm-primary);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, .22);
    content: "";
    height: 13px;
    left: -8px;
    position: absolute;
    top: .25rem;
    width: 13px;
}

.install-page {
    background: #edf5f4;
}

.empty-state {
    border: 1px dashed var(--fvm-line);
    border-radius: var(--fvm-radius);
    color: var(--fvm-muted);
    padding: 2rem;
    text-align: center;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        min-height: auto;
    }

    .whatsapp-float {
        bottom: 12px;
        left: 12px;
        justify-content: center;
        right: 12px;
    }

    .ai-chat-widget {
        bottom: 72px;
        left: 12px;
        right: 12px;
    }

    .ai-chat-panel {
        width: 100%;
    }
}
