/* ==========================================================================
   LCM CHAUFFAGE — Compléments au style d'origine.
   Ce fichier ne remplace pas style.css : il ajoute ce que les nouvelles
   fonctionnalités exigent (erreurs de formulaire, galerie serveur, RGPD).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FORMULAIRE — retours d'erreur et de succès
   -------------------------------------------------------------------------- */

/* Piège à robots : invisible à l'écran ET pour les lecteurs d'écran,
   mais présent dans le HTML pour que les programmes le remplissent. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-alert {
  background: rgba(227, 6, 19, 0.12);
  border: 1px solid rgba(227, 6, 19, 0.4);
  border-left: 3px solid #e30613;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 26px;
  color: #ffd9dc;
  font-size: 0.92rem;
  line-height: 1.5;
}

.field-error {
  display: block;
  margin-top: 6px;
  color: #ff9ea6;
  font-size: 0.82rem;
  font-weight: 500;
}

.form-control.is-invalid {
  border-color: rgba(227, 6, 19, 0.65) !important;
  background: rgba(227, 6, 19, 0.06) !important;
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.15) !important;
}

.form-fieldset {
  border: 0;
  margin: 0 0 24px;
  padding: 0;
}

.form-fieldset legend {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 500;
}

.form-grid-address {
  grid-template-columns: 2fr 1fr 1.5fr;
}

.form-group-wide {
  grid-column: auto;
}

@media (max-width: 768px) {
  .form-grid-address { grid-template-columns: 1fr; }
}

/* Consentement RGPD */
.consent-group {
  margin: 4px 0 28px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  line-height: 1.6;
  font-weight: 400;
}

.consent-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  accent-color: #39b54a;
  cursor: pointer;
}

.consent-label a {
  color: #00d2ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-legal {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
  text-align: center;
}

/* Bloc de confirmation après envoi */
.form-success {
  text-align: center;
  padding: 20px 10px 10px;
  animation: lcm-fade-up 0.5s ease both;
}

.form-success svg {
  color: #39b54a;
  margin-bottom: 18px;
}

.form-success h3 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 14px;
  line-height: 1.3;
}

.form-success p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 520px;
  margin: 0 auto 12px;
}

.form-success p strong {
  color: #ffd94a;
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  letter-spacing: 0.06em;
}

.form-success-sub {
  font-size: 0.92rem !important;
  color: rgba(255, 255, 255, 0.6) !important;
}

.form-success .btn-gcal {
  margin-top: 18px;
}

