/* ============================================================
   CarteGrise.live — Design System 2026
   Fluid typography, modern spacing, micro-interactions
   ============================================================ */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --blue-900: #0a1628;
  --blue-700: #0d2b5e;
  --blue-600: #0055d4;
  --blue-500: #2570eb;
  --blue-400: #5b9aff;
  --blue-100: #e8f0fe;
  --blue-50: #f0f5ff;
  --green-600: #0a8a3e;
  --green-100: #e6f9ed;
  --red-600: #dc2626;
  --amber-600: #e6a800;
  --amber-100: #fef3c7;
  --gray-900: #1a1a2e;
  --gray-700: #2a2a4e;
  --gray-600: #4a4a6a;
  --gray-500: #6a6a8a;
  --gray-400: #8a8aaa;
  --gray-200: #e0e0ea;
  --gray-100: #f0f0f5;
  --gray-50: #f7f8fc;
  --white: #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.08);
  --shadow-blue: 0 6px 20px rgba(0,85,212,.15);
  --transition: .2s ease;
  --header-h: 64px;
}

/* ===== RESET & BASE ===== */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); font-size: 16px }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--gray-900);
  line-height: 1.7;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: var(--blue-600); text-decoration: none; transition: color var(--transition) }
a:hover { color: var(--blue-700) }
img { max-width: 100%; height: auto; display: block }
ul, ol { list-style: none }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: -.02em }
/* Fluid type: clamp(min, preferred, max) */
h1 { font-size: clamp(1.6rem, 4vw, 2.8rem) }
h2 { font-size: clamp(1.2rem, 2.5vw, 1.5rem) }
h3 { font-size: clamp(1rem, 2vw, 1.2rem) }
p { font-size: clamp(.9rem, 1.5vw, 1rem) }

/* ===== UTILITIES ===== */
.container { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 24px) }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0 }
.text-center { text-align: center }

/* ===== SKIP LINK (accessibility) ===== */
.skip-link { position: absolute; top: -100px; left: 16px; background: var(--blue-600); color: #fff; padding: 8px 16px; border-radius: var(--radius-sm); z-index: 200; font-weight: 600; transition: top .2s }
.skip-link:focus { top: 8px }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: var(--radius-md); font-weight: 600;
  font-size: .93rem; cursor: pointer; transition: all .25s ease;
  border: 2px solid transparent; text-align: center; white-space: nowrap;
}
.btn-primary { background: var(--blue-600); color: #fff; border-color: var(--blue-600) }
.btn-primary:hover { background: var(--blue-700); border-color: var(--blue-700); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-blue) }
.btn-outline { background: transparent; color: var(--blue-600); border-color: var(--blue-600) }
.btn-outline:hover { background: var(--blue-600); color: #fff }
.btn-white { background: #fff; color: var(--blue-600); border-color: #fff }
.btn-white:hover { background: var(--blue-50); border-color: var(--blue-50); color: var(--blue-700); transform: translateY(-2px); box-shadow: var(--shadow-md) }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); backdrop-filter: blur(8px) }
.btn-ghost:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.35); color: #fff }

/* ===== HEADER / NAV ===== */
.site-header {
  background: rgba(255,255,255,.85); backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,.05);
  position: sticky; top: 0; z-index: 9998;
  height: var(--header-h);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: var(--header-h) }
.logo { font-size: 1.3rem; font-weight: 800; color: var(--gray-900); letter-spacing: -.02em }
.logo span { color: var(--blue-600) }
.nav-links { display: flex; gap: 2px; align-items: center }
.nav-links a {
  padding: 7px 13px; border-radius: var(--radius-sm); font-weight: 500;
  color: var(--gray-600); font-size: .88rem; transition: all var(--transition);
  position: relative;
}
.nav-links a:hover { background: var(--blue-50); color: var(--blue-600) }
.nav-links a.active { background: var(--blue-600); color: #fff }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 10px; border-radius: var(--radius-sm) }
.nav-toggle:hover { background: var(--gray-50) }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--gray-900); margin: 4px 0; border-radius: 2px; transition: all .3s }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 40%, var(--blue-600) 100%);
  color: #fff; padding: clamp(48px, 8vw, 80px) 0 clamp(40px, 7vw, 70px);
  position: relative; overflow: hidden;
}
.hero::before { content: ''; position: absolute; top: -40%; right: -15%; width: 500px; height: 500px; background: radial-gradient(circle, rgba(255,255,255,.05) 0%, transparent 70%); border-radius: 50% }
.hero .container { position: relative; z-index: 1; text-align: center }
.hero h1 { margin-bottom: 14px; font-weight: 800 }
.hero p { font-size: clamp(1rem, 2vw, 1.15rem); max-width: 660px; margin: 0 auto 28px; opacity: .88; line-height: 1.6 }
.hero-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px }
.hero-badge { background: rgba(255,255,255,.1); padding: 8px 18px; border-radius: 50px; font-size: .83rem; border: 1px solid rgba(255,255,255,.12) }

