/* ===================================================
   ACFL Chauffage - Global CSS v5.1
   Maison / Travaux / Énergie - Couleurs plates uniquement
   =================================================== */

/* --- Variables CSS --- */
:root {
  --color-primary:      #1d4ed8;
  --color-primary-dark: #0f2d6e;
  --color-primary-light:#dbeafe;
  --color-accent:       #9a3412;
  --color-accent-light: #fff7ed;
  --color-cream:        #fff7ed;
  --color-text:         #1e293b;
  --color-text-muted:   #64748b;
  --color-bg:           #f8fafc;
  --color-white:        #ffffff;
  --color-border:       #e2e8f0;
  --color-success:      #16a34a;
  --color-warning:      #d97706;
  --radius-sm:          4px;
  --radius-md:          8px;
  --radius-lg:          12px;
  --radius-xl:          20px;
  --shadow-sm:          0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:          0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:          0 8px 32px rgba(0,0,0,0.12);
  --font-system:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --max-width:          1200px;
  --max-width-content:  860px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-system);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Anti-overflow global --- */
img, video, iframe, embed, object, canvas, svg {
  max-width: 100%;
  height: auto;
}

img {
  display: block;
}

/* --- Typographie --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-system);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h4 { font-size: 1.1rem; }

p {
  line-height: 1.75;
  color: var(--color-text);
}

a {
  color: var(--color-primary);
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent);
}

/* --- Conteneurs --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.container-narrow {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* --- Tableaux responsive --- */
.table-responsive,
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  margin: 24px 0;
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th {
  background-color: var(--color-primary);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: top;
}

table tr:last-child td {
  border-bottom: none;
}

table tr:nth-child(even) td {
  background-color: #f1f5f9;
}

/* --- Boutons globaux --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-system);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  line-height: 1.2;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: #1e40af;
  color: #fff;
  border-color: #1e40af;
}

.btn-accent {
  background-color: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.btn-accent:hover {
  background-color: #7c2d12;
  color: #fff;
  border-color: #7c2d12;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: #fff;
}

/* --- Badges / Tags --- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-primary {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.badge-accent {
  background-color: #fee2e2;
  color: var(--color-accent);
}

.badge-green {
  background-color: #dcfce7;
  color: #15803d;
}

/* --- Section standard --- */
.section {
  padding: 64px 0;
}

.section-alt {
  background-color: var(--color-cream);
}

.section-dark {
  background-color: var(--color-primary-dark);
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text);
}

.section-title.white {
  color: #fff;
}

.section-subtitle {
  font-size: 16px;
  color: var(--color-text-muted);
  margin-bottom: 40px;
  max-width: 600px;
}

.section-subtitle.white {
  color: #a5b4fc;
}

/* --- Cards --- */
.card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* --- Formulaires --- */
input, textarea, select {
  font-family: var(--font-system);
  font-size: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  color: var(--color-text);
  background-color: var(--color-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

/* --- Utilitaires --- */
.text-center { text-align: center; }
.text-muted   { color: var(--color-text-muted); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --- Focus visible global --- */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

/* --- Responsive global --- */
@media (max-width: 768px) {
  body { overflow-x: hidden; }

  .container,
  .container-narrow {
    padding: 0 16px;
  }

  .section {
    padding: 40px 0;
  }

  .grid,
  [class*='grid'] {
    grid-template-columns: 1fr !important;
  }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.1rem; }

  .btn {
    width: 100%;
    justify-content: center;
  }

  table {
    font-size: 13px;
  }

  table th,
  table td {
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .container,
  .container-narrow {
    padding: 0 12px;
  }

  .section {
    padding: 32px 0;
  }

  h1 { font-size: 1.6rem; }
}