html {
    scroll-behavior: smooth;
}

:root {
    --main-background: #FDFBF7;
    --primary-text: #2C3E50;
    --secondary-text: #5D6D7E;
    --accent-color: #4682B4;
    --button-color: #6B8E23;
    --button-text: #FFFFFF;
    --background-milky: #FDFBF7;
    --background-gray-green: #E8F0EE;
    --background-beige: #F5F5DC;
    --background-lavender: #F3E5F5;
    --background-steel-blue: #E1E8ED;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--main-background);
    color: var(--primary-text);
    font-family: "Inter", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Playfair Display", serif;
    font-weight: 700;
    margin-top: 0;
    line-height: 1.2;
    color: inherit;
}

a,
a:hover,
a:focus {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    display: block;
    height: auto;
}

ul,
ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    h1 {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
    }

    h2 {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    h3 {
        font-size: clamp(1.3rem, 6vw, 1.7rem);
    }

    .mobile-break-text {
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 0.9em;
    }
}

/* ===== header ===== */
.nav-link:hover {
    color: var(--accent-color) !important
}

.cta-btn:hover {
    opacity: 0.9
}

.js-mobile-overlay.is-open {
    display: flex !important
}

/* ===== hero_section ===== */
.hero-block {
    background-color: var(--main-background);
    position: relative;
    overflow: hidden;
}

.hero-title {
    color: var(--primary-text);
    font-weight: 700;
    font-size: calc(1.8rem + 1.5vw);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-text {
    color: var(--secondary-text);
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.hero-cta-btn {
    background-color: var(--button-color);
    color: var(--button-text);
    padding: 14px 32px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.hero-cta-btn:hover {
    background-color: var(--accent-color);
    color: var(--button-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(107, 142, 35, 0.3);
}

.hero-image-wrapper {
    position: relative;
    padding: 10px;
}

.hero-image {
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    width: 100%;
    height: auto;
    display: block;
}

.min-vh-75 {
    min-height: 75vh;
}

@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-text {
        max-width: 100%;
    }

    .min-vh-75 {
        min-height: auto;
    }
}

/* ===== intro_planning ===== */
.intro-section {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.intro-section h2 {
    letter-spacing: -0.01em;
}

.intro-section .rounded {
    transition: all 0.3s ease;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.intro-section .rounded:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

/* ===== featured_article ===== */
.featured-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.9);
    overflow-y: auto;
    padding: 20px;
}

.featured-modal-content {
    background-color: var(--main-background);
    margin: 40px auto;
    padding: 40px;
    border-radius: 15px;
    max-width: 800px;
    width: 100%;
    position: relative;
}

.featured-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-text);
    transition: color 0.3s ease;
}

.featured-modal-close:hover {
    color: var(--accent-color);
}

.js-open-modal:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

@media (max-width: 768px) {
    .featured-modal-content {
        padding: 25px;
        margin: 20px auto;
    }
}

/* ===== financial_discipline ===== */
#discipline {
    width: 100%;
    background-color: var(--background-beige);
    overflow: hidden
}

.js-habit-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out
}

.js-habit-card.visible {
    opacity: 1;
    transform: translateY(0)
}

.habit-icon i {
    color: var(--accent-color)
}

/* ===== budget_structure ===== */
.custom-budget-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

.custom-budget-table th,
.custom-budget-table td {
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.custom-budget-table td .d-flex {
    min-width: 0;
}

.custom-budget-table td .d-flex span {
    min-width: 0;
}

@media (max-width: 767.98px) {
    #budget-structure .shadow-sm {
        overflow-x: hidden;
    }

    .custom-budget-table {
        table-layout: auto;
    }

    .custom-budget-table th,
    .custom-budget-table td {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .custom-budget-table .icon-box {
        width: 34px !important;
        height: 34px !important;
        margin-right: 0.6rem !important;
    }
}

.custom-budget-table tbody tr {
    transition: transform 0.2s ease, background-color 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.custom-budget-table thead {
    border-radius: 10px 10px 0 0;
}

.custom-budget-table tr:last-child {
    border-bottom: none;
}

.custom-budget-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.icon-box i {
    font-size: 1.1rem;
}

/* ===== flow_control ===== */
#flow-control {
    background-color: var(--background-steel-blue);
    padding: 80px 0;
    width: 100%;
}

#flow-control .card-custom {
    background-color: var(--main-background);
    padding: 40px;
    border-radius: 15px;
    height: 100%;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
}

#flow-control .card-custom:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* ===== expense_tools ===== */
.expense-tools-img {
    transition: transform 0.5s ease;
    width: 100%;
}

#spending-tools .rounded-lg {
    border-radius: 20px;
}

#spending-tools h2 {
    letter-spacing: -1px;
}

#spending-tools .shadow-sm {
    transition: transform 0.3s ease;
}

#spending-tools .shadow-sm:hover {
    transform: translateY(-5px);
}

/* ===== impulse_control ===== */
.js-impulse-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%
}

.js-impulse-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08)
}

#impulse-control h2,
#impulse-control h3,
#impulse-control p {
    margin-bottom: 1rem
}

/* ===== savings_strategies ===== */
#savings-strategies {
    position: relative;
    overflow: hidden;
}

.js-strategy-card {
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease;
}

.js-strategy-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1) !important;
}

/* ===== optimization ===== */
#optimization {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.js-opt-card:hover {
    border-color: var(--accent-color) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

/* ===== latest_posts ===== */
.post-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.post-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.custom-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.custom-modal-content {
    background-color: var(--main-background);
    margin: 5% auto;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 850px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 35px;
    cursor: pointer;
    color: var(--secondary-text);
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--accent-color);
}

/* ===== final_system ===== */
#final-plan {
    background-color: var(--background-gray-green);
    width: 100%;
}

.final-plan-title {
    color: var(--primary-text);
    font-weight: 700;
}

.final-plan-text {
    color: var(--secondary-text);
}

.checklist-icon {
    color: var(--accent-color);
    font-size: 1.5rem;
}

.checklist-heading {
    color: var(--primary-text);
    font-weight: 600;
}

.checklist-desc {
    color: var(--secondary-text);
    font-size: 0.95rem;
}

.consultation-card {
    background-color: var(--main-background);
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
}

.consultation-title {
    color: var(--primary-text);
    font-weight: 700;
}

.consultation-subtitle {
    color: var(--secondary-text);
}

.form-label {
    color: var(--primary-text);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    border: 1px solid var(--background-steel-blue);
    padding: 12px;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: none;
}

.btn-submit {
    background-color: var(--button-color);
    color: var(--button-text);
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background-color: var(--button-color);
    opacity: 0.9;
    color: var(--button-text);
    transform: translateY(-2px);
}

.consent-text {
    color: var(--secondary-text);
    font-size: 0.85rem;
}

.consent-link {
    color: var(--accent-color);
    text-decoration: underline;
}

.consent-link:hover {
    color: var(--primary-text);
}

/* ===== footer ===== */
#main-footer {
    position: relative;
    width: 100%;
}

.footer-link {
    text-decoration: none;
    transition: opacity 0.2s ease-in-out;
}

.footer-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.footer-divider {
    border-top: 1px solid rgba(44, 62, 80, 0.1);
}