/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937; background: #ffffff; }
img { max-width: 100%; height: auto; display: block; }
a { color: #1e3a5f; text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  --primary: #1e3a5f;
  --primary-light: #2d5a8e;
  --accent: #22c55e;
  --accent-dark: #16a34a;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --radius: 10px;
  --radius-lg: 16px;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.page-content { padding: 2.5rem 0; }

/* ─── Header ─────────────────────────────────────────────────────────────── */
.site-header { background: var(--primary); color: white; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.site-header .container { display: flex; align-items: center; gap: 2rem; padding-top: .75rem; padding-bottom: .75rem; }
.logo { font-size: 1.375rem; font-weight: 700; color: white; letter-spacing: -.5px; }
.logo span { color: var(--accent); }
.main-nav { display: flex; gap: .125rem; flex-wrap: wrap; flex: 1; }
.main-nav a { color: rgba(255,255,255,.85); padding: .375rem .625rem; border-radius: 6px; font-size: .85rem; font-weight: 500; transition: all .15s; white-space: nowrap; }
.main-nav a:hover { background: rgba(255,255,255,.15); color: white; text-decoration: none; }
.nav-toggle { display: none; background: transparent; border: none; color: white; font-size: 1.5rem; cursor: pointer; padding: .25rem; }

/* ─── Breadcrumb ─────────────────────────────────────────────────────────── */
.breadcrumb-bar { background: var(--gray-100); border-bottom: 1px solid var(--gray-200); }
.breadcrumb-bar .container { padding-top: .625rem; padding-bottom: .625rem; font-size: .8rem; color: var(--gray-600); }
.breadcrumb-bar a { color: var(--primary); }
.breadcrumb-bar a:hover { text-decoration: underline; }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; padding: 4rem 0; text-align: center; }
.hero h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.125rem; color: rgba(255,255,255,.85); margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-search { position: relative; max-width: 500px; margin: 0 auto; }
.hero-search input { width: 100%; padding: .875rem 1.25rem; border-radius: 50px; border: none; font-size: 1rem; outline: none; box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.search-dropdown { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: white; border-radius: 12px; box-shadow: var(--shadow-md); overflow: hidden; z-index: 50; }
.search-dropdown a { display: block; padding: .75rem 1rem; color: var(--gray-800); font-size: .9rem; border-bottom: 1px solid var(--gray-100); }
.search-dropdown a:hover { background: var(--gray-50); text-decoration: none; }
.hidden { display: none !important; }

/* ─── Sections ───────────────────────────────────────────────────────────── */
section { padding: 3rem 0; }
section:nth-child(even) { background: var(--gray-50); }
section h2 { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 1.5rem; }

/* ─── Category Cards ─────────────────────────────────────────────────────── */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.category-card { display: flex; flex-direction: column; background: white; border-radius: var(--radius-lg); padding: 1.5rem; border: 1.5px solid var(--gray-200); transition: all .2s; text-decoration: none; color: inherit; }
.category-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.cat-icon { font-size: 2rem; margin-bottom: .75rem; }
.category-card h3 { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: .375rem; }
.category-card p { font-size: .85rem; color: var(--gray-600); flex: 1; }
.cat-count { display: inline-block; margin-top: .75rem; font-size: .75rem; background: var(--gray-100); color: var(--gray-600); padding: .25rem .625rem; border-radius: 999px; font-weight: 600; }

/* ─── Simulator Cards ────────────────────────────────────────────────────── */
.sim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.sim-card { display: flex; flex-direction: column; background: white; border-radius: var(--radius); padding: 1.25rem; border: 1.5px solid var(--gray-200); transition: all .2s; text-decoration: none; color: inherit; }
.sim-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.sim-card h2, .sim-card h3 { font-size: .95rem; font-weight: 600; color: var(--primary); margin-bottom: .375rem; }
.sim-card p { font-size: .8rem; color: var(--gray-600); flex: 1; }
.sim-cta { display: inline-block; margin-top: .75rem; font-size: .8rem; font-weight: 600; color: var(--accent-dark); }

/* ─── Tag Cloud ──────────────────────────────────────────────────────────── */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.tag-cloud a { padding: .375rem .75rem; background: white; border: 1.5px solid var(--gray-200); border-radius: 999px; font-size: .8rem; color: var(--primary); transition: all .15s; }
.tag-cloud a:hover { background: var(--primary); color: white; border-color: var(--primary); text-decoration: none; }

/* ─── Simulator Layout ───────────────────────────────────────────────────── */
.sim-layout { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; align-items: start; }
.sim-main h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; color: var(--primary); margin-bottom: .75rem; }
.sim-desc { color: var(--gray-600); margin-bottom: 1.5rem; font-size: 1rem; }

/* ─── Simulator Widget ───────────────────────────────────────────────────── */
.sim-widget { background: white; border-radius: var(--radius-lg); border: 1.5px solid var(--gray-200); padding: 1.75rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.125rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 600; color: var(--gray-700); margin-bottom: .375rem; }
.form-group input, .form-group select { width: 100%; padding: .625rem .875rem; border: 1.5px solid var(--gray-200); border-radius: 8px; font-size: .95rem; font-family: inherit; color: var(--gray-800); background: white; transition: border-color .15s; outline: none; }
.form-group input:focus, .form-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.1); }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn { display: inline-block; padding: .75rem 1.5rem; border-radius: 8px; font-size: .95rem; font-weight: 600; cursor: pointer; border: none; transition: all .15s; text-decoration: none; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; text-decoration: none; }

