/* =========================================
   ACA Mortgage Consultancy - Complete Styles
   ========================================= */

/* ----------------------------------
   1. 全局变量与重置 (Variables & Reset)
   ---------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* --- 基础背景与文本色 --- */
    --bg: #ffffff;
    --surface: #f8f9fa;     /* 浅灰背景 */
    --text: #334155;        /* 深蓝灰正文 */
    --muted: #64748b;       /* 次要文本 */
    --line: #e2e8f0;        /* 边框线 */

    /* --- 品牌色调 --- */
    --brand: #003366;       /* 品牌深蓝 */
    --accent: #0056b3;      /* 交互亮蓝 */
    --highlight-bg: #eff6ff;

    /* --- Header/Footer 专用渐变 (左黑右灰) --- */
    --gradient-dark: linear-gradient(90deg, #1a1a1a 0%, #666666 100%);
}

html {
    scroll-behavior: smooth; /* 启用平滑滚动 */
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a { text-decoration: none; color: inherit; transition: all 0.2s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 更宽布局（用于需要减少左右留白的页面） */
.container-wide {
    max-width: 1400px;
}

/* 防止锚点跳转时标题被 Header 遮挡 */
section[id] {
    scroll-margin-top: 100px;
}

.section { padding: 80px 0; }
.bg-light { background-color: var(--surface); }

/* 通用标题样式 */
.section-header { text-align: center; margin-bottom: 60px; }
.section-title { 
    font-size: 2.4rem; 
    color: var(--brand); 
    font-weight: 800; 
    margin-bottom: 15px; 
    text-transform: uppercase; 
}
.section-subtitle { 
    color: var(--muted); 
    max-width: 600px; 
    margin: 0 auto; 
    line-height: 1.6; 
    font-size: 1.1rem; 
}


/* ----------------------------------
   2. 导航栏 (Header / Navigation)
   ---------------------------------- */
.main-nav {
    background: var(--gradient-dark); /* 黑灰渐变 */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff !important;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

/* 导航链接 */
.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a, 
.dropbtn {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff !important; /* 白色文字 */
    text-transform: uppercase;
    opacity: 0.9;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.nav-links a:hover, 
.dropbtn:hover {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: -10px;
    background-color: #ffffff; /* 下拉菜单白底 */
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1001;
    border-radius: 6px;
    padding: 0.5rem 0;
    border: 1px solid var(--line);
}

.dropdown:hover .dropdown-content { display: block; }

.dropdown-content a {
    color: var(--text) !important; /* 恢复深色文字 */
    padding: 12px 20px;
    text-transform: none;
    font-weight: 500;
    border-bottom: 1px solid #f1f5f9;
    display: block;
    opacity: 1;
}

.dropdown-content a:hover {
    background-color: var(--highlight-bg);
    color: var(--brand) !important;
    text-decoration: none;
    padding-left: 25px; /* 悬停右移效果 */
}

/* 导航按钮 (Get Loan / Login) */
.nav-buttons { display: flex; gap: 1rem; }

.btn-get-loan, 
.btn-login {
    background: #ffffff !important; /* 白底 */
    color: #000000 !important;      /* 黑字 */
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-get-loan:hover, 
.btn-login:hover {
    background: #f0f0f0 !important;
    transform: translateY(-2px);
}

/* Dashboard 下拉 */
.dashboard-dropdown {
    position: relative;
}
.dashboard-dropdown .dashboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.dashboard-dropdown .dropdown-content {
    left: 0;
    min-width: 230px;
}
.dashboard-dropdown .dropdown-content a {
    font-weight: 600;
    text-transform: none;
}


/* ----------------------------------
   3. Hero 轮播图 (Carousel)
   ---------------------------------- */
.hero-carousel {
    position: relative;
    height: 600px;
    background: var(--brand);
    overflow: hidden;
    color: #fff;
}

.carousel-container { height: 100%; width: 100%; position: relative; }
.carousel-track { height: 100%; width: 100%; }

.carousel-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 0 20px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0; visibility: hidden; z-index: 0;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

.carousel-slide.active { opacity: 1; visibility: visible; z-index: 1; }

/* 遮罩层：确保文字清晰 */
.carousel-slide::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 20, 40, 0.4); z-index: 1;
}

.hero-content {
    z-index: 2; max-width: 800px;
    opacity: 0; transform: translateY(30px);
    transition: all 0.8s ease-out 0.3s;
}

.carousel-slide.active .hero-content { opacity: 1; transform: translateY(0); }

.hero-content h1 {
    font-size: 3rem; font-weight: 800; margin-bottom: 1rem;
    line-height: 1.2; text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.hero-content p {
    font-size: 1.2rem; margin-bottom: 2rem; opacity: 0.95;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Hero 区域按钮组 */
.hero-btn-group {
    display: flex; gap: 15px; justify-content: center;
    margin-top: 2rem; flex-wrap: wrap;
}

.hero-btn {
    padding: 1rem 2.5rem; font-size: 1rem;
    background: var(--accent); color: white;
    border: none; border-radius: 8px; font-weight: 600;
    cursor: pointer; transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.hero-btn:hover {
    background: #004494;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

/* 轮播控制按钮 */
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.15); color: white;
    border: 1px solid rgba(255,255,255,0.3);
    width: 48px; height: 48px; border-radius: 50%;
    font-size: 1.5rem; cursor: pointer; z-index: 10;
    backdrop-filter: blur(4px); transition: background 0.3s;
}
.carousel-btn:hover { background: rgba(255,255,255,0.3); }
.prev-btn { left: 20px; }
.next-btn { right: 20px; }

.carousel-dots {
    position: absolute; bottom: 30px; left: 50%;
    transform: translateX(-50%); display: flex; gap: 12px; z-index: 10;
}
.dot {
    width: 10px; height: 10px; background: rgba(255,255,255,0.4);
    border-radius: 50%; cursor: pointer; transition: all 0.3s;
}
.dot.active { background: white; transform: scale(1.2); }


/* ----------------------------------
   4. 卡片网格 (Cards Grid)
   ---------------------------------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    padding: 40px 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

/* 底部线条动画 (Why Choose Us) */
.card::before {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0%; height: 4px;
    background: var(--brand); transition: width 0.3s ease;
}
.card:hover::before { width: 100%; }

/* 图标圆形容器 */
.card-icon-wrapper {
    width: 64px; height: 64px;
    background: #f4f7f9;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 24px;
    transition: background 0.3s;
}
.card:hover .card-icon-wrapper { background: var(--highlight-bg); }
.card-icon-wrapper svg { width: 32px; height: 32px; color: var(--brand); stroke-width: 1.5; }

.card h3 { font-size: 1.4rem; color: var(--text); margin-bottom: 12px; font-weight: 700; }
.card p { color: var(--muted); line-height: 1.6; font-size: 0.95rem; margin-bottom: 1.5rem; flex-grow: 1; }

/* Explore rates button */
.explore-rates-btn {
    padding: 0.6rem 1.5rem;
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}
.explore-rates-btn:hover {
    background: var(--brand);
    color: white;
    transform: translateY(-2px);
}

.learn-more-link {
    color: var(--brand); font-weight: 600; font-size: 0.95rem;
    display: inline-block; transition: transform 0.2s;
}
.card:hover .learn-more-link { transform: translateX(5px); text-decoration: underline; }

/* --- Services 特殊样式 (顶部线条) --- */
.service-card-top-border { border-top: 1px solid var(--line); }
.service-card-top-border::before { display: none; } /* 禁用底部线条 */
.service-card-top-border::after {
    content: ''; position: absolute; top: 0; left: 0; width: 0%; height: 4px;
    background: var(--brand); transition: width 0.3s ease; z-index: 10;
}
.service-card-top-border:hover::after { width: 100%; }


/* ----------------------------------
   5. Who Are We & ACA Path
   ---------------------------------- */
/* Who Are We */
.who-are-we-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    min-height: 450px;
}

.who-img-box {
    position: relative;
    height: 100%;
    min-height: 400px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.who-img-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('images/logo/item1.jpeg') center/cover;
    opacity: 1;
    z-index: 1;
}

.who-img-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(240, 244, 248, 0.05) 100%);
    z-index: 2;
}


.who-text-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
}

.who-text-card p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--text);
}

