/* ============================================= */
/* ===== 1. ROOT VARIABLES & GLOBAL STYLES ===== */
/* ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    /* Light Mode Palette (Default) */
    --accent-color: #27ae60;
    --accent-color-darker: #219d53;
    --background-primary: rgba(255, 255, 255, 0.5);
    --background-secondary: rgba(255, 255, 255, 0.5);
    --text-primary: #2c3e50;
    --text-secondary: #576574;
    --border-color: #e1e5e9;
    --card-bg: #ffffff;
    --card-shadow: 0 6px 20px rgba(0, 0, 0, 0.02);
    --card-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.03);
    --background-image: url('/static/images/background.png');
}

body.dark-mode {
    --accent-color: #29b864;
    --accent-color-darker: #27ae60;
    --background-primary: rgba(15, 23, 42, 0.5);  /* Dark Blue Slate */
    --background-secondary: rgba(15, 23, 42, 0.5);
    --text-primary: #e2e8f0; /* Lighter text */
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --card-bg: rgba(30, 41, 59, 0.8); /* More opaque card */
    --card-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    --card-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.2);
    --background-image: url('/static/images/background-dark.png');
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.7;
    background-color: var(--card-bg);
    background-image: var(--background-image);
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: scroll;
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.text-block {
    background: var(--background-secondary);
    border-left: 4px solid var(--accent-color);
    padding: clamp(1rem, 1.5vw, 1.25rem);
    border-radius: 8px;
    color: var(--text-primary);
    margin-bottom: clamp(1rem, 2vw, 1.25rem);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: var(--card-shadow);
    text-align: center;
}

/* =================================== */
/* ===== 2. LAYOUT & CONTAINER ===== */
/* =================================== */

.container {
    width: clamp(90%, 85vw, 1200px);
    margin-inline: auto;
    padding: 0;
}

main > section {
    padding-block: clamp(2.5rem, 8vw, 5rem);
    background-color: var(--background-primary);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1),
                inset 0 -1px 0 rgba(0,0,0,0.05);
}

/* ============================ */
/* ===== 3. TYPOGRAPHY ===== */
/* ============================ */

h1, h2, h3, h4 {
    font-weight: 300;
}
h1 { font-size: clamp(2.5rem, 1.8rem + 3vw, 3.5rem); text-align: center; margin-bottom: 0.5rem; font-weight: 600; }
h2 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.5rem); text-align: center; margin-bottom: 1rem; font-weight: 500; }
main > section > .container > p { text-align: center; margin-bottom: 2.5rem; color: var(--text-secondary); max-width: 600px; margin-inline: auto;}

/* ======================================= */
/* ===== 4. HEADER & NAVIGATION ===== */
/* ======================================= */

header {
    background-color: var(--background-primary);
    padding-block: 0.5rem;
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: background-color 0.4s ease;
}
header .container { display: flex; justify-content: space-between; align-items: center; }
.logo-container { display: flex; align-items: center; text-decoration: none; color: inherit; }
.logo { height: clamp(45px, 8vw, 60px); }
.logo-text { font-size: clamp(1.2rem, 1rem + 1vw, 1.5rem); font-weight: 400; margin-left: 0.75rem; }
.orange-text { color: var(--accent-color); font-weight: 500; }
nav a { color: var(--text-primary); text-decoration: none; margin-left: clamp(1rem, 2vw, 1.5rem); transition: color 0.3s ease; font-weight: 500; }
nav a:hover, nav a:focus { color: var(--accent-color); }

/* ============================ */
/* ===== 5. CARDS & GRIDS ===== */
/* ============================ */

.card-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); }
.card {
    background: var(--card-bg); padding: clamp(1.25rem, 2vw, 1.75rem); border-radius: 12px; text-decoration: none; color: var(--text-primary);
    border: 1px solid var(--border-color); box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--card-shadow-hover); }
.card p { text-align: left; margin-bottom: 0; color: var(--accent-color); font-weight: 500; }

.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); margin-bottom: 2.5rem; }
.result-card {
    background: var(--card-bg); padding: clamp(1.25rem, 2vw, 1.75rem); border-radius: 12px;
    border: 1px solid var(--border-color); box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}
.result-card:hover, .result-card.optimal {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: var(--card-shadow-hover);
}
.result-card h3 { margin-top: 0; font-size: 1.2rem; font-weight: 400; }
.result-card ul { list-style: none; padding-left: 0; text-align: left; }
.result-card li { margin-bottom: 0.75rem; color: var(--text-secondary); font-size: 0.95rem; }
.result-card li strong { color: var(--text-primary); }

/* ======================================== */
/* ===== 6. SLIDERS & ACTION BUTTONS ===== */
/* ======================================== */

