:root {
    --primary: #2E8B57;
    --secondary: #3CB371;
    --light-green: #E8F8F0;
    --cream: #FFFDF7;
    --gold: #F4B400;
    --dark: #1F2937;
}

html {
    scroll-behavior: smooth;
}


body {
    font-family: 'Inter', sans-serif;
    background: #F9FAFB;
    color: var(--dark);
}

/* NAVBAR */


.custom-navbar {
    /*background: linear-gradient( 135deg, #1F6F5F, #2E8B57);*/
    background: linear-gradient( 135deg, #1F6F5F, #2E8B57);
    padding: 15px 0;
}

    .custom-navbar .navbar-brand {
        color: white !important;
        font-size: 1.5rem;
    }

    .custom-navbar .nav-link {
        color: white !important;
        font-weight: 500;
    }

    .custom-navbar .dropdown-menu {
        border-radius: 12px;
        border: none;
        box-shadow: 0 10px 30px rgba(0,0,0,.1);
    }

    .custom-navbar .dropdown-item:hover {
        /*background-color: #E8FFF0;*/
        background: #E8F5E9;
        color: #2E8B57;
    }

.logo-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 10px;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary) !important;
}

.nav-link {
    font-weight: 600;
    margin-left: 15px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #FCD34D !important;
}



/* CARDS */

.custom-card {
    border: none;
    border-radius: 20px;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,.05);
}

/* FORMS */

.form-control,
.form-select {
    border-radius: 12px;
    height: 42px;
    min-height: 50px;
    border: 1px solid #d1d5db;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 .25rem rgba(46,139,87,.15);
    }

/* BUTTON */

.btn-success {
    background: linear-gradient( 135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font-weight: 700;
}



/* TABLES */

.table-responsive {
    background: white;
    padding: 15px;
    border-radius: 18px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .05);
    max-height: 480px;
    overflow: auto;
}

/*
   Calculator tables use a consistent DeChatura header.
   Explicitly style the cells because sticky table headers otherwise
   override the inherited thead background.
*/
    .table-responsive > .table:not(.table-light):not(.table-dark) > thead > tr > th {
        position: sticky;
        top: 0;
        z-index: 4;
        background-color: var(--secondary);
        color: #ffffff;
        font-weight: 700;
        vertical-align: middle;
        padding: 12px 16px;
        border-bottom: 2px solid #1f6f5f;
        white-space: nowrap;
        text-align: left;
        text-shadow: none;
    }

/*
   Preserve Bootstrap's intentionally themed table variants.
*/
.table-responsive > .table.table-light > thead > tr > th,
.table-responsive > .table.table-dark > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 4;
    white-space: nowrap;
    vertical-align: middle;
}

/*
   Keep body cells aligned with the corresponding headers and allow
   horizontal scrolling on narrow screens.
*/
.table-responsive > .table > tbody > tr > td {
    vertical-align: middle;
    padding: 10px 16px;
}

/*
   Retain the existing fallback styling for tables that are not inside
   .table-responsive.
*/
.table:not(.table-light):not(.table-dark) > thead {
    background-color: var(--primary);
    color: #ffffff;
}

/* ADS */

.ad-box {
    min-height: 90px;
    border: 2px dashed #CBD5E1;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    color: #64748B;
}

/* FOOTER */

.footer-section {
    margin-top: 60px;
    background: white;
    padding: 50px 0;
}

.footer-links {
    list-style: none;
    padding-left: 0;
}

    .footer-links li {
        margin-bottom: 10px;
    }

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


/* MOBILE */


.saved-label {
    font-size: 14px;
    color: #666;
    line-height: 1.2;
    margin-bottom: 4px;
}

.saved-amount {
    font-size: 28px;
    font-weight: 700;
    color: #2E8B57;
    line-height: 1;
}

.savings-summary {
    max-width: 350px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .savings-summary {
        max-width: none;
        margin: 0;
    }
}

@media(max-width:768px) {
    .chart-wrapper {
        width: 260px;
    }

    .saved-amount {
        font-size: 18px;
    }
}

.seo-content-section h2 {
    color: #2E8B57;
    font-weight: 700;
    margin-bottom: 20px;
}

.seo-content-section h3 {
    color: #3A7D44;
    margin-top: 25px;
    margin-bottom: 15px;
}

.seo-content-section p {
    line-height: 1.8;
    color: #555;
}

.seo-content-section ul {
    padding-left: 20px;
}

.seo-content-section li {
    margin-bottom: 8px;
    color: #555;
}

.btn-warning {
    background: #FFC107;
    border: none;
    font-weight: 600;
}

    .btn-warning:hover {
        background: #FFB300;
    }

