/* ===== SHARED PAGE STYLES ===== */

/* Disclosure Bar — fixed above the fixed header so it is never hidden */
.disclosure-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 36px;
    display: flex;
    align-items: center;
    background: #05070f;
    padding: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.disclosure-bar p {
    margin: 0;
    width: 100%;
    text-align: center;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 16px;
}

/* Push the fixed header down below the disclosure bar */
.header {
    top: 36px !important;
}

@media (max-width: 640px) {
    .disclosure-bar {
        font-size: 11px;
        height: auto;             /* cho cao tự động thay vì cắt cứng 36px */
        min-height: 34px;
        padding: 5px 0;
    }
    .disclosure-bar p {
        white-space: normal;      /* cho chữ xuống dòng, không cắt "..." */
        overflow: visible;
        text-overflow: clip;
        line-height: 1.3;
        padding: 0 12px;
        /* rút gọn: chỉ hiện 2 dòng, tránh chiếm quá nhiều chỗ */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    /* header đẩy xuống theo chiều cao disclosure động */
    .header { top: 44px !important; }
}

.disclosure-bar a {
    color: var(--lime);
    text-decoration: underline;
}

/* Breadcrumb */
.breadcrumb {
    padding: 16px 0;
    font-size: 13px;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    flex-wrap: wrap;
}

.breadcrumb-list a {
    color: rgba(255, 255, 255, 0.6);
}

.breadcrumb-list a:hover {
    color: var(--lime);
}

.breadcrumb-list .separator {
    color: rgba(255, 255, 255, 0.35);
}

.breadcrumb-list .current {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

/* Page Hero */
.page-hero {
    padding: 120px 0 60px;
    background:
        radial-gradient(ellipse 600px 400px at 80% 0%, rgba(198, 241, 53, 0.10), transparent 60%),
        linear-gradient(180deg, #0A0F1E, #101828);
}

.page-hero h1 {
    font-size: 40px;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 16px;
}

.page-hero .subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.65);
    max-width: 700px;
    line-height: 1.7;
}

/* Content Section */
.content-section {
    padding: 60px 0;
}

.content-section.alt {
    background: var(--gray-100);
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.content-wrapper h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin: 40px 0 16px;
}

.content-wrapper h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--dark);
    margin: 32px 0 12px;
}

.content-wrapper p {
    font-size: 16px;
    color: var(--gray-700);
    line-height: 1.8;
    margin-bottom: 16px;
}

.content-wrapper ul, .content-wrapper ol {
    margin: 16px 0;
    padding-left: 24px;
}

.content-wrapper li {
    font-size: 16px;
    color: var(--gray-700);
    line-height: 1.8;
    margin-bottom: 8px;
}

.content-wrapper a {
    color: var(--primary);
    text-decoration: underline;
}

.content-wrapper blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--primary-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.content-wrapper blockquote p {
    color: var(--gray-800);
    font-style: italic;
    margin-bottom: 0;
}

.content-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.content-wrapper th {
    background: var(--gray-900);
    color: var(--white);
    border-bottom: 2px solid var(--lime);
    padding: 14px 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
}

.content-wrapper td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
    color: var(--gray-700);
}

.content-wrapper tr:nth-child(even) td {
    background: var(--gray-100);
}

/* Author Box */
.author-box {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--gray-100);
    border-radius: var(--radius);
    margin: 40px 0;
    align-items: center;
}

.author-avatar-lg {
    width: 72px;
    height: 72px;
    min-width: 72px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
}

.author-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.author-info .role {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.author-info p {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0;
}

/* Article Meta */
.article-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-500);
}

.meta-item svg {
    color: var(--gray-400);
}

/* Sidebar Layout */
.two-col-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 96px;
}

.sidebar-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.sidebar-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
}

.sidebar-card ul {
    list-style: none;
    padding: 0;
}

.sidebar-card li {
    margin-bottom: 8px;
}

.sidebar-card li a {
    display: block;
    padding: 8px 12px;
    color: var(--gray-600);
    font-size: 14px;
    border-radius: 6px;
    transition: var(--transition);
}