/* ===== BREADCRUMB ===== */
.breadcrumb { padding: 12px 0; font-size: .83rem; color: var(--gray-500); border-bottom: 1px solid var(--gray-100) }
.breadcrumb a { color: var(--blue-600) }
.breadcrumb span { margin: 0 5px; color: var(--gray-200) }

/* ===== SECTIONS ===== */
.section { padding: clamp(40px, 6vw, 72px) 0 }
.section-alt { background: var(--gray-50) }
.section-title { font-weight: 800; margin-bottom: 10px; color: var(--gray-900) }
.section-subtitle { font-size: clamp(.93rem, 1.5vw, 1.05rem); color: var(--gray-500); margin-bottom: 36px; max-width: 600px; line-height: 1.6 }

/* ===== CARDS ===== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px }
.card {
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 28px) clamp(18px, 3vw, 24px);
  transition: all .3s ease; position: relative;
}
.card:hover { border-color: var(--blue-600); box-shadow: var(--shadow-blue); transform: translateY(-3px) }
.card-icon {
  width: 46px; height: 46px; background: linear-gradient(135deg, var(--blue-100), var(--blue-50));
  border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; font-size: 1.25rem;
}
.card h3 { font-size: 1.05rem; margin-bottom: 5px; color: var(--gray-900) }
.card p { color: var(--gray-500); font-size: .9rem; margin-bottom: 12px; line-height: 1.55 }
.card-link { font-weight: 600; font-size: .88rem; color: var(--blue-600); display: inline-flex; align-items: center; gap: 4px; transition: gap .2s }
.card-link:hover { gap: 8px }

/* ===== PRICE COMPONENTS ===== */
.price-tag { display: inline-flex; align-items: baseline; gap: 4px; background: var(--blue-100); color: var(--blue-600); padding: 5px 12px; border-radius: var(--radius-sm); font-weight: 700; font-size: 1.05rem }
.price-tag.free { background: var(--green-100); color: var(--green-600) }
.price-tag small { font-size: .78rem; font-weight: 500; opacity: .7 }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 20px 0 }
.stat-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px; text-align: center; transition: all .3s }
.stat-card:hover { border-color: var(--blue-600); box-shadow: var(--shadow-md) }
.stat-card .stat-value { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; color: var(--blue-600); line-height: 1; margin-bottom: 3px }
.stat-card .stat-value.green { color: var(--green-600) }
.stat-card .stat-label { font-size: .78rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; font-weight: 600 }
.stat-card .stat-desc { font-size: .82rem; color: var(--gray-600); margin-top: 5px; line-height: 1.4 }

/* ===== SIMULATEUR ===== */
.simulateur-box {
  background: var(--white); border: 2px solid var(--blue-600); border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 40px); max-width: 580px; margin: 0 auto;
  box-shadow: 0 8px 32px rgba(0,85,212,.06);
}
.simulateur-box h2 { color: var(--gray-900); margin-bottom: 5px; font-size: clamp(1.2rem, 2.5vw, 1.5rem) }
.simulateur-box p { color: var(--gray-500); margin-bottom: 20px; font-size: .93rem }
.form-group { margin-bottom: 16px }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .88rem; color: var(--gray-900) }
.form-group select, .form-group input {
  width: 100%; padding: 12px 14px; border: 2px solid var(--gray-200); border-radius: var(--radius-md);
  font-size: .93rem; color: var(--gray-900); background: var(--white);
  transition: all var(--transition); font-family: inherit;
}
.form-group select:focus, .form-group input:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(0,85,212,.08) }
.result-box {
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100)); border-radius: var(--radius-lg);
  padding: 24px; text-align: center; margin-top: 20px; display: none; border: 1px solid rgba(0,85,212,.15);
}
.result-box .price { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; color: var(--blue-600) }
.result-box .price-detail { font-size: .86rem; color: var(--gray-600); margin-top: 8px; line-height: 1.6 }