.slider-container { display: flex; gap: clamp(2rem, 5vw, 3rem); justify-content: center; margin-top: 2.5rem; flex-wrap: wrap; }
.slider-group { flex-basis: 400px; text-align: center; }
.slider-group label { display: block; margin-bottom: 1rem; font-size: 1.1rem; }
.slider-group output { display: block; margin-top: 0.75rem; font-size: 1.5rem; font-weight: 400; color: var(--accent-color); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; background: #dfe4ea; border-radius: 5px; cursor: pointer; transition: background 0.3s ease; }
body.dark-mode input[type="range"] { background: #475569; }
input[type="range"]:focus { outline: none; }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 24px; height: 24px; background: var(--accent-color);
    border-radius: 50%; border: 4px solid var(--card-bg); box-shadow: 0 0 5px rgba(0,0,0,0.2);
    transition: background 0.3s ease;
}
input[type="range"]::-moz-range-thumb {
    width: 24px; height: 24px; background: var(--accent-color); border-radius: 50%;
    border: 4px solid var(--card-bg); box-shadow: 0 0 5px rgba(0,0,0,0.2);
    transition: background 0.3s ease;
}
input[type="range"]:hover::-webkit-slider-thumb { background: var(--accent-color-darker); }
input[type="range"]:hover::-moz-range-thumb { background: var(--accent-color-darker); }

.calculate-button-container { text-align: center; margin-top: 2.5rem; }
#calculateBtn, .cta-button, .btn-submit {
    padding: clamp(0.75rem, 1.5vw, 1rem) clamp(1.5rem, 3vw, 2rem);
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    border-radius: 8px;
    font-weight: 500; cursor: pointer; transition: all 0.3s ease;
    border: none;
}
#calculateBtn {
    background-color: var(--accent-color); color: #fff;
    position: relative; min-width: 220px; box-shadow: 0 4px 10px rgba(39, 174, 96, 0.25);
}
#calculateBtn:hover:not(:disabled) { background-color: var(--accent-color-darker); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(39, 174, 96, 0.3); }
#calculateBtn:focus-visible { outline: 2px solid var(--accent-color-darker); outline-offset: 3px; }
#calculateBtn:disabled { background-color: #ccc; cursor: not-allowed; box-shadow: none; }

.loader {
    width: 20px; height: 20px; border: 2px solid #fff; border-bottom-color: transparent;
    border-radius: 50%; position: absolute; top: 50%; left: 50%; margin-top: -10px; margin-left: -10px;
    opacity: 0; transition: opacity 0.2s ease; animation: rotation 1s linear infinite;
}
#calculateBtn .btn-text { transition: opacity 0.2s ease; }
#calculateBtn.loading .btn-text { opacity: 0; }
#calculateBtn.loading .loader { opacity: 1; }

.cta-button {
    background-color: transparent; color: var(--accent-color); border: 2px solid var(--accent-color);
    text-decoration: none; display: inline-block;
}
.cta-button:hover { background-color: var(--accent-color); color: #fff; transform: translateY(-2px); }

/* ================================== */
/* ===== 7. FORMS & USER INPUT ===== */
/* ================================== */

#leadForm { max-width: 550px; margin-inline: auto; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.95rem; font-weight: 400; margin-bottom: 0.5rem; }
#leadForm input[type="text"],
#leadForm input[type="email"],
#leadForm input[type="tel"] {
    width: 100%; padding: 0.75rem; border: 1px solid var(--border-color);
    background-color: var(--card-bg); color: var(--text-primary); border-radius: 8px;
    font-size: 1rem; font-family: 'Poppins', sans-serif;
    font-weight: 400; transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease;
}
#leadForm input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15);
}
.form-check-group { margin-block: 1.5rem; }
.checkbox-container { display: flex; align-items: flex-start; margin-bottom: 1rem; }
.checkbox-container input { margin-top: 5px; margin-right: 12px; flex-shrink: 0; }
.checkbox-container label { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.4; }
.checkbox-container a { color: var(--accent-color); text-decoration: none; }
.checkbox-container a:hover { text-decoration: underline; }
.form-error { color: #e74c3c; text-align: center; margin-bottom: 1rem; display: none; }

.btn-submit {
    background-color: var(--accent-color); color: #fff; width: 100%;
}
.btn-submit:hover { background-color: var(--accent-color-darker); transform: translateY(-2px); }

/* =============================== */
/* ===== 8. MISC COMPONENTS ===== */
/* =============================== */

.price-notification { text-align: center; font-size: 0.9rem; color: var(--text-secondary); background-color: var(--background-secondary); padding: 0.5rem; border-radius: 4px; max-width: 700px; margin: -10px auto 30px auto; }
.results-explanation { background: rgba(39, 174, 96, 0.08); padding: 1.25rem; margin-top: 2.5rem; border-left: 4px solid var(--accent-color); border-radius: 8px; }
body.dark-mode .results-explanation { background: rgba(41, 184, 100, 0.1); }
.results-explanation h3 { margin-top: 0; font-weight: 500; }
.results-explanation p { text-align: left; margin-bottom: 0; }
.chart-container { position: relative; width: 100%; height: 50vh; margin-top: 2.5rem; }
.testimonial-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.testimonial { background: var(--background-secondary); padding: 1.25rem; border-radius: 8px; border-left: 4px solid var(--accent-color); }
.testimonial .quote { text-align: left; font-style: italic; margin-bottom: 1rem; color: var(--text-secondary); }
.testimonial .author { text-align: right; font-weight: 500; margin-bottom: 0; color: var(--text-primary); }
.advisor-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 2.5rem; }
.advisor-card { text-align: center; }
.advisor-card img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; margin-bottom: 1rem; border: 3px solid var(--border-color); }
.advisor-card h3 { margin-bottom: 0.25rem; font-size: 1.4rem; font-weight: 500; }
.advisor-card h4 { margin: 0; font-size: 1rem; color: var(--accent-color); font-weight: 500; margin-bottom: 0.75rem; }
.advisor-card p { font-size: 0.95rem; color: var(--text-secondary); text-align: center; }
.tooltip-icon { position: relative; margin-left: 5px; cursor: help; color: #888; }
.tooltip-text {
    visibility: hidden; width: 220px; background-color: #2c3e50; color: #fff;
    text-align: center; border-radius: 6px; padding: 0.5rem; position: absolute;
    z-index: 1; bottom: 125%; left: 50%; margin-left: -110px; opacity: 0;
    transition: opacity 0.3s; font-size: 0.85rem; font-weight: 400;
    box-shadow: var(--card-shadow);
}
.tooltip-icon:hover .tooltip-text { visibility: visible; opacity: 1; }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.8s ease;
}

