:root {
    --js-primary: #4f46e5;
    --js-primary-light: #6366f1;
    --js-bg: #f1f5f9;
    --js-card-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
    --js-card-hover-shadow: 0 4px 16px rgba(0,0,0,.1);
    --js-radius: 1rem;
}
body { background-color: var(--js-bg); font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }
.hero { background: linear-gradient(135deg, var(--js-primary) 0%, #7c3aed 100%); }
.navbar { background: linear-gradient(90deg, #1e1b4b 0%, #312e81 100%) !important; }
.navbar-brand { font-size: 1.25rem; letter-spacing: -.02em; }

/* Cards */
.card { border-radius: var(--js-radius); transition: transform 0.2s, box-shadow 0.2s; box-shadow: var(--js-card-shadow); }
.card:hover { transform: translateY(-3px); box-shadow: var(--js-card-hover-shadow); }
.card-body { padding: 1.5rem; }

/* Form styles */
.form-card { position: relative; z-index: 2147483646; }
.form-card .card-body { padding: 1.75rem; }
.form-card .card-header { background: linear-gradient(135deg, var(--js-primary) 0%, #7c3aed 100%); color: #fff; border-radius: var(--js-radius) var(--js-radius) 0 0 !important; padding: 1.25rem 1.75rem; border: none; }
.form-card .card-header h5 { margin: 0; font-weight: 600; }
.form-label { font-weight: 500; font-size: .875rem; color: #475569; margin-bottom: .35rem; }
.form-control { border-radius: .625rem; border: 1.5px solid #e2e8f0; padding: .625rem .875rem; transition: border-color .2s, box-shadow .2s; }
.form-control:focus { border-color: var(--js-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.form-select { border-radius: .625rem; border: 1.5px solid #e2e8f0; padding: .625rem .875rem; }
.form-select:focus { border-color: var(--js-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.input-group-text { background: #f8fafc; border: 1.5px solid #e2e8f0; color: #64748b; font-weight: 500; font-size: .875rem; }
.input-group .form-control { border-left: 0; }
.input-group .input-group-text + .form-control { border-left: 0; }
.input-group > .form-control:first-child { border-right: 0; }

/* Stepper buttons */
.btn-stepper { background: #f8fafc; border: 1.5px solid #e2e8f0; color: #475569; width: 38px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, color .15s; font-size: 1rem; font-weight: 600; padding: 0; user-select: none; }
.btn-stepper:hover { background: var(--js-primary); color: #fff; border-color: var(--js-primary); }
.btn-stepper:active { transform: scale(.95); }
.btn-submit { background: linear-gradient(135deg, var(--js-primary) 0%, #7c3aed 100%); border: none; border-radius: .625rem; padding: .75rem; font-weight: 600; font-size: 1rem; letter-spacing: .01em; transition: opacity .2s, transform .1s; }
.btn-submit:hover { opacity: .9; transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }

/* Results */
.result-card { border: none; border-radius: var(--js-radius); }
.result-highlight { background: linear-gradient(135deg, var(--js-primary) 0%, #7c3aed 100%); color: #fff; border-radius: .75rem; padding: 1.25rem; }
.result-highlight small { color: rgba(255,255,255,.75); }
.result-highlight .value { font-size: 1.75rem; font-weight: 700; }
.result-item { background: #fff; border-radius: .75rem; padding: 1rem 1.25rem; border: 1px solid #e2e8f0; }
.result-item small { color: #94a3b8; font-size: .8rem; }
.result-item .value { font-size: 1.15rem; font-weight: 600; color: #1e293b; }

/* Table */
.table-amortissement { max-height: 400px; overflow-y: auto; border-radius: .75rem; }
.table-amortissement table { margin-bottom: 0; }
.table-amortissement thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }

/* Home cards (legacy - kept for compat) */
.sim-card { border: none; }
.sim-card .card-body { padding: 2rem 1.5rem; }
.sim-card .sim-icon { width: 60px; height: 60px; border-radius: 1rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; }
.sim-card .btn { border-radius: .5rem; font-weight: 500; padding: .5rem 1.25rem; }

/* ── HOME HERO v2 ──────────────────────────────── */
.home-hero {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4f46e5 100%);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}
.home-hero .hero-shapes { position: absolute; inset: 0; pointer-events: none; }
.shape {
    position: absolute; border-radius: 50%; opacity: .08;
    background: #fff;
    animation: float-shape 12s ease-in-out infinite;
}
.shape-1 { width: 300px; height: 300px; top: -80px; left: -60px; animation-delay: 0s; }
.shape-2 { width: 200px; height: 200px; bottom: -40px; right: -30px; animation-delay: -3s; }
.shape-3 { width: 120px; height: 120px; top: 30%; right: 15%; animation-delay: -6s; opacity: .05; }
.shape-4 { width: 80px; height: 80px; bottom: 20%; left: 20%; animation-delay: -2s; opacity: .06; }
.shape-5 { width: 160px; height: 160px; top: 10%; left: 50%; animation-delay: -8s; opacity: .04; }
@keyframes float-shape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(15px, -20px) scale(1.05); }
    66% { transform: translate(-10px, 15px) scale(.97); }
}
.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.2);
    padding: .4rem 1.2rem;
    border-radius: 2rem;
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: .02em;
}
.fw-black { font-weight: 900; }
.hero-gradient-text {
    background: linear-gradient(90deg, #a5b4fc, #c4b5fd, #f0abfc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.opacity-85 { opacity: .85; }
.hero-cta {
    border-radius: .75rem;
    transition: transform .2s, box-shadow .2s;
}
.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

/* ── STATS BAR ─────────────────────────────────── */
.stats-bar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.04);
}
.stat-item { padding: .5rem 1rem; }
.stat-item:not(:last-child) { border-right: 1px solid #e2e8f0; }
.stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--js-primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label { font-size: .8rem; color: #64748b; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }

/* ── SECTION BADGES ────────────────────────────── */
.section-badge {
    display: inline-block;
    background: var(--js-bg);
    border: 1.5px solid #e2e8f0;
    padding: .35rem 1.25rem;
    border-radius: 2rem;
    font-size: .85rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: .02em;
}
.section-badge-fire {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
    color: #92400e;
}

/* ── POPULAR CARDS ─────────────────────────────── */
.popular-card {
    background: #fff;
    border-radius: var(--js-radius);
    padding: 1.75rem;
    box-shadow: var(--js-card-shadow);
    transition: transform .25s, box-shadow .25s;
    position: relative;
    overflow: hidden;
}
.popular-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.popular-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
}
.popular-card-icon {
    width: 52px; height: 52px;
    border-radius: .875rem;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 1.35rem;
    color: #fff;
    margin-bottom: .75rem;
}
.popular-card-arrow {
    font-weight: 600;
    font-size: .875rem;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity .2s, transform .2s;
}
.popular-card:hover .popular-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ── SEARCH BAR ───────────────────────────────── */
.search-bar { text-align: center; }
.search-input {
    border-radius: 2rem !important;
    padding: .65rem 1.25rem .65rem 2.75rem !important;
    border: 1.5px solid #e2e8f0;
    font-size: .95rem;
    transition: border-color .2s, box-shadow .2s;
}
.search-input:focus { border-color: var(--js-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.search-bar-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
}
.search-clear {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: .25rem;
    font-size: .85rem;
}
.search-clear:hover { color: #475569; }

/* ── CATEGORY FILTERS ──────────────────────────── */
.category-filters { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.cat-filter {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 2rem;
    padding: .45rem 1rem;
    font-size: .85rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all .2s;
}
.cat-filter:hover { border-color: var(--js-primary); color: var(--js-primary); }
.cat-filter.active {
    background: var(--js-primary);
    border-color: var(--js-primary);
    color: #fff;
}
.cat-filter .cat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.08);
    border-radius: 1rem;
    font-size: .7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 .4rem;
}
.cat-filter.active .cat-count { background: rgba(255,255,255,.25); }

/* ── SIM CARD V2 ───────────────────────────────── */
.sim-card-v2 {
    background: #fff;
    border-radius: var(--js-radius);
    padding: 1.25rem;
    box-shadow: var(--js-card-shadow);
    transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.sim-card-v2::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--js-radius);
    border: 2px solid transparent;
    transition: border-color .25s;
    pointer-events: none;
}
.sim-card-v2:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0,0,0,.1);
}
.sim-card-v2:hover::after {
    border-color: var(--card-color);
}
.sim-card-v2-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.sim-card-v2-icon {
    width: 42px; height: 42px;
    border-radius: .75rem;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    flex-shrink: 0;
}
.sim-card-v2-badge {
    font-size: .65rem;
    font-weight: 600;
    padding: .2rem .6rem;
    border-radius: 1rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.sim-card-v2-desc {
    flex-grow: 1;
    line-height: 1.4;
}
.sim-card-v2-go {
    font-size: .8rem;
    font-weight: 600;
    margin-top: .75rem;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .2s, transform .2s;
}
.sim-card-v2:hover .sim-card-v2-go {
    opacity: 1;
    transform: translateX(0);
}

/* ── GRID ANIMATIONS ───────────────────────────── */
.sim-grid-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .4s ease, transform .4s ease;
}
.sim-grid-item.sim-visible {
    opacity: 1;
    transform: translateY(0);
}
.sim-fade-in {
    animation: sim-fade .35s ease forwards;
}
@keyframes sim-fade {
    from { opacity: 0; transform: scale(.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ── CTA BOTTOM ────────────────────────────────── */
.cta-bottom-inner {
    background: linear-gradient(135deg, var(--js-primary) 0%, #7c3aed 50%, #a855f7 100%);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}
.cta-bottom-inner::before {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
    top: -100px; right: -80px;
}
.cta-bottom-inner .btn {
    border-radius: .75rem;
    transition: transform .2s;
}
.cta-bottom-inner .btn:hover { transform: translateY(-2px); }

/* ── RESPONSIVE ────────────────────────────────── */
/* z-index déjà sur .form-card globalement pour passer au-dessus des anchor ads */
@media (max-width: 991px) {
    /* Extra padding so submit button clears AdSense anchor ad (~60-90px) */
    .form-card .card-body { padding-bottom: 5rem; }
}
@media (max-width: 767px) {
    .home-hero { padding: 3.5rem 0 3rem; }
    .home-hero h1 { font-size: 2.25rem; }
    .stat-number { font-size: 1.5rem; }
    .popular-card-arrow { opacity: 1; transform: translateX(0); }
    .sim-card-v2-go { opacity: 1; transform: translateX(0); }
    main { padding-bottom: 80px !important; }
}

/* ── SEO CONTENT BLOCK ─────────────────────────── */
.seo-content {
    background: #fff;
    border-radius: var(--js-radius);
    box-shadow: var(--js-card-shadow);
    padding: 2rem;
    margin-top: 2rem;
}
.seo-content h2 { font-size: 1.25rem; font-weight: 700; color: #1e293b; margin-top: 1.5rem; margin-bottom: .75rem; }
.seo-content h2:first-child { margin-top: 0; }
.seo-content p { color: #475569; line-height: 1.7; font-size: .95rem; }
.seo-content ul, .seo-content ol { color: #475569; font-size: .95rem; padding-left: 1.25rem; }
.seo-content li { margin-bottom: .35rem; }
.seo-content table { width: 100%; font-size: .9rem; margin: .75rem 0; border-collapse: collapse; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.seo-content table th { background: #f8fafc; font-weight: 600; color: #334155; padding: .5rem .75rem; border-bottom: 2px solid #e2e8f0; text-align: left; white-space: nowrap; }
.seo-content table td { padding: .5rem .75rem; border-bottom: 1px solid #e2e8f0; color: #475569; }
.seo-content table tr:nth-child(even) { background: #f8fafc; }
.seo-content table tr:last-child td { border-bottom: none; }
.seo-content .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.seo-content strong { color: #334155; }
.seo-content code { background: #f1f5f9; padding: .15rem .4rem; border-radius: .25rem; font-size: .85rem; color: var(--js-primary); }
.seo-content h3 { font-size: 1.1rem; font-weight: 600; color: #334155; margin-top: 1.25rem; margin-bottom: .5rem; }

/* ── FAQ SECTION ──────────────────────────────────── */
.seo-content .faq-section { margin-top: 2rem; }
.seo-content .faq-section h2 { margin-top: 0; }
.seo-content .accordion-item { border: 1px solid #e2e8f0; border-radius: .75rem !important; margin-bottom: .5rem; overflow: hidden; }
.seo-content .accordion-item:last-child { margin-bottom: 0; }
.seo-content .accordion-button { font-weight: 600; font-size: .95rem; color: #1e293b; padding: 1rem 1.25rem; background: #fff; box-shadow: none; }
.seo-content .accordion-button:not(.collapsed) { background: #f8fafc; color: var(--js-primary); }
.seo-content .accordion-button::after { flex-shrink: 0; }
.seo-content .accordion-body { font-size: .95rem; color: #475569; line-height: 1.7; padding: 0 1.25rem 1rem; }
.seo-content .accordion-button:focus { box-shadow: 0 0 0 3px rgba(79,70,229,.15); }

/* ── ARTICLES ──────────────────────────────────── */
.article-content { max-width: 780px; margin: 0 auto; }
.article-body { background: #fff; border-radius: var(--js-radius); box-shadow: var(--js-card-shadow); padding: 2rem; font-size: 1.125rem; line-height: 1.8; color: #475569; }
.article-body h2 { font-size: 1.5rem; font-weight: 700; color: #1e293b; margin-top: 2.5rem; margin-bottom: 1rem; line-height: 1.3; }
.article-body h3 { font-size: 1.25rem; font-weight: 600; color: #334155; margin-top: 2rem; margin-bottom: .75rem; line-height: 1.4; }
.article-body p { color: #475569; line-height: 1.8; margin-bottom: 1.25rem; }
.article-body ul, .article-body ol { color: #475569; margin-bottom: 1.25rem; padding-left: 1.5rem; }
.article-body li { margin-bottom: .5rem; }
.article-body strong { color: #1e293b; font-weight: 600; }
.article-body a { color: var(--js-primary); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.article-body a:hover { color: #4338ca; }
.article-body blockquote { border-left: 4px solid #dee2e6; padding-left: 1rem; margin: 1.5rem 0; font-style: italic; color: #6c757d; }
.share-buttons { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1.25rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600; color: white !important; text-decoration: none !important; transition: all 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.share-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); color: white !important; }
.share-btn-facebook { background: #1877f2; }
.share-btn-facebook:hover { background: #0d65d9; }
.share-btn-twitter { background: #0f1419; }
.share-btn-twitter:hover { background: #272c30; }
.share-btn-linkedin { background: #0a66c2; }
.share-btn-linkedin:hover { background: #004182; }
.article-body .article-cta {
    background: linear-gradient(135deg, var(--js-primary) 0%, #7c3aed 100%);
    color: #fff;
    border-radius: var(--js-radius);
    padding: 2rem;
    margin-top: 2.5rem;
    text-align: center;
}
.article-body .article-cta h3 { color: #fff; margin-top: 0; }
.article-body .article-cta p { color: rgba(255,255,255,.85); }
.article-body .article-cta a.btn { text-decoration: none; font-weight: 600; }
.article-body .article-cta .btn-light { color: var(--js-primary); }
.article-body .article-cta .btn-cta-secondary {
    background: rgba(255,255,255,.2);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,.5);
}
.article-body .article-cta .btn-cta-secondary:hover {
    background: rgba(255,255,255,.35);
    color: #fff;
}
.article-listing-card {
    background: #fff;
    border-radius: var(--js-radius);
    box-shadow: var(--js-card-shadow);
    padding: 1.5rem;
    transition: transform .25s, box-shadow .25s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.article-listing-card:hover { transform: translateY(-4px); box-shadow: var(--js-card-hover-shadow); }
.article-listing-card .article-icon {
    width: 48px; height: 48px;
    border-radius: .75rem;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: .75rem;
}
.article-listing-card p { flex-grow: 1; }

/* Breadcrumb */
.breadcrumb { font-size: .875rem; }
.breadcrumb-item a { color: var(--js-primary); text-decoration: none; }

/* Footer */
footer { background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%) !important; }

/* AdSense placeholder */
.adsense-placeholder { border: 1px dashed #cbd5e1; border-radius: .75rem; background: #f8fafc; }

/* ── COOKIE BANNER ─────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 0;
    z-index: 2147483647;
    box-shadow: 0 -4px 24px rgba(0,0,0,.15);
    transform: translateY(100%);
    transition: transform .4s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { font-size: .875rem; margin: 0; }
.cookie-banner a { color: #a5b4fc; }
.cookie-btn {
    border: none;
    border-radius: .5rem;
    padding: .5rem 1.25rem;
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: opacity .15s;
}
.cookie-btn:hover { opacity: .85; }
.cookie-btn-accept { background: var(--js-primary); color: #fff; }
.cookie-btn-refuse { background: transparent; color: #94a3b8; border: 1px solid #475569; }

/* ── PRINT BUTTON ─────────────────────────────── */
.btn-print-icon {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: .25rem;
    border-radius: .375rem;
    transition: color .2s, background .2s;
    line-height: 1;
}
.btn-print-icon:hover { color: var(--js-primary); background: rgba(79,70,229,.08); }

/* ── SEASONAL SECTION ─────────────────────────── */
.seasonal-badge {
    display: inline-block;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1.5px solid #f59e0b;
    padding: .35rem 1.25rem;
    border-radius: 2rem;
    font-size: .85rem;
    font-weight: 600;
    color: #92400e;
    letter-spacing: .02em;
}

/* ── Lazy loading images ── */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}
img[loading="lazy"].loaded,
img[loading="lazy"][complete] {
    opacity: 1;
}

/* ── PRINT STYLES ─────────────────────────────── */
@media print {
    body { background: #fff !important; }
    .navbar, footer, .breadcrumb, .cookie-banner,
    .form-card, .btn-print-icon, .btn-submit, .share-buttons,
    .seo-content, .border-top, .card-hover { display: none !important; }
    .col-lg-7 { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
    .col-lg-5 { display: none !important; }
    .result-card, .card { box-shadow: none !important; border: 1px solid #ddd !important; }
    .result-highlight { background: #f0f0f0 !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .result-highlight small { color: #666 !important; }
    h1 { font-size: 1.5rem !important; }
    main { padding: 0 !important; }
    .container { max-width: 100% !important; }
    .print-header { display: block !important; }
}
