/* --- 1. CORE VARIABLES --- */
:root {
    --primary: #FF4757;       /* Coral Red */
    --primary-dark: #2F3542;  /* Deep Slate */
    --text-main: #2F3542;
    --text-light: #747D8C;
    --bg-page: #F1F2F6;       /* Light Grey Background */
    --white: #FFFFFF;
    --border: #DFE4EA;
    --success: #2ED573;
    --radius: 16px;
    --container-width: 1140px;
}

body.page-article {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
}

/* --- 2. LAYOUT UTILITIES --- */
.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.main-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 360px; /* Precise widths */
    gap: 2.5rem;
    align-items: start; /* Fix alignment issue */
}

/* --- 3. HERO SECTION --- */
.hero-section {
    background: var(--white);
    padding: 3rem 1.5rem 4rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 3rem;
}

.badge-date {
    background: rgba(255, 71, 87, 0.1);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 1rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.hero-lead {
    font-size: 1.15rem;
    color: var(--text-light);
    margin: 0;
}

/* --- 4. ARTICLE CONTENT (LEFT) --- */
.article-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.article-card h2 {
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.insight-box {
    background: #F8F9FA;
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.check-icon { font-size: 1.2rem; }

/* FAQ */
.faq-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.8rem;
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem;
    font-weight: 600;
    background: #F8F9FA;
    cursor: pointer;
    list-style: none;
}

.faq-body {
    padding: 1rem;
    background: var(--white);
    border-top: 1px solid var(--border);
}

/* --- 5. CALCULATOR WIDGET (RIGHT - STICKY) --- */
.sticky-widget {
    position: sticky;
    top: 2rem; /* The magic alignment fix */
}

.calculator-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 10px 30px -5px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
}

.calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calc-header h3 { margin: 0; font-size: 1.2rem; }

.live-indicator {
    background: var(--success);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 10px;
}

/* Inputs */
.input-group-modern label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 14px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
    border: 2px solid var(--bg-page);
    border-radius: 12px;
    background: #F8F9FA;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    background: var(--white);
    border-color: var(--primary);
    outline: none;
}

.input-wrapper .unit {
    position: absolute;
    right: 15px;
    font-weight: 700;
    color: var(--text-light);
}

/* Toggle */
.toggle-pill {
    background: var(--bg-page);
    padding: 4px;
    border-radius: 12px;
    display: flex;
    position: relative;
    margin: 1.5rem 0;
}

.toggle-pill input { display: none; }

.toggle-pill label {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 2;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
}

.toggle-pill input:checked + label { color: var(--primary-dark); }

.slider-bg {
    position: absolute;
    height: calc(100% - 8px);
    width: calc(50% - 4px);
    background: var(--white);
    border-radius: 10px;
    top: 4px;
    left: 4px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    z-index: 1;
}

#wCadre:checked ~ .slider-bg { transform: translateX(100%); }

/* Results */
.result-display {
    background: var(--primary-dark);
    border-radius: 12px;
    padding: 1.5rem;
    color: var(--white);
    margin-bottom: 1.5rem;
}

.res-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.res-row .label { opacity: 0.8; font-size: 0.9rem; }
.res-row .val { font-weight: 700; font-size: 1.1rem; }

.res-row.main {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.res-row.main .val { font-size: 1.6rem; color: var(--success); }

.sub-text {
    font-size: 0.7rem;
    opacity: 0.6;
    text-align: right;
    margin: 0;
}

/* Button */
.btn-primary-full {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--primary);
    color: white;
    padding: 14px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.2s;
}

.btn-primary-full:hover { background: #E04050; }

/* Chart */
.donut-wrapper {
    position: relative;
    height: 160px;
    width: 160px;
    margin: 0 auto 1.5rem;
}

.donut-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-text span {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
}

/* --- 6. MOBILE RESPONSIVE --- */
@media (max-width: 900px) {
    .grid-layout {
        grid-template-columns: 1fr; /* Stack */
    }

    .hero-section { text-align: left; padding: 2rem 1.5rem; }
    .hero-section h1 { font-size: 2rem; }

    /* Hide sticky sidebar on mobile, use anchor link instead */
    .sidebar-col {
        order: -1; /* Show calculator first on mobile? Or use CTA */
        margin-bottom: 2rem;
    }
    
    .article-card { padding: 1.5rem; }
    
    .btn-mobile-calc {
        display: block;
        background: var(--primary-dark);
        color: white;
        padding: 1rem;
        text-align: center;
        border-radius: 12px;
        margin-bottom: 2rem;
        font-weight: 700;
        text-decoration: none;
    }
}

.d-md-none { display: none; }
@media (max-width: 900px) { .d-md-none { display: block; } }