.home-hero {
    padding: 48px 20px;
    background: linear-gradient(135deg, #FFF8E1, #FFE082);
    border-radius: 16px;
    margin-top: 18px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.06);
}

    .home-hero h1 {
        color: #1F6F5F;
        font-weight: 800;
        font-size: 2.4rem;
        margin-bottom: 15px;
    }

    .home-hero p {
        color: #555;
        font-size: 1.05rem;
        margin-bottom: 15px;
    }

.section-title {
    text-align: center;
    margin-bottom: 40px;
    color: #1F6F5F;
    font-weight: 700;
}

.calculator-section {
    padding: 70px 0;
}

.calculator-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
    height: 100%;
}

.feature-box {
    padding: 25px;
}

    .feature-box h4 {
        color: #1F6F5F;
        font-weight: 700;
        margin-bottom: 6px;
    }

    .feature-box p {
        color: #586069;
    }

.why-section {
    padding: 50px 0;
    background: #F8FAFC;
}

.seo-section {
    padding: 60px 0;
}


.hero-calculator-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-badge {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 30px;
    background: rgba(255,255,255,.15);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all .3s ease;
}

    .hero-badge:hover {
        background: rgba(255,255,255,.30);
        color: #fff;
        text-decoration: none;
        transform: translateY(-2px);
    }



/* Layout: side-by-side controls and summary with equal height */
.result-row {
    align-items: stretch;
}