.sidebar-card li a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Calculator Styles */
.calculator-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto;
}

.calculator-card h2 {
    text-align: center;
    margin-bottom: 32px;
}

.calc-result {
    background: linear-gradient(135deg, var(--primary-light), var(--lime-soft));
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    margin-top: 32px;
}

.calc-result-main {
    font-size: 42px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.calc-result-label {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 20px;
}

.calc-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.calc-detail {
    text-align: center;
}

.calc-detail-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.calc-detail-label {
    font-size: 12px;
    color: var(--gray-500);
}

/* Contact Form */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 32px;
}

.contact-info-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.contact-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.contact-info-item h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.contact-info-item p {
    font-size: 14px;
    color: var(--gray-600);
    margin: 0;
}

.contact-form-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-lg);
}

.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Glossary */
.glossary-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding: 16px;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.glossary-nav a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    color: var(--gray-600);
    transition: var(--transition);
}

.glossary-nav a:hover, .glossary-nav a.active {
    background: var(--lime);
    color: var(--dark);
}

.glossary-letter {
    margin-bottom: 32px;
}

.glossary-letter h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.glossary-term {
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
}

.glossary-term dt {
    font-size: 17px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}

.glossary-term dd {
    font-size: 15px;
    color: var(--gray-600);
    line-height: 1.7;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.blog-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.blog-card-image {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--primary);
}

.blog-card-body {
    padding: 24px;
}

.blog-card-category {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    border-radius: 100px;
    margin-bottom: 12px;
}

.blog-card-body h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.4;
}

.blog-card-body h3 a {
    color: var(--dark);
    text-decoration: none;
}

.blog-card-body h3 a:hover {
    color: var(--primary);
}

.blog-card-body p {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 16px;
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-500);
}

/* City Page */
.city-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 32px 0;
}

.city-stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.city-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.city-stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* 404 Page */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--primary-light) 100%);
    text-align: center;
    padding: 120px 24px 80px;
}

.error-code {
    font-size: 120px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 16px;
}

.error-page h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
}

.error-page p {
    font-size: 16px;
    color: var(--gray-600);
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.error-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Lender Review Page */
.lender-review-header {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 32px;
}

.lender-review-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

.lender-review-info h1 {
    font-size: 32px;
    margin-bottom: 4px;
}

.lender-review-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lender-review-rating .stars {
    color: var(--accent);
    font-size: 18px;
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 32px 0;
}

.pros, .cons {
    padding: 24px;
    border-radius: var(--radius-sm);
}

.pros {
    background: var(--secondary-light);
    border: 1px solid rgba(14, 116, 144, 0.25);
}

.cons {
    background: #fef2f2;
    border: 1px solid #fca5a5;
}

.pros h3, .cons h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.pros h3 {
    color: var(--secondary);
}

.cons h3 {
    color: #991b1b;
}

.pros ul, .cons ul {
    padding-left: 0;
    list-style: none;
}

.pros li::before {
    content: '✓ ';
    color: var(--secondary);
    font-weight: 700;
}

.cons li::before {
    content: '✗ ';
    color: var(--danger);
    font-weight: 700;
}

/* Updated at box */
.updated-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--secondary-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--secondary);
    font-weight: 500;
    margin-bottom: 24px;
}