/* ─── Result ─────────────────────────────────────────────────────────────── */
.sim-result { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); border: 2px solid #86efac; border-radius: var(--radius); padding: 1.5rem; margin-top: 1rem; }
.sim-result .result-value { font-size: 2rem; font-weight: 700; color: var(--accent-dark); display: block; }
.sim-result .result-label { font-size: .875rem; color: #15803d; }
.sim-result .result-explanation { margin-top: .75rem; color: var(--gray-700); font-size: .9rem; line-height: 1.6; }
.sim-result .result-details { margin-top: 1rem; }
.sim-result .result-details li { padding: .25rem 0; font-size: .85rem; color: var(--gray-700); border-bottom: 1px solid #bbf7d0; }
.sim-result .result-details li:last-child { border-bottom: none; }
.sim-result.loading { background: var(--gray-50); border-color: var(--gray-200); }
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Result Highlight (SEO pages) ──────────────────────────────────────── */
.result-highlight { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border: 2px solid #93c5fd; border-radius: var(--radius-lg); padding: 1.75rem; margin-bottom: 2rem; display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.result-main { text-align: center; min-width: 160px; }
.result-value { font-size: 2.5rem; font-weight: 700; color: var(--primary); display: block; }
.result-label { font-size: .875rem; color: #2563eb; font-weight: 600; }
.result-detail p { margin-bottom: .375rem; font-size: .9rem; color: var(--gray-700); }
.result-note { font-size: .8rem; color: var(--gray-600); margin-top: .5rem; font-style: italic; }

/* ─── Disclaimers ────────────────────────────────────────────────────────── */
.disclaimer-box { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; padding: 1rem 1.25rem; font-size: .85rem; color: #92400e; margin-bottom: 1rem; }
.rates-info { font-size: .8rem; color: var(--gray-400); margin-bottom: 1.5rem; }

/* ─── SEO Content ────────────────────────────────────────────────────────── */
.seo-content { margin-top: 2.5rem; }
.seo-content h2 { font-size: 1.25rem; font-weight: 700; color: var(--primary); margin: 2rem 0 .75rem; }
.seo-content p { margin-bottom: 1rem; color: var(--gray-700); line-height: 1.7; }
.seo-content ul, .seo-content ol { margin: .75rem 0 1rem 1.25rem; }
.seo-content li { margin-bottom: .375rem; color: var(--gray-700); }

/* ─── FAQ ────────────────────────────────────────────────────────────────── */
.faq-section { margin-top: 2.5rem; }
.faq-section h2 { font-size: 1.25rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; }
.faq-item { border: 1.5px solid var(--gray-200); border-radius: 8px; margin-bottom: .625rem; overflow: hidden; }
.faq-item summary { padding: 1rem 1.25rem; font-weight: 600; cursor: pointer; color: var(--gray-800); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::after { content: '+'; font-size: 1.25rem; color: var(--primary); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: .75rem 1.25rem 1rem; color: var(--gray-700); font-size: .9rem; background: var(--gray-50); }

/* ─── Related ────────────────────────────────────────────────────────────── */
.related-section { margin-top: 2.5rem; }
.related-section h2 { font-size: 1.125rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.related-card { display: flex; flex-direction: column; padding: 1rem; background: white; border: 1.5px solid var(--gray-200); border-radius: 8px; font-size: .875rem; color: inherit; transition: all .15s; }
.related-card:hover { border-color: var(--primary); text-decoration: none; }
.related-card strong { color: var(--primary); margin-bottom: .25rem; }
.related-card span { color: var(--gray-600); font-size: .8rem; }

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sim-sidebar { position: sticky; top: 80px; }
.sidebar-widget { background: white; border-radius: var(--radius); border: 1.5px solid var(--gray-200); padding: 1.25rem; margin-bottom: 1.25rem; }
.sidebar-widget h3 { font-size: .9rem; font-weight: 700; color: var(--primary); margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 2px solid var(--gray-100); }
.sidebar-widget ul li { margin-bottom: .5rem; }
.sidebar-widget ul li a { font-size: .85rem; color: var(--gray-700); }
.sidebar-widget ul li a:hover { color: var(--primary); }

/* ─── Articles ───────────────────────────────────────────────────────────── */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.article-card { background: white; border-radius: var(--radius); border: 1.5px solid var(--gray-200); overflow: hidden; transition: box-shadow .2s; }
.article-card:hover { box-shadow: var(--shadow-md); }
.article-card img { width: 100%; height: 180px; object-fit: cover; }
.article-card > div:not(.article-meta) { padding: 1.25rem; }
.article-card .article-meta { padding: .75rem 1.25rem 0; display: flex; gap: .75rem; align-items: center; }
.article-cat { background: var(--gray-100); color: var(--primary); font-size: .75rem; font-weight: 600; padding: .25rem .625rem; border-radius: 999px; }
.article-card time { font-size: .8rem; color: var(--gray-400); }
.article-card h2 { font-size: 1rem; font-weight: 600; color: var(--gray-800); margin: .5rem 1.25rem .375rem; }
.article-card p { font-size: .85rem; color: var(--gray-600); margin: 0 1.25rem .75rem; }
.article-card .read-more { display: block; margin: 0 1.25rem 1.25rem; font-size: .85rem; font-weight: 600; color: var(--accent-dark); }
.article-full h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; color: var(--primary); margin-bottom: 1rem; }
.article-full .article-meta { margin-bottom: 1.5rem; display: flex; gap: .75rem; align-items: center; }
.article-hero-img { width: 100%; border-radius: var(--radius); margin-bottom: 1.5rem; max-height: 400px; object-fit: cover; }
.article-content { line-height: 1.8; color: var(--gray-700); }
.article-content h2 { font-size: 1.25rem; font-weight: 700; color: var(--primary); margin: 1.5rem 0 .75rem; }
.article-content p { margin-bottom: 1rem; }
.article-content ul, .article-content ol { margin: .75rem 0 1rem 1.25rem; }
.article-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--gray-200); font-size: .85rem; color: var(--gray-600); font-style: italic; }
.related-articles { margin-top: 2rem; }
.related-articles h3 { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: .75rem; }
.related-articles ul { padding-left: 1.25rem; list-style: disc; }
.related-articles ul li { margin-bottom: .375rem; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.data-table th { background: var(--primary); color: white; padding: .75rem 1rem; text-align: left; font-weight: 600; }
.data-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--gray-100); }
.data-table tr:hover td { background: var(--gray-50); }

/* ─── Tableau mensualités ────────────────────────────────────────────────── */
.tableau-mensualites { margin-bottom: 2rem; }
.tableau-mensualites h2 { font-size: 1.125rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; }

/* ─── Internal links ─────────────────────────────────────────────────────── */
.internal-links { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-200); }
.internal-links h3 { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: .75rem; }

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 2rem; }

/* ─── Latest articles ────────────────────────────────────────────────────── */
.latest-articles { text-align: center; }
.latest-articles .btn { margin-top: 1.5rem; }
#latest-articles-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1rem; }

/* ─── Category page ──────────────────────────────────────────────────────── */
.category-desc { font-size: 1.05rem; color: var(--gray-600); margin-bottom: 2rem; }

/* ─── Legal pages ────────────────────────────────────────────────────────── */
.legal-page h1 { font-size: 1.75rem; font-weight: 700; color: var(--primary); margin-bottom: 1.5rem; }
.legal-page h2 { font-size: 1.125rem; font-weight: 600; color: var(--gray-800); margin: 1.5rem 0 .625rem; }
.legal-page p { margin-bottom: .875rem; color: var(--gray-700); line-height: 1.7; }
.legal-page ul { margin: .5rem 0 1rem 1.25rem; list-style: disc; }
.legal-page ul li { margin-bottom: .375rem; color: var(--gray-700); }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { background: #0f1f35; color: rgba(255,255,255,.75); padding: 3rem 0 1.5rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.site-footer strong { color: white; display: block; margin-bottom: .75rem; font-size: .95rem; }
.site-footer p { font-size: .85rem; line-height: 1.6; }
.site-footer ul li { margin-bottom: .375rem; }
.site-footer ul li a { color: rgba(255,255,255,.7); font-size: .85rem; }
.site-footer ul li a:hover { color: white; text-decoration: none; }
.rates-update { font-size: .78rem; color: rgba(255,255,255,.5); margin-top: .5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.25rem; text-align: center; font-size: .8rem; color: rgba(255,255,255,.5); }
.footer-bottom a { color: rgba(255,255,255,.6); }
.disclaimer { margin-top: .375rem; font-size: .78rem; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sim-layout { grid-template-columns: 1fr; }
  .sim-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .main-nav { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--primary); padding: 1rem; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .625rem 1rem; width: 100%; }
  .nav-toggle { display: block; }
  .site-header .container { position: relative; }
  .hero { padding: 2.5rem 0; }
  .sim-sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .result-highlight { flex-direction: column; gap: 1rem; }
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .sim-widget { padding: 1.25rem; }
  .articles-grid { grid-template-columns: 1fr; }
}