/* ===== FAQ ===== */
.faq-list { max-width: 760px; margin: 0 auto }
.faq-item {
  border: 1px solid var(--gray-200); border-radius: var(--radius-md); margin-bottom: 8px;
  overflow: hidden; background: var(--white); transition: all var(--transition);
}
.faq-item:hover { border-color: rgba(0,85,212,.3) }
.faq-item.open { border-color: var(--blue-600); box-shadow: 0 2px 12px rgba(0,85,212,.06) }
.faq-question {
  width: 100%; background: transparent; border: none; padding: 16px 20px; text-align: left;
  font-size: .97rem; font-weight: 600; color: var(--gray-900); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  transition: all var(--transition); font-family: inherit; line-height: 1.4; gap: 12px;
}
.faq-question:hover { color: var(--blue-600) }
.faq-question::after { content: '+'; font-size: 1.2rem; color: var(--blue-600); font-weight: 300; min-width: 20px; text-align: center; transition: transform .3s }
.faq-item.open .faq-question::after { content: '−' }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .4s ease, padding .3s }
.faq-item.open .faq-answer { max-height: 800px; padding: 0 20px 16px }
.faq-answer p, .faq-answer ul { color: var(--gray-600); font-size: .91rem; line-height: 1.7 }
.faq-answer ul { padding-left: 20px; list-style: disc }
.faq-answer ul li { margin-bottom: 5px }

/* ===== TABLES ===== */
.tarifs-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); background: var(--white); -webkit-overflow-scrolling: touch }
.tarifs-table { width: 100%; border-collapse: collapse; font-size: .91rem }
.tarifs-table th { background: linear-gradient(135deg, var(--blue-900), var(--blue-700)); color: #fff; padding: 13px 16px; text-align: left; font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; position: sticky; top: 0 }
.tarifs-table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-600) }
.tarifs-table tr:last-child td { border-bottom: none }
.tarifs-table tr:hover td { background: var(--gray-50) }
.tarifs-table td:nth-child(2) { font-weight: 700; color: var(--blue-600) }

/* ===== CONTENT PAGES ===== */
.page-hero {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 40%, var(--blue-600) 100%);
  color: #fff; padding: clamp(36px, 5vw, 56px) 0 clamp(30px, 4vw, 48px);
  text-align: center; position: relative; overflow: hidden;
}
.page-hero::before { content: ''; position: absolute; top: -50%; right: -10%; width: 400px; height: 400px; background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%); border-radius: 50% }
.page-hero .container { position: relative; z-index: 1 }
.page-hero h1 { font-weight: 800; margin-bottom: 8px }
.page-hero p { font-size: clamp(.93rem, 1.5vw, 1.05rem); opacity: .85; max-width: 560px; margin: 0 auto }

.content-wrap { display: grid; grid-template-columns: 1fr 280px; gap: clamp(24px, 4vw, 48px); padding: clamp(28px, 4vw, 48px) 0 }
.content-main h2 { font-size: clamp(1.15rem, 2vw, 1.4rem); color: var(--gray-900); margin: 32px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--gray-100) }
.content-main h2:first-of-type { margin-top: 0 }
.content-main h3 { font-size: clamp(1rem, 1.8vw, 1.15rem); color: var(--gray-700); margin: 20px 0 8px }
.content-main p { margin-bottom: 14px; color: var(--gray-600) }
.content-main ul, .content-main ol { padding-left: 22px; margin-bottom: 14px; color: var(--gray-600) }
.content-main ul { list-style: disc }
.content-main ol { list-style: decimal }
.content-main li { margin-bottom: 6px; line-height: 1.6 }
.content-main strong { color: var(--gray-900) }

/* ===== INFO & WARNING BOXES ===== */
.info-box {
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100)); border-left: 4px solid var(--blue-600);
  padding: 18px 22px; border-radius: 0 var(--radius-md) var(--radius-md) 0; margin: 20px 0;
}
.info-box p { color: var(--blue-900); margin: 0; font-size: .91rem }
.warning-box {
  background: linear-gradient(135deg, #fff8e6, var(--amber-100)); border-left: 4px solid var(--amber-600);
  padding: 18px 22px; border-radius: 0 var(--radius-md) var(--radius-md) 0; margin: 20px 0;
}
.warning-box p { color: #7a5a00; margin: 0; font-size: .91rem }

/* ===== SIDEBAR ===== */
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; display: flex; flex-direction: column; gap: 14px }
.sidebar-card {
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  padding: 20px; transition: border-color var(--transition);
}
.sidebar-card:hover { border-color: rgba(0,85,212,.2) }
.sidebar-card h3 { font-size: .97rem; margin-bottom: 10px; color: var(--gray-900) }
.sidebar-card ul { list-style: none }
.sidebar-card ul li { margin-bottom: 7px }
.sidebar-card ul li a { color: var(--gray-600); font-size: .88rem; display: flex; align-items: center; gap: 5px; transition: all var(--transition) }
.sidebar-card ul li a:hover { color: var(--blue-600); transform: translateX(3px) }
.sidebar-cta {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600)); color: #fff;
  border-radius: var(--radius-lg); padding: 24px; text-align: center;
  position: relative; overflow: hidden;
}
.sidebar-cta::before { content: ''; position: absolute; top: -25px; right: -25px; width: 70px; height: 70px; background: rgba(255,255,255,.05); border-radius: 50% }
.sidebar-cta h3 { color: #fff; margin-bottom: 6px; position: relative }
.sidebar-cta p { opacity: .85; font-size: .88rem; margin-bottom: 12px; position: relative }

/* ===== STEPS ===== */
.steps { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 32px }
.step {
  flex: 1; min-width: 200px; max-width: 250px; text-align: center;
  padding: 24px 18px; background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200); transition: all .3s;
}
.step:hover { border-color: var(--blue-600); box-shadow: var(--shadow-md); transform: translateY(-2px) }
.step-number {
  width: 40px; height: 40px; background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: #fff; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.05rem; margin: 0 auto 12px;
}
.step h3 { font-size: .97rem; margin-bottom: 5px; color: var(--gray-900) }
.step p { color: var(--gray-500); font-size: .85rem; line-height: 1.5 }