.form-success-again {
  display: block;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-success-again:hover { color: #fff; }

@keyframes lcm-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bouton d'envoi pendant le traitement */
.btn-submit[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* --------------------------------------------------------------------------
   2. APERÇU DES RÉALISATIONS SUR L'ACCUEIL
   -------------------------------------------------------------------------- */

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 34px;
}

.preview-item {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.preview-item:hover img { transform: scale(1.06); }

.preview-cta { text-align: center; }

@media (max-width: 640px) {
  .preview-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* --------------------------------------------------------------------------
   3. PAGE RÉALISATIONS
   -------------------------------------------------------------------------- */

.page-realisations { background: var(--bg-primary); color: #fff; min-height: 100vh; margin: 0; }

.real-hero {
  position: relative;
  padding: 140px 20px 80px;
  text-align: center;
  overflow: hidden;
}

.real-hero .hero-bg,
.real-hero .hero-overlay { position: absolute; inset: 0; z-index: 0; }
.real-hero .hero-bg { opacity: 0.45; }
.real-hero .hero-overlay { z-index: 1; }
.real-hero-content { position: relative; z-index: 2; }

.real-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.real-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin: 0 0 16px;
  line-height: 1.1;
}

.real-hero h1 span {
  background: linear-gradient(135deg, var(--color-heating), var(--color-plumbing));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.real-hero p {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.real-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--color-heating), #b2050f);
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
}

.real-hero-cta:hover { opacity: 0.9; transform: translateY(-2px); }

.real-gallery-section {
  padding: 70px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 0;
  margin-bottom: 32px;
  transition: color 0.2s;
}

.back-link:hover { color: #fff; }

.gallery-tab[data-cat="chauffage"].active     { background: linear-gradient(135deg, #e63a2e, #b2050f); }
.gallery-tab[data-cat="sanitaire"].active     { background: linear-gradient(135deg, #2b9ceb, #1a6fa3); }
.gallery-tab[data-cat="ventilation"].active   { background: linear-gradient(135deg, #39b54a, #1e7a2b); }
.gallery-tab[data-cat="climatisation"].active { background: linear-gradient(135deg, #8b5cf6, #5b21b6); }

.gallery-tab .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.72rem;
  font-weight: 700;
}

/* Chaque catégorie est rendue côté serveur ; le JS ne fait que basculer
   la classe « active ». Sans JavaScript, la première catégorie reste
   visible et les autres sont accessibles par leur ancre. */
.gallery-panel { display: none; }
.gallery-panel.active { display: block; animation: lcm-fade-up 0.35s ease both; }

.gallery-grid-page {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.gallery-grid-page .gallery-item {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  background: rgba(255, 255, 255, 0.04);
}

.gallery-grid-page .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.gallery-grid-page .gallery-item:hover img { transform: scale(1.07); }

.gallery-grid-page .gallery-item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 14px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  color: #fff;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
}

.gallery-grid-page .gallery-item:focus-visible {
  outline: 2px solid #00d2ff;
  outline-offset: 3px;
}

.gallery-empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 24px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 768px) {
  .real-hero { padding: 110px 16px 60px; }
  .real-gallery-section { padding: 40px 16px 60px; }
  .gallery-grid-page { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}

/* --------------------------------------------------------------------------
   4. VISIONNEUSE D'IMAGES
   -------------------------------------------------------------------------- */

.lcm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 15, 0.94);
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.lcm-lightbox.visible { opacity: 1; }

.lcm-lightbox img {
  max-width: min(1100px, 94vw);
  max-height: 82vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transition: opacity 0.15s ease;
}

.lcm-lightbox figcaption {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  text-align: center;
  max-width: 80vw;
}

.lcm-lb-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lcm-lb-btn:hover { background: rgba(255, 255, 255, 0.22); }

.lcm-lb-close { top: 22px; right: 22px; }
.lcm-lb-prev  { left: 18px;  top: 50%; transform: translateY(-50%); }
.lcm-lb-next  { right: 18px; top: 50%; transform: translateY(-50%); }

.lcm-lb-counter {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

@media (max-width: 640px) {
  .lcm-lb-prev { left: 8px; }
  .lcm-lb-next { right: 8px; }
  .lcm-lb-btn { width: 40px; height: 40px; }
}

/* --------------------------------------------------------------------------
   5. MENTIONS LÉGALES
   -------------------------------------------------------------------------- */

.page-legal { background: var(--bg-primary); color: #fff; margin: 0; }

.legal-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 130px 24px 80px;
}

.legal-wrapper h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.2;
}

.legal-updated {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  margin: 0 0 44px;
}

.legal-wrapper section {
  margin-bottom: 38px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.legal-wrapper section:last-child { border-bottom: 0; }

.legal-wrapper h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 14px;
}

.legal-wrapper p,
.legal-wrapper li {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.96rem;
  line-height: 1.75;
  margin: 0 0 14px;
}

.legal-wrapper ul { padding-left: 22px; margin-bottom: 16px; }
.legal-wrapper li { margin-bottom: 6px; }
.legal-wrapper strong { color: #fff; }
.legal-wrapper a { color: #00d2ff; text-decoration: underline; text-underline-offset: 2px; }

/* --------------------------------------------------------------------------
   6. PAGE D'ERREUR
   -------------------------------------------------------------------------- */

.page-error {
  background: var(--bg-primary, #0a0f1a);
  color: #fff;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-wrapper { text-align: center; padding: 40px 24px; max-width: 480px; }
.error-logo { width: 80px; margin-bottom: 26px; opacity: 0.9; }

.error-code {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #e30613, #009fe3);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.error-wrapper h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 12px; }
.error-wrapper p { color: rgba(255, 255, 255, 0.65); line-height: 1.6; margin: 0 0 30px; }

.error-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.error-link { color: rgba(255, 255, 255, 0.5); font-size: 0.9rem; text-decoration: underline; text-underline-offset: 3px; }
.error-link:hover { color: #fff; }

/* --------------------------------------------------------------------------
   7. DIVERS
   -------------------------------------------------------------------------- */

.contact-plain { color: rgba(255, 255, 255, 0.85); font-weight: 500; }

.footer-admin-link {
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-admin-link:hover { color: rgba(255, 255, 255, 0.75); }

/* Respect de la préférence système « moins d'animations ». */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