/* Responsive for pages */
@media (max-width: 1024px) {
    .two-col-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .city-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .page-hero h1 {
        font-size: 30px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .calculator-card {
        padding: 24px;
    }

    .calc-details {
        grid-template-columns: 1fr;
    }

    .pros-cons {
        grid-template-columns: 1fr;
    }

    .contact-form .form-row {
        grid-template-columns: 1fr;
    }

    .lender-review-header {
        flex-direction: column;
        text-align: center;
    }

    .error-code {
        font-size: 80px;
    }
}

/* ===== LIGHT FORM OVERRIDES (contact + simulador — global .form-group styles are dark-themed for the hero) ===== */
.contact-form .form-group label,
.calculator-card .form-group label {
    color: var(--gray-800);
}

.contact-form .form-group input[type="text"],
.contact-form .form-group input[type="email"],
.contact-form .form-group input[type="tel"],
.contact-form .form-group select,
.contact-form .form-group textarea,
.calculator-card .form-group input[type="text"],
.calculator-card .form-group input[type="number"],
.calculator-card .form-group select {
    background: var(--gray-100);
    border: 2px solid var(--gray-300);
    color: var(--gray-800);
}

.contact-form .form-group input::placeholder,
.contact-form .form-group textarea::placeholder,
.calculator-card .form-group input::placeholder {
    color: var(--gray-500);
}

.contact-form .form-group input:focus,
.contact-form .form-group select:focus,
.contact-form .form-group textarea:focus,
.calculator-card .form-group input:focus,
.calculator-card .form-group select:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(198, 241, 53, 0.25);
}

/* Simulador range sliders + value/labels on the white calculator card
   (global versions are styled for the dark hero → illegible here) */
.calculator-card .range-value {
    color: var(--dark);
}

.calculator-card .range-labels {
    color: var(--gray-500);
}

.calculator-card .range-slider {
    background: linear-gradient(to right, var(--dark) 0%, var(--dark) 50%, var(--gray-300) 50%, var(--gray-300) 100%);
}

.calculator-card .range-slider::-webkit-slider-thumb {
    background: var(--lime);
    border: 3px solid var(--dark);
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.2);
}

.calculator-card .range-slider::-moz-range-thumb {
    background: var(--lime);
    border: 3px solid var(--dark);
}

/* ===== CONTENT TABLES ===== */
/* Desktop/tablet: bảng RỘNG FULL bằng text (width 100% của .content-wrapper 800px) */
.content-wrapper th,
.content-wrapper td {
    white-space: normal;
    vertical-align: top;
}
.content-wrapper .table-hint { display: none; }  /* ẩn gợi ý cuộn trên desktop */

/* Mobile (≤640px): cho bảng cuộn ngang khi quá nhiều cột, cột đầu dính */
@media (max-width: 640px) {
    .content-wrapper table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .content-wrapper table::-webkit-scrollbar { height: 6px; }
    .content-wrapper table::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 3px; }
    .content-wrapper table::-webkit-scrollbar-track { background: var(--gray-200); }

    .content-wrapper th,
    .content-wrapper td {
        font-size: 12.5px;
        padding: 9px 10px;
        min-width: 78px;
    }
    .content-wrapper td:first-child,
    .content-wrapper th:first-child {
        min-width: 96px;
        position: sticky;      /* cột đầu (tên) DÍNH khi cuộn ngang */
        left: 0;
        background: #fff;
        z-index: 1;
    }
    .content-wrapper tr:nth-child(even) td:first-child {
        background: var(--gray-100);
    }
    .content-wrapper .table-hint {
        display: block;
        font-size: 12px;
        color: var(--gray-500);
        margin: 20px 0 -14px;
        font-style: italic;
    }
}

/* ===== LENDER REVIEW: logo image + AEO verdict box (new review pages) ===== */
.lender-review-logo.has-img {
    background: white;
    border: 1px solid var(--gray-200);
    padding: 12px;
}

.lender-review-logo.has-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.verdict-box {
    background: linear-gradient(135deg, #0A0F1E, #101828);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin: 28px 0;
    color: #fff;
}

.verdict-box h2 {
    color: #fff;
    font-size: 22px;
    margin: 0 0 12px;
}

.verdict-box p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 15.5px;
    line-height: 1.7;
    margin: 0 0 18px;
}

.verdict-box .btn {
    margin-top: 4px;
}

/* ===== Simulador: ofertas dinámicas (fit/no-fit) ===== */
.offer-fit-tag {
    display: inline-block;
    background: rgba(198, 241, 53, 0.18);
    color: #3d5a00;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    margin-bottom: 10px;
}
.offer-nofit-tag {
    display: inline-block;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    margin-bottom: 10px;
}
.lender-card.offer-nofit {
    opacity: 0.66;
}
.lender-card.offer-nofit:hover {
    opacity: 1;
}