/* ===== FOOTER ===== */
.site-footer { background: var(--blue-900); color: var(--gray-400); padding: 56px 0 24px }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 36px }
.footer-brand p { margin-top: 12px; font-size: .86rem; line-height: 1.6; color: var(--gray-500) }
.footer-col h4 { color: #fff; font-size: .85rem; margin-bottom: 14px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600 }
.footer-col ul li { margin-bottom: 8px }
.footer-col ul li a { color: var(--gray-400); font-size: .86rem; transition: all var(--transition) }
.footer-col ul li a:hover { color: #fff }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.06); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .8rem; color: rgba(255,255,255,.3) }

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px;
  background: var(--blue-600); color: #fff; border: none; border-radius: 50%;
  cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all .3s; z-index: 90;
  box-shadow: var(--shadow-lg);
}
.back-to-top.visible { opacity: 1; visibility: visible }
.back-to-top:hover { background: var(--blue-700); transform: translateY(-3px) }

/* ===== RESPONSIVE ===== */
@media (max-width: 968px) {
  .content-wrap { grid-template-columns: 1fr }
  .sidebar { position: static; flex-direction: column }
  .footer-grid { grid-template-columns: 1fr 1fr }
}
@media (max-width: 768px) {
  :root { --header-h: 56px }
  .nav-links {
    display: none; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: var(--white);
    flex-direction: column; padding: 24px 20px; gap: 4px;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    z-index: 9999;
  }
  .nav-links.open { display: flex }
  .nav-links a { padding: 18px 20px; font-size: 1.1rem; border-radius: var(--radius-md); border-bottom: 1px solid var(--gray-100) }
  .nav-links a:last-child { border-bottom: none }
  .nav-links a.active { background: var(--blue-600); color: #fff; border-bottom-color: transparent }
  .nav-toggle { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--gray-50); border-radius: var(--radius-sm) }
  .nav-toggle span { width: 22px; height: 2.5px; background: var(--gray-900) }
  .section { padding: clamp(28px, 5vw, 48px) 0 }
  .cards-grid { grid-template-columns: 1fr }
  .footer-grid { grid-template-columns: 1fr }
  .steps { flex-direction: column; align-items: center }
  .simulateur-box { padding: 20px; border-radius: var(--radius-lg) }
  .stats-row { grid-template-columns: 1fr 1fr }
  .tarifs-table { font-size: .82rem }
  .tarifs-table th, .tarifs-table td { padding: 10px 12px }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr }
  .hero-badges { flex-direction: column; align-items: center }
}

/* ===== PRINT ===== */
@media print {
  .site-header,.nav-toggle,.nav-links,.hero-badges,.sidebar,.sidebar-cta,.sidebar-card,.site-footer,.btn,.breadcrumb,.back-to-top,.page-hero::before,.hero::before { display: none !important }
  body { font-size: 11pt; color: #000; background: #fff }
  .page-hero { background: #eee !important; color: #000 !important; padding: 16px 0 !important; -webkit-print-color-adjust: exact }
  .page-hero h1 { color: #000 !important }
  .container { max-width: 100%; padding: 0 16px }
  .content-wrap { display: block !important }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #666 }
  .tarifs-table th { background: #ddd !important; color: #000 !important; -webkit-print-color-adjust: exact }
  .faq-answer { max-height: none !important; padding: 6px 0 !important }
  .faq-question::after { display: none }
  h2 { page-break-after: avoid }
  table, figure { page-break-inside: avoid }
}