.who-text-card button {
    display: inline-block;
    margin-top: 1rem;
    align-self: flex-start;
}

/* ACA Path (时间轴) */
.timeline-wrapper {
    display: flex; justify-content: space-between; align-items: flex-start;
    position: relative; margin-top: 3rem; padding: 0 20px;
}
.timeline-line {
    position: absolute; top: 60px; left: 10%; right: 10%;
    height: 2px; background: #e2e8f0; z-index: 0;
}
.step-node {
    position: relative; z-index: 1; display: flex; flex-direction: column;
    align-items: center; text-align: center; width: 220px;
    transition: transform 0.3s ease;
}
.step-node:hover { transform: translateY(-10px); }

.circle-box {
    width: 120px; height: 120px; background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    position: relative; border: 1px solid #f1f5f9;
}
.step-num { font-size: 2.5rem; font-weight: 800; color: var(--brand); }
.hover-ring {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%; border: 2px solid var(--brand);
    opacity: 0; transform: scale(0.8); transition: all 0.3s ease;
}
.step-node:hover .hover-ring { opacity: 1; transform: scale(1.1); }

.step-text {
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 180px;
}
.step-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}
.step-text p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
}
.step-text .explore-rates-btn {
    margin-top: auto;
    margin-left: auto;
    margin-right: auto;
}


