/* FNG Homepage — đăng ký vay */
:root {
    /* Màu thương hiệu FNG (theo logo): xanh dương + vàng cam */
    --brand-navy: #0f2650;
    --accent: #f28c10;
    --accent-gradient: linear-gradient(90deg, #ee6f12, #f79c0b);
    --bg: #f4f6fa;
    --surface: #ffffff;
    --border: #e3e7ef;
    --text: #1d2433;
    --muted: #6b7489;
    --primary: #1e4fc2;
    --primary-soft: #e7eefc;
    --hero-bg: linear-gradient(135deg, #0f2650 0%, #1e4fc2 100%);
    --ok: #12805c;
    --ok-soft: #e3f6ee;
    --bad: #c4302b;
    --bad-soft: #fde8e7;
    --radius: 12px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a1530;
        --surface: #12204a;
        --border: #24366a;
        --text: #e6eaf3;
        --muted: #9fb0d4;
        --primary: #7ea2ff;
        --primary-soft: #1a2c5c;
        --hero-bg: linear-gradient(135deg, #0f2650 0%, #173f9c 100%);
        --ok: #4cc79a;
        --ok-soft: #133a2d;
        --bad: #ff7b74;
        --bad-soft: #3d1c1c;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.25; }

/* Header giống thanh menu trang giới thiệu (session 8). Logo nền trắng => header luôn trắng, kể cả dark mode */
.site-nav { position: sticky; top: 0; z-index: 40; background: #fff; transition: box-shadow .25s; }
.site-nav.scrolled { box-shadow: 0 6px 20px rgba(25, 50, 156, .15); }
.site-nav-inner {
    max-width: 1160px; margin: 0 auto; padding: 0 16px; min-height: 68px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { display: inline-flex; }
.logo img { display: block; height: 42px; width: auto; }
/* Nút đăng nhập nhân viên: cùng kiểu nút "Đăng ký ngay" trên menu trang giới thiệu (cam, bo tròn, đổ bóng) */
.nav-login {
    display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; border-radius: 999px;
    background: var(--accent-gradient); color: var(--brand-navy); font-size: 14px; font-weight: 700; white-space: nowrap;
    box-shadow: 0 8px 20px rgba(255, 121, 0, .35); transition: transform .2s, box-shadow .2s;
}
a.nav-login:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(255, 121, 0, .45); text-decoration: none; }
.nav-login:focus-visible { outline: 3px solid #ffd08a; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .site-nav, .nav-login { transition: none; } a.nav-login:hover { transform: none; } }

.page { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; }
.page.narrow { max-width: 560px; }
.hero {
    margin-bottom: 24px; padding: 28px 24px; border-radius: var(--radius);
    background: var(--hero-bg); color: #fff;
}
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: #f9a83a; }
.hero p { margin: 0 0 16px; color: #d3dcf2; }
.steps { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 0; list-style: none; font-size: 14px; color: #eef2fb; }
.steps b {
    display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px;
    border-radius: 50%; background: var(--accent-gradient); color: var(--brand-navy); font-size: 12px;
}

/* Banner sản phẩm nổi bật — trượt ngang (scroll-snap), vuốt được trên mobile */
.featured { margin-bottom: 24px; }
.featured-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.featured-head h2 { margin: 0; font-size: 18px; padding-left: 10px; border-left: 3px solid var(--accent); }
.featured-nav { display: flex; gap: 8px; }
.featured-nav button {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer;
}
.featured-nav button:hover { border-color: var(--primary); color: var(--primary); }
.featured-track {
    display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 16px) / 2); gap: 16px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px;
}
.featured-track::-webkit-scrollbar { display: none; }
.product {
    scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; min-width: 0;
    padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
    border-top: 4px solid; border-image: var(--accent-gradient) 1 0 0 0;
}
.product-tag {
    align-self: flex-start; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--primary-soft); color: var(--primary);
}
.product h3 { margin: 0; font-size: 17px; color: var(--text); }
.product-desc {
    margin: 0; color: var(--muted); font-size: 14px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.product dl { display: grid; gap: 4px; margin: 0; }
.product dl div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.product dt { color: var(--muted); }
.product dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.product-pick {
    margin-top: auto; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--primary);
    background: transparent; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer;
}
.product-pick:hover { background: var(--primary-soft); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
fieldset { border: 0; padding: 0; margin: 0 0 24px; }
legend { font-weight: 600; font-size: 16px; margin-bottom: 12px; color: var(--text); padding-left: 10px; border-left: 3px solid var(--accent); }
legend .opt, label .opt { font-weight: 400; color: var(--muted); font-size: 14px; }
label .opt { font-size: 12px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 500; color: var(--muted); }
input:not([type=checkbox]), select {
    width: 100%; padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px;
}
input:focus, select:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.invalid { border-color: var(--bad) !important; }
.err { color: var(--bad); font-size: 13px; }
.err:empty { display: none; }
.hint { color: var(--muted); font-size: 13px; }

.estimate {
    margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--primary-soft);
    display: flex; flex-direction: column; gap: 2px;
}
.estimate span { font-size: 13px; color: var(--muted); }
.estimate strong { font-size: 24px; color: var(--primary); font-variant-numeric: tabular-nums; }
.estimate small { color: var(--muted); font-size: 12px; }

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text); font-weight: 400; cursor: pointer; }
.check input { flex: 0 0 18px; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); }
.check span { flex: 1; min-width: 0; line-height: 1.5; }
.consent { margin-bottom: 4px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert.error { background: var(--bad-soft); color: var(--bad); }

/* Nút chính: vàng cam thương hiệu, chữ navy (tương phản tốt hơn chữ trắng trên nền cam) */
.btn {
    display: inline-block; margin-top: 20px; padding: 12px 22px; border: 0; border-radius: 8px;
    background: var(--accent-gradient); color: var(--brand-navy); font: inherit; font-weight: 700; cursor: pointer;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.done { text-align: center; }
.done p { color: var(--muted); }
.tick {
    width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
    display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-size: 28px;
}
.done dl { display: grid; grid-template-columns: auto auto; gap: 8px 16px; text-align: left; margin: 20px auto 0; max-width: 360px; }
.done dt { color: var(--muted); }
.done dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.referrer-linked {
    margin-bottom: 12px; padding: 10px 14px; border-radius: 8px; font-size: 14px;
    background: var(--ok-soft); color: var(--ok);
}

/* Liên hệ nhanh — các nút bo tròn xếp dọc góc phải, nút "Tư vấn nhanh" màu cam để thu gọn / mở */
.contact-fab {
    position: fixed; right: 16px; bottom: 16px; z-index: 50;
    display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.contact-list { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.contact-fab.collapsed .contact-list { display: none; }
.contact-item {
    display: inline-flex; align-items: center; gap: 14px; padding: 6px 6px 6px 22px;
    border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px;
    box-shadow: 0 4px 18px rgba(15, 38, 80, .14); border: 1px solid var(--border);
}
.contact-item:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 22px rgba(15, 38, 80, .2); }
.contact-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; }
.contact-icon.phone { background: #16a34a; color: #fff; } /* xanh lá — nút gọi Hotline */
.contact-icon.messenger { background: #eef1ff; }
.contact-icon.zalo { background: #eef4ff; }
.contact-icon.zalo b {
    display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
    background: #0068ff; color: #fff; font-size: 9px; letter-spacing: -.2px;
}
.contact-toggle {
    display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border: 0; border-radius: 999px;
    background: var(--accent-gradient); color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
    box-shadow: 0 6px 20px rgba(238, 111, 18, .35);
}
.contact-toggle:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.contact-toggle-icon {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    background: #fff; color: #ee6f12;
}
.contact-x { margin-left: 6px; font-size: 14px; opacity: .9; }
.contact-fab.collapsed .contact-x { display: none; }

@media (max-width: 600px) {
    body { padding-bottom: 72px; } /* chừa chỗ cho nút "Tư vấn nhanh" */
    .contact-fab { right: 12px; bottom: 12px; }
    .contact-item { font-size: 14px; }
    h1 { font-size: 23px; }
    .site-nav-inner { min-height: 60px; }
    .logo img { height: 34px; }
    .nav-login { padding: 8px 14px; font-size: 13px; }
    .hero { padding: 22px 18px; }
    .card { padding: 18px 16px; }
    .grid, .checks { grid-template-columns: 1fr; }
    .featured-track { grid-auto-columns: 85%; }
    .featured-nav { display: none; }
    .btn { width: 100%; text-align: center; }
}
.tick.fail { background: var(--bad-soft); color: var(--bad); font-weight: 700; }

/* Chân trang + trang pháp lý (Điều khoản sử dụng / Chính sách bảo mật) */
/* Chân trang dùng chung (giống trang giới thiệu — session 7): nền navy, 3 cột; chừa chỗ nút "Tư vấn nhanh" */
.welcome-footer { background: var(--brand-navy); color: #c9d4ee; padding: 56px 0 88px; font-size: 14px; }
footer.welcome-footer a { color: #fff; } /* thắng ".welcome a" của welcome.css */
.welcome-footer h3 { margin: 0 0 12px; color: #fff; font-size: 15px; }
.welcome-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.welcome-footer p { margin: 0 0 6px; }
.footer-inner { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.footer-logo { height: 40px; margin-bottom: 14px; padding: 6px 10px; border-radius: 8px; background: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.welcome-footer .copyright { margin: 32px auto 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .15); opacity: .8; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr; } }
.legal h1 { margin: 0 0 4px; font-size: 24px; line-height: 1.3; }
.legal .updated { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.legal h2 { margin: 24px 0 8px; font-size: 17px; scroll-margin-top: 16px; }
.legal p, .legal li { color: var(--text); }
.legal ul, .legal ol { padding-left: 20px; margin: 8px 0; }
.legal li + li { margin-top: 4px; }
.legal .note { margin-top: 24px; padding: 12px 14px; border-radius: 8px; background: var(--primary-soft); font-size: 14px; }
