/* ===== styles.css – Fichier de styles communs DS.BAT ===== */
/* Version unifiée – À utiliser sur toutes les pages */

/* ---------- VARIABLES (clair/sombre) ---------- */
:root {
  color-scheme: light dark;
  
  /* Couleurs */
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-light: #334155;
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-dark: #0f2b5e;
  --secondary: #c59d5f;
  --accent: #16a34a;
  --border: #e2e8f0;
  
  /* Ombres */
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 28px rgba(0,0,0,0.12);
  --shadow-hover: 0 20px 32px rgba(0,0,0,0.18);
  
  /* Bordures */
  --radius-sm: 12px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --radius-xl: 60px;
  
  /* Animations */
  --transition: 0.2s ease;
}

/* Mode sombre automatique */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #1e293b;
    --surface-2: #2d3a4f;
    --text: #f1f5f9;
    --text-light: #cbd5e1;
    --border: #334155;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-md: 0 6px 18px rgba(0,0,0,0.6);
    --shadow-lg: 0 16px 28px rgba(0,0,0,0.7);
  }
}

/* ---------- RESET & BASE ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
}

main {
  flex: 1;
}

a {
  transition: var(--transition);
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 4px solid var(--secondary);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---------- UTILITAIRES ---------- */
.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 30px 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.section {
  margin-bottom: 60px;
  text-align: center;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s, transform 0.8s;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section p {
  max-width: 800px;
  margin: 12px auto 0;
  line-height: 1.6;
  color: var(--text-light);
}

/* ---------- MENU BURGER ---------- */
.menu-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  font-size: 26px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  z-index: 1001;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.menu-btn:hover {
  background: var(--primary-light);
  transform: scale(0.98);
}

.menu-btn:focus-visible {
  outline: 3px solid var(--secondary);
}

.menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100%;
  background: #0f172a;
  padding-top: 80px;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.3);
}

.menu.open {
  right: 0;
}

.menu a {
  display: block;
  padding: 18px 24px;
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 500;
  transition: padding-left 0.2s;
}

.menu a:hover {
  background: var(--primary);
  padding-left: 32px;
}

/* ---------- HERO ---------- */
.hero {
  height: 45vh;
  min-height: 280px;
  background: linear-gradient(135deg, rgba(10,20,40,0.9), rgba(10,20,40,0.6)),
              var(--hero-image, url('image/uploads/chantier-verriere.webp')) center 30% / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  padding: 20px;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.95;
  background: rgba(0,0,0,0.2);
  padding: 8px 24px;
  border-radius: var(--radius-xl);
  backdrop-filter: blur(4px);
}

/* ---------- BOUTONS ---------- */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius-xl);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-size: 1rem;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--text);
}

.btn-secondary:hover {
  background: #d4aF6f;
  transform: translateY(-2px);
}

.btn-phone {
  background: var(--secondary);
  color: #0f172a;
}

.btn-whatsapp {
  background: #25D366;
  color: white;
}

.btn-pdf {
  background: #ef4444;
  color: white;
}

/* ---------- CARTES & GRILLES ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.card {
  background: var(--surface);
  padding: 25px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.card h3 {
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 1.3rem;
}

/* ---------- BADGES ---------- */
.badges {
  background: var(--surface-2);
  padding: 20px;
  border-radius: var(--radius-xl);
  margin: 30px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.badge {
  background: var(--primary-dark);
  color: white;
  padding: 8px 20px;
  border-radius: var(--radius-xl);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ---------- ZONE SHORT ---------- */
.zone-short {
  background: var(--surface-2);
  padding: 24px;
  border-radius: var(--radius-xl);
  margin-top: 40px;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  border-left: 6px solid var(--secondary);
  text-align: center;
}

/* ---------- CTA ---------- */
.cta {
  background: #0f172a;
  color: white;
  text-align: center;
  padding: 70px 20px;
  border-radius: var(--radius-lg);
}

/* ---------- FORMULAIRES ---------- */
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 600px;
  margin: 20px auto;
}

input, select, textarea {
  padding: 14px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  width: 100%;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

/* ---------- COMPOSANTS DEVIS ---------- */
.devis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px dashed var(--border);
}

.devis-numero {
  background: var(--primary);
  color: white;
  padding: 8px 20px;
  border-radius: var(--radius-xl);
  font-weight: 700;
}

.devis-date {
  color: var(--text-light);
  font-weight: 500;
}

.recap-chantier {
  background: var(--surface-2);
  padding: 25px;
  border-radius: var(--radius-md);
  margin-bottom: 30px;
  border: 1px solid var(--border);
}

.recap-chantier h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  margin-bottom: 20px;
}