/* Controls panel visual */
.controls-panel {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15,23,42,0.04);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Keep result-box consistent and fill height */
.result-box {
    background: #ffffff;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15,23,42,0.04);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Make the two side panels equal height when inside d-flex columns */
.col-lg-6 > .controls-panel,
.col-lg-6 > .result-box {
    height: 100%;
}

/* Reduce large internal gaps */
.controls-panel .slider-container,
.controls-panel .mb-3 {
    margin-bottom: 14px;
}

/* Tighter summary content */
.result-box h3 {
    margin-bottom: 12px;
    font-size: 1.35rem;
}

.left-summary p {
    margin-bottom: 10px;
}

.affordability-row .affordability-value {
    min-width: 64px;
    text-align: right;
    color: #374151;
    font-weight: 600;
}

/* Chart sizing and containment */
.chart-wrapper {
    width: 320px;
    height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-wrapper canvas,
#loanChart,
#yearlyBreakdownChart {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}

/* Summary cards */
.summary-card {
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(15,23,42,0.04);
    min-height: 70px;
}

/* Minor spacing tweaks for saving boxes */
.saving-box {
    background: transparent;
    padding: 8px 0;
}

/* responsive adjustments */
@media (max-width: 991px) {
    .chart-wrapper { width: 260px; height: 260px; }
    .chart-container { height: 260px; }
    .controls-panel, .result-box { padding: 14px; }
}

@media (max-width: 576px) {
    .chart-wrapper { width: 220px; height: 220px; }
    .chart-container { height: 220px; }
    .result-row { gap: 16px; }
}

/* Added: Home page UI/UX polish styles */

/* Hero */
.home-hero {
    padding: 48px 20px;
    background: linear-gradient(135deg, #FFF8E1, #FFE082);
    border-radius: 16px;
    margin-top: 18px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.06);
}
.calculator-hero-card { border-radius: 12px; }
.hero-icon {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius: 12px;
    background: linear-gradient(135deg, #2E8B57, #3CB371);
    box-shadow: 0 6px 18px rgba(15,23,42,.08);
}

/* Calculator tiles */
.calculator-tile .card {
    transition: transform .18s ease, box-shadow .18s ease;
    border-radius: 12px;
}
.calculator-tile .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(15,23,42,0.12);
    text-decoration: none;
}
.calculator-icon {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius: 12px;
    background: #F1FBF6;
    box-shadow: inset 0 -2px 0 rgba(46,139,87,0.06);
}

/* subtle success tone used for icons */
.bg-light-success { background: #F1FBF6 !important; }

/* Reduce vertical whitespace for a tighter layout */
.calculator-section { padding-top: 36px; padding-bottom: 32px; }
.home-hero + .calculator-section { margin-top: 18px; }

/* Feature boxes */
.feature-box h4 { color: #1F6F5F; font-weight: 700; margin-bottom: 6px; }
.feature-box p { color: #586069; }

/* Popular searches chips */
.chip {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 999px;
    background: #FFFFFF;
    color: #374151;
    border: 1px solid #E6E9EB;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background .15s ease, transform .12s ease, box-shadow .12s ease;
}
.chip:hover {
    background: #F8FFF7;
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(15,23,42,0.06);
    text-decoration: none;
}

/* hero badges adjustments */
.hero-calculator-badges .badge { background: rgba(255,255,255,0.9); color: #374151; font-weight:600; }

/* small helpers */
.calculator-hero-card .hero-icon { width:48px; height:48px; font-size:1.25rem; border-radius:10px; }
@media (max-width: 991px) {
    .home-hero { padding: 28px 12px; }
    .calculator-hero-card { margin-top: 8px; }
    .calculator-icon, .hero-icon { width:44px; height:44px; }
}

/* Compact Home page calculator catalog */
.home-hero-compact {
    margin: 8px auto 0;
    padding: 12px 20px;
    border-radius: 12px;
}

.home-hero-compact .container {
    max-width: 1320px;
}

.home-hero-compact .home-eyebrow {
    margin-bottom: 6px;
    color: #526273;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.home-hero-compact h1 {
    max-width: 810px;
    margin-bottom: 8px;
    font-size: clamp(1.65rem, 3vw, 2.2rem);
    line-height: 1.2;
}

.home-hero-compact p:last-child {
    max-width: 760px;
    margin-bottom: 0;
    font-size: .98rem;
}

.home-catalog {
    max-width: 1440px;
    padding-top: 12px;
}

.home-discovery {
    position: sticky;
    top: 82px;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 18px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.home-search {
    display: flex;
    flex: 1 1 320px;
    align-items: center;
    gap: 12px;
}

.home-search .form-control {
    width: 100%;
    max-width: 520px;
    min-height: 42px;
    height: 42px;
}

.home-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.home-filter-button {
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid #d9e2dc;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: .86rem;
    font-weight: 600;
}

.home-filter-button:hover,
.home-filter-button:focus-visible {
    border-color: var(--primary);
    color: #1f6f5f;
}

.home-filter-button.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.home-category-list {
    display: grid;
    gap: 8px;
}

.home-category {
    min-width: 0;
}

.home-category .related-calculators {
    margin-top: 0 !important;
}

.home-category .calculator-explore-section {
    padding: 10px 0;
}

.home-category-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
}

.home-category-heading h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.22rem;
    font-weight: 750;
}

.home-category-heading p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: .88rem;
}

.home-category-count {
    flex: 0 0 auto;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e8f8f0;
    color: #1f6f5f;
    font-size: .78rem;
    font-weight: 700;
}

.home-category .calculator-explore-section > .row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.home-category .calculator-explore-section > .row > [class*="col-"] {
    width: auto;
    max-width: none;
    padding: 0;
}

.home-category .calculator-tile {
    display: flex;
    min-height: 152px;
    height: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: 13px 14px;
    border: 1px solid #e5e9e7;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .045);
    text-align: left;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.home-category .calculator-tile:hover {
    transform: translateY(-2px);
    border-color: #8bbda2;
    box-shadow: 0 7px 16px rgba(15, 23, 42, .08);
    text-decoration: none;
}

.home-category .calculator-tile:focus-visible {
    outline: 3px solid rgba(46, 139, 87, .3);
    outline-offset: 2px;
}

.home-category .calculator-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    margin: 0 0 8px;
    border-radius: 9px;
    background: #f1fbf6;
    font-size: 1.15rem;
}

.home-category .calculator-tile h3 {
    margin: 0 0 4px;
    color: #1f6f5f;
    font-size: .96rem;
    font-weight: 700;
    line-height: 1.3;
}

.home-category .calculator-tile p {
    margin: 0 0 8px;
    color: #5b6570;
    font-size: .81rem;
    line-height: 1.4;
}

.home-card-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    color: #1f6f5f;
    font-size: .78rem;
    font-weight: 700;
}

.home-category [hidden] {
    display: none !important;
}

.home-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 28px;
    padding: 14px 0;
    border-top: 1px solid #e5e7eb;
}

.home-benefits > div {
    display: grid;
    gap: 2px;
}

.home-benefits strong {
    color: #334155;
    font-size: .88rem;
}

.home-benefits span {
    color: #64748b;
    font-size: .81rem;
}

@media (max-width: 1199.98px) {
    .home-category .calculator-explore-section > .row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .home-hero-compact {
        margin-top: 8px;
        padding: 22px 16px;
    }

    .home-discovery {
        position: static;
        align-items: stretch;
    }

    .home-search {
        flex-basis: 100%;
        flex-wrap: wrap;
    }

    .home-search .form-control {
        max-width: none;
    }

    .home-category-filters {
        width: 100%;
    }

    .home-filter-button {
        flex: 1 1 auto;
    }

    .home-category .calculator-explore-section > .row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .home-category .calculator-tile {
        min-height: 158px;
        padding: 12px;
    }

    .home-benefits {
        grid-template-columns: 1fr;
        gap: 9px;
    }
}

@media (max-width: 380px) {
    .home-category .calculator-explore-section > .row {
        grid-template-columns: 1fr;
    }

    .home-category .calculator-tile {
        min-height: 0;
    }
}