.faq-answer.open {
  max-height: 500px;
}

#faq-root button {
  gap: 0.5rem;
  align-items: center;
}

#faq-root svg {
  transition: transform 0.8s ease;
}

#faq-root svg {
  width: 1.25rem;   /* ≈20px */
  height: 1.25rem;
  stroke-width: 2;
}

#faq-root {
    max-width: 800px;
    margin-inline: auto;
    background: var(--background-secondary);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 16px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--accent-color);
}

#faq-root details {
    margin-bottom: 1.25rem;
    background: var(--card-bg);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease;
}

#faq-root details[open] {
    box-shadow: var(--card-shadow-hover);
}

#faq-root summary {
    cursor: pointer;
    list-style: none;
    font-weight: 500;
    font-size: 1.05rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#faq-root summary::-webkit-details-marker {
    display: none;
}

#faq-root summary svg {
    width: 18px;
    height: 18px;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

#faq-root details[open] summary svg {
    transform: rotate(180deg);
}

#faq-root .faq-answer {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    max-height: none;
    overflow: visible;
}

/* ======================== */
/* ===== 9. FOOTER ===== */
/* ======================== */

footer {
    background-color: rgba(44, 62, 80, 0.7);
    color: #ecf0f1;
    padding-top: 2.5rem;
    margin-top: 4rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: background-color 0.4s ease;
}
body.dark-mode footer { background-color: rgba(15, 23, 42, 0.7); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-col h4 { color: #fff; font-weight: 500; }
.footer-col p { color: #bdc3c7; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 0.75rem; }
.footer-col li a { color: #bdc3c7; text-decoration: none; transition: color 0.3s ease; }
.footer-col li a:hover { color: var(--accent-color); }
.copyright { text-align: center; padding: 1.25rem 0; margin-top: 1.25rem; border-top: 1px solid #4a627a; }
body.dark-mode .copyright { border-top-color: var(--border-color); }

/* ================================== */
/* ===== 10. ANIMATIONS & MEDIA ===== */
/* ================================== */

@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

main > section.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1s ease-out forwards;
}

.card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255, 255, 255, 0.2), transparent 150px);
    opacity: 0; transition: opacity 0.3s ease;
}
.card:hover::before { opacity: 1; }
.menu-toggle-theme {
    background: transparent; border: none; color: var(--text-primary);
    font-size: 1.2rem; margin-left: 10px; cursor: pointer;
    transition: color 0.3s ease;
}
.menu-toggle-theme:hover { color: var(--accent-color); }

.article-content {
    background: var(--background-primary);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    width: clamp(90%, 70vw, 900px);
    margin: 4rem auto;
}
.article-content h1, .article-content h2, .article-content h3,
.article-content p, .article-content ul, .article-content li {
    color: var(--text-primary);
}
.article-content p { line-height: 1.8; }

/* Responsive Overrides & Mobile Menu */
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }
    .menu-toggle .bar {
        height: 3px; width: 100%; background: var(--text-primary);
        border-radius: 2px; transition: all 0.3s ease;
    }
    nav {
        position: absolute; top: calc(100% + 5px); right: 0;
        background: var(--background-primary);
        -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
        box-shadow: var(--card-shadow-hover);
        border-radius: 10px;
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        gap: 0.5rem;
        display: none;
    }
    nav.show { display: flex; }
    nav a { margin: 0; padding: 0.5rem 0; width: 100%; }
    body.menu-open { overflow: hidden; }
    body.menu-open::before {
        content: ''; position: fixed; inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 1;
        visibility: visible;
        -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
        transition: opacity 0.35s ease, visibility 0.35s ease;
    }
}
@media (min-width: 769px) {
    .menu-toggle { display: none; }
    nav { display: flex !important; } /* Ensure nav is visible on desktop */
}