.grille-recap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.btn-modifier {
  background: var(--primary);
  color: white;
  padding: 8px 20px;
  border-radius: var(--radius-xl);
  font-size: 0.9rem;
  display: inline-block;
}

.options-globales {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 30px;
  background: var(--surface-2);
  padding: 20px;
  border-radius: var(--radius-md);
}

.radio-group {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: var(--surface);
  padding: 10px 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  font-weight: 500;
}

.radio-group input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.btn-norme {
  background: var(--primary);
  color: white;
  padding: 12px 28px;
  border-radius: var(--radius-xl);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  margin-left: auto;
}

.btn-norme:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

.prestations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.prestation-item {
  background: var(--surface-2);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.prestation-item:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.prestation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-weight: 600;
}

.prestation-prix {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.9rem;
}

.quantite-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantite-input input {
  width: 80px;
  padding: 10px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

.recap {
  margin-top: 40px;
  background: var(--surface-2);
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--primary);
}

.recap-ligne {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}

.recap-ligne:last-of-type {
  border-bottom: none;
}

.total-wrapper {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 15px;
  margin: 20px 0;
}

.total {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
}

.acomptes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.acompte-badge {
  background: var(--surface);
  padding: 10px 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  font-weight: 600;
}

/* ---------- GALERIE ---------- */
.galerie {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.projet {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.projet:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.projet img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.projet-info {
  padding: 20px;
  text-align: left;
}

.projet-info h3 {
  color: var(--primary);
  margin-bottom: 8px;
}

/* ---------- MAP ---------- */
.map {
  margin-top: 30px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.map iframe {
  width: 100%;
  height: 360px;
  border: 0;
}

/* ---------- WHATSAPP FLOTTANT ---------- */
.whatsapp-float {
  position: fixed;
  width: 64px;
  height: 64px;
  bottom: 24px;
  right: 24px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1002;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  transition: transform 0.25s, box-shadow 0.25s;
}

.whatsapp-float:hover {
  transform: scale(1.12);
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.5);
}

.whatsapp-float img {
  width: 36px;
  height: 36px;
  filter: brightness(0) invert(1);
}

/* ---------- QR CODE ---------- */
.qrcode-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 30px 0 20px;
  flex-wrap: wrap;
}

.qrcode-img {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
}

.qrcode-img:hover {
  transform: scale(1.05);
}

.qrcode-text {
  color: var(--text-light);
  font-size: 0.95rem;
  max-width: 250px;
  line-height: 1.5;
}

/* ---------- FOOTER ---------- */
footer {
  background: #020617;
  color: #cbd5e1;
  text-align: center;
  padding: 25px;
  margin-top: 30px;
}

footer a {
  color: var(--secondary);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

footer a:hover {
  border-bottom-color: var(--secondary);
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
    padding: 6px 16px;
  }
  
  .container {
    padding: 20px 15px;
    margin: 20px 15px;
  }
  
  .total {
    font-size: 2.4rem;
  }
  
  .options-globales {
    flex-direction: column;
    align-items: stretch;
  }
  
  .btn-norme {
    margin-left: 0;
    width: 100%;
  }
  
  .qrcode-container {
    flex-direction: column;
    text-align: center;
  }
  
  .map iframe {
    height: 280px;
  }
}

@media (max-width: 480px) {
  .hero {
    height: 35vh;
    min-height: 220px;
  }
  
  .hero h1 {
    font-size: 1.6rem;
  }
  
  .hero p {
    font-size: 0.9rem;
  }
  
  .badges {
    flex-direction: column;
    align-items: stretch;
  }
  
  .badge {
    text-align: center;
  }
  
  .total {
    font-size: 2rem;
  }
}