/* ----------------------------------
   6. 页脚 (Footer)
   ---------------------------------- */
.main-footer {
    background: var(--gradient-dark); /* 黑灰渐变 */
    color: #ffffff;
    padding: 5rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-col h4 {
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.footer-col ul li { margin-bottom: 0.8rem; }
.footer-col ul li a {
    color: #e0e0e0;
    font-weight: 500;
    transition: color 0.2s;
}
.footer-col ul li a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
}


/* ----------------------------------
   7. 表单与按钮 (Forms & Misc)
   ---------------------------------- */
.form-box {
    max-width: 600px; margin: 0 auto; padding: 2.5rem;
    background: white; border: 1px solid var(--line);
    border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.9rem; }
.form-control {
    width: 100%; padding: 0.8rem; border: 1px solid var(--line);
    border-radius: 6px; font-size: 1rem; font-family: inherit;
}
.btn-block { width: 100%; display: block; text-align: center; }

/* 黑色通用按钮 (CTA) */
.btn-black { 
    background-color: #000; color: white;
    padding: 1rem 3rem; border: none; border-radius: 6px;
    font-weight: 700; cursor: pointer; transition: opacity 0.2s;
}
.btn-black:hover { opacity: 0.9; }

/* WhatsApp 悬浮按钮 */
.whatsapp-btn {
    position: fixed; bottom: 30px; right: 30px; z-index: 9999;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid white; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background-color: transparent; transition: all 0.3s ease;
}
.whatsapp-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.whatsapp-btn:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4); }

/* Contact section layout */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: start;
}
.contact-info {
    padding: 2rem 0;
}
.contact-item {
    margin-bottom: 1rem;
}
.contact-form-box {
    background: white;
    padding: 2.5rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Forgot password verify button */
.btn-verify {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.95rem 1.2rem;
    background: linear-gradient(135deg, #004494, #006aff);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 25px rgba(0, 82, 204, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s;
}
.btn-verify:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0, 82, 204, 0.32);
}
.btn-verify:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    box-shadow: none;
}

/* 登录/登出拦截弹窗 */
.guard-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.guard-backdrop.active { opacity: 1; }

.guard-modal {
    background: #ffffff;
    width: min(460px, 94%);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}
.guard-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.guard-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(0, 106, 255, 0.08);
    color: #0052cc;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.guard-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0 0 4px;
}
.guard-modal h3 {
    margin: 0;
    color: #0f172a;
}
.guard-message {
    color: #475569;
    margin: 10px 0 18px;
    line-height: 1.6;
}
.guard-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.guard-btn {
    border: none;
    cursor: pointer;
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: 700;
    min-width: 130px;
    transition: all 0.2s ease;
}
.guard-btn.ghost {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}
.guard-btn.ghost:hover { background: #e2e8f0; }
.guard-btn.primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 82, 204, 0.25);
}
.guard-btn.primary:hover { background: #004494; }

/* 浮动动画 (Calculator 页面用) */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}


/* ----------------------------------
   8. 响应式适配 (Responsive)
   ---------------------------------- */
@media (max-width: 768px) {
    /* Header */
    .nav-links, .nav-buttons { display: none; } /* 移动端需另行添加汉堡菜单 */
    
    /* Hero */
    .hero-carousel { height: auto; padding: 80px 0; }
    .hero-content h1 { font-size: 2rem; }
    
    /* Sections */
    .who-are-we-container { 
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0;
    }
    .who-img-box {
        min-height: 300px;
    }
    .who-text-card {
        max-width: 100%;
        padding: 1.5rem;
    }
    .contact-container {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    
    /* Timeline */
    .timeline-wrapper { flex-direction: column; align-items: center; }
    .timeline-line { width: 2px; height: 100%; left: 50%; top: 0; transform: translateX(-50%); }
    .step-node { width: 100%; margin-bottom: 3rem; background: white; padding: 20px; border-radius: 12px; border: 1px solid var(--line); }
}
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 50px;       /* 限制高度，防止撑破导航栏 */
    width: auto;        /* 宽度自动保持比例 */
    object-fit: contain;
    display: block;
}
.sidebar.collapsed {
    width: 60px;
    min-width: 60px;
}

.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-header h2 {
    display: none;
}

.content.sidebar-collapsed {
    margin-left: 60px;
    width: calc(100% - 60px);
}

.sidebar-toggle {
    cursor: pointer;
    padding: 8px;
    background: transparent;
    border: none;
}