/* ========================================
   Site Mairie - Styles publics
   ======================================== */

/* Accessibilité - Skip to content */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 0 0 8px 8px;
  z-index: 10000;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* Accessibilité - Focus visible */
*:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Variables */
:root {
  --primary: #1a3a5c;
  --primary-light: #2a5a8c;
  --primary-dark: #0f2540;
  --accent: #c8a84e;
  --accent-light: #e8d08e;
  --bg: #f8f9fa;
  --bg-alt: #eef1f5;
  --text: #2c3e50;
  --text-light: #6c7a89;
  --white: #ffffff;
  --border: #dde2e8;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

img {
  max-width: 100%;
  height: auto;
}

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

a:hover {
  color: var(--primary-light);
}

/* Bannière d'alerte */
.alert-banner {
  padding: 12px 20px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  position: sticky;
  top: 0;
  z-index: 1001;
}

.alert-banner .close-alert {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.7;
}
.alert-banner .close-alert:hover { opacity: 1; }

/* Header */


/* ==========================================
   Navigation
   ========================================== */
.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
}

/* Dropdown - Desktop (hover) */
.has-dropdown {
  position: relative;
}

.dropdown-arrow {
  transition: transform 0.25s;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  list-style: none;
  margin: 0;
  background: #0d1f35;
  border-radius: 0 0 8px 8px;
  min-width: 200px;
  padding: 6px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s;
}

/* Pont invisible pour garder le hover en diagonale */
.has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 12px;
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.has-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-link {
  display: block;
  padding: 10px 20px;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.dropdown-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  -webkit-tap-highlight-color: transparent;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s;
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

/* ==========================================
   Mobile Navigation (<= 768px)
   ========================================== */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0d1f35;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 999;
  }

  .main-nav.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    padding: 14px 20px;
    border-radius: 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .nav-link.active {
    background: rgba(255,255,255,0.08);
  }

  /* Mobile dropdown */
  .has-dropdown::after {
    display: none;
  }

  .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    background: rgba(0,0,0,0.15);
    border-radius: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    pointer-events: auto;
  }

  .has-dropdown.open .dropdown-menu {
    max-height: 300px;
  }

  .has-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
  }

  .dropdown-link {
    padding: 12px 20px 12px 40px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }

  .header-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .site-logo h1 {
    font-size: 1.1rem;
  }
}

.site-header {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: top 0.2s;
}

.header-top {
  background: var(--primary-dark);
  padding: 6px 0;
  font-size: 0.85rem;
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-top a {
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
}

.header-top a:hover {
  color: var(--white);
}

.header-main {
  padding: 16px 0;
  position: relative;
}

.header-main .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--white);
  text-decoration: none;
}
.site-logo:hover {
  color: var(--white);
  opacity: 0.9;
}

.site-logo .logo-icon {
  width: 50px;
  height: 50px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.site-logo .logo-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--accent);
  background: var(--white);
}

.site-logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.site-logo .subtitle {
  font-size: 0.8rem;
  opacity: 0.8;
  font-weight: 400;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}

.hero h2 {
  font-size: 2.2rem;
  margin-bottom: 12px;
  font-weight: 700;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto;
}

/* Hero avec image de fond - page accueil */
.hero-image {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.hero-image .hero-bg {
  position: absolute;
  top: -20%;
  left: 0;
  width: 100%;
  height: 140%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  z-index: 0;
  animation: heroZoomIn 1.2s ease-out forwards;
}

@keyframes heroZoomIn {
  from {
    transform: scale(1.08);
    opacity: 0.7;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.hero-image .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 58, 92, 0.65);
  z-index: 1;
}

.hero-image .hero-content {
  position: relative;
  z-index: 2;
  padding: 80px 20px;
  text-align: center;
  color: var(--white);
  max-width: var(--max-width);
  width: 100%;
  animation: heroFadeUp 0.8s ease-out 0.3s both;
}

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

.hero-image .hero-content h2 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
  letter-spacing: -0.5px;
}

.hero-image .hero-content p {
  font-size: 1.2rem;
  max-width: 650px;
  margin: 0 auto;
  text-shadow: 0 1px 10px rgba(0,0,0,0.3);
  line-height: 1.7;
}

.hero-image .hero-content .hero-cta {
  margin-top: 30px;
}

.hero-infos {
  display: flex;
  gap: 28px;
  margin-top: 30px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.95);
  font-size: 0.95rem;
  background: rgba(255,255,255,0.12);
  padding: 10px 18px;
  border-radius: 30px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.2);
}
.hero-info-item svg {
  flex-shrink: 0;
  opacity: 0.9;
}
a.hero-info-item,
a.hero-info-item:hover,
a.hero-info-item:visited {
  color: rgba(255,255,255,0.95) !important;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
a.hero-info-item:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.5);
}

.hero-image .hero-content .btn {
  text-shadow: none;
}

/* Hero sans image (fallback dégradé bleu) */
.hero-image.no-image .hero-bg {
  display: none;
}

.hero-image.no-image .hero-overlay {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.hero-image.no-image .hero-content h2,
.hero-image.no-image .hero-content p {
  text-shadow: none;
}

@media (max-width: 1080px) {
  .hero-image {
    min-height: 250px;
  }

  .hero-image .hero-content h2 {
    font-size: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-image {
    min-height: 220px;
  }

  .hero-image .hero-content {
    padding: 50px 20px;
  }

  .hero-image .hero-content h2 {
    font-size: 1.8rem;
  }

  .hero-image .hero-content p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-image {
    min-height: 200px;
  }

  .hero-image .hero-content h2 {
    font-size: 1.5rem;
  }
}

/* Sections */
.section {
  padding: 50px 0;
}

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

.section-title {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 30px;
  text-align: center;
  font-weight: 700;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* Séparateur drapeau français */
body.flag-separator .section-title::after {
  width: 72px;
  height: 4px;
  background: linear-gradient(to right, #002395 33.33%, #FFFFFF 33.33%, #FFFFFF 66.66%, #ED2939 66.66%);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

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

/* Grid */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* Accueil - accès rapide */
.quick-access {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.quick-access-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  border: 2px solid transparent;
}

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

.quick-access-card .icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

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

.quick-access-card p {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Mot du maire */
.maire-section {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.maire-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--bg-alt);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--primary);
  border: 4px solid var(--accent);
}

img.maire-photo-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 4px solid var(--accent);
}

.maire-content h3 {
  color: var(--primary);
  font-size: 1.3rem;
  margin-bottom: 5px;
}

.maire-content .maire-name {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 15px;
  display: block;
}

/* Infos pratiques */
.info-box {
  background: var(--white);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px;
  margin-bottom: 20px;
}

.info-box h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.info-box p {
  margin-bottom: 6px;
  color: var(--text);
}

/* Conseil municipal */
.council-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.council-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

.council-card:hover {
  box-shadow: var(--shadow-lg);
}

.council-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  display: block;
  border: 3px solid var(--accent);
}

.council-photo-default {
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--primary);
}

.council-card h3 {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.council-role {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.council-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.5;
}

.info-box .label {
  font-weight: 600;
  color: var(--primary);
}

/* Actualités */
.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.news-header .section-title {
  margin-bottom: 0;
}
.news-header .section-title::after {
  display: none;
}

/* Article mis en avant */
.news-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.3s, transform 0.3s;
  margin-bottom: 24px;
}
.news-featured:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  color: inherit;
}
.news-featured-img {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-alt);
}
.news-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.news-featured:hover .news-featured-img img {
  transform: scale(1.05);
}
.news-featured-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  background: var(--bg-alt);
}
.news-featured-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.news-featured-content h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 14px;
  line-height: 1.3;
}
.news-featured-content p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
}

.news-date-badge {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: capitalize;
}

/* Grille articles secondaires */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.news-grid-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.3s, transform 0.3s;
}
.news-grid-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  color: inherit;
}
.news-grid-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-alt);
}
.news-grid-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.news-grid-card:hover .news-grid-img img {
  transform: scale(1.05);
}
.news-grid-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}
.news-grid-body {
  padding: 18px;
}
.news-grid-body h3 {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1.3;
}
.news-grid-body p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* Legacy news-list (page actualités) */
.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.news-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}
.news-card:hover {
  box-shadow: var(--shadow-lg);
}
.news-card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
}
.news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.news-card:hover .news-card-img img {
  transform: scale(1.05);
}
.news-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  color: var(--text-light);
}
.news-card-body {
  padding: 20px;
}
.news-card .news-date {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 8px;
}
.news-card h3 {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 8px;
}
.news-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* Boutons */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  line-height: 1.4;
}

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

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

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

.btn-accent:hover {
  background: var(--accent-light);
  color: var(--primary-dark);
}

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

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

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

/* Formulaire état civil */
.form-section {
  max-width: 800px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.95rem;
}

.form-group label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition);
  background: var(--white);
  color: var(--text);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}

/* Fix inputs sur iOS Safari */
select.form-control,
input.form-control,
textarea.form-control {
  font-size: 16px; /* empêche le zoom auto sur iOS */
  box-sizing: border-box;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
input[type="date"].form-control {
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px;
  padding: 12px 16px;
}
select.form-control {
  -webkit-appearance: menulist;
  appearance: menulist;
}
.form-row .form-group {
  min-width: 0;
  overflow: hidden;
}

.form-control.error {
  border-color: var(--danger);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-group.has-error .form-error {
  display: block;
}

.form-group.has-error .form-control {
  border-color: var(--danger);
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.form-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.form-fieldset {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 30px;
}

.form-fieldset legend {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
  padding: 0 10px;
}

/* Messages flash */
.flash-message {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-weight: 500;
}

.flash-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.flash-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Page commune */
.commune-intro {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 800px;
}

.commune-history {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin: 30px 0;
}

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

.service-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--primary);
}

.service-card .icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.service-card h3 {
  color: var(--primary);
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.service-card p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Galerie */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4/3;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

.gallery-item {
  cursor: pointer;
  position: relative;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:hover img {
  transform: scale(1.05);
}
.gallery-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  color: white;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.gallery-item:hover .gallery-zoom {
  opacity: 1;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  animation: lightboxFadeIn 0.25s ease;
}
.lightbox.active {
  display: flex;
}
@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  user-select: none;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: white;
  font-size: 42px;
  cursor: pointer;
  z-index: 10001;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  padding: 16px 14px;
  border-radius: 50%;
  z-index: 10001;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
  background: rgba(255,255,255,0.25);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

/* FAQ */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.faq-question {
  padding: 18px 24px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
}

.faq-question:hover {
  background: var(--bg-alt);
}

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--primary);
  transition: transform var(--transition);
}

.faq-item.open .faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
  padding: 0 24px 18px;
  max-height: 500px;
}

/* Footer */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 50px 0 20px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h3 {
  color: var(--accent);
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.footer-col p {
  margin-bottom: 8px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-col a {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}

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

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Confirmation */
.confirmation-box {
  text-align: center;
  padding: 60px 30px;
}

.confirmation-box .icon {
  font-size: 4rem;
  color: var(--success);
  margin-bottom: 20px;
}

.confirmation-box h2 {
  color: var(--primary);
  margin-bottom: 12px;
}

.confirmation-box .reference {
  background: var(--bg-alt);
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary);
  margin: 16px 0;
}

/* Responsive */
/* Tablette + mobile */
@media (max-width: 1025px) {


  .hero h2 {
    font-size: 1.6rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .news-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .news-featured {
    grid-template-columns: 1fr;
  }
  .news-featured-content {
    padding: 24px;
  }
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .council-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-top {
    display: none;
  }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .maire-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .maire-photo, img.maire-photo-img {
    width: 140px;
    height: 140px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .section {
    padding: 35px 0;
  }

  .card {
    padding: 20px;
  }

  .news-list {
    grid-template-columns: 1fr;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .news-featured-content h3 {
    font-size: 1.2rem;
  }

  .council-grid {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }
}

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

  .quick-access {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 40px 0;
  }

  .hero h2 {
    font-size: 1.4rem;
  }

  .btn-lg {
    padding: 14px 28px;
    font-size: 0.95rem;
  }
}

/* Print */
@media print {
  .site-header, .site-footer, .alert-banner, .nav-toggle, .nav-overlay {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .card, .section {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* Bandeau de réassurance */
.reassurance-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.reassurance-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.reassurance-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.reassurance-item strong {
  display: block;
  font-size: 0.85rem;
  color: var(--primary);
}
.reassurance-item span:not(.reassurance-icon) {
  font-size: 0.75rem;
  color: var(--text-light);
}
@media (max-width: 768px) {
  .reassurance-bar {
    gap: 16px;
  }
  .reassurance-item {
    flex: 1 1 calc(50% - 16px);
    min-width: 140px;
  }
}

/* Section histoire avec fond */
.history-with-bg {
  position: relative;
  padding: 80px 0;
}
.history-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 30, 60, 0.7);
  z-index: 1;
}
.history-with-bg .container {
  position: relative;
  z-index: 2;
}
.history-with-bg .commune-history {
  background: rgba(0, 30, 60, 0.6);
  backdrop-filter: blur(2px);
}
.history-with-bg .section-title::after {
  background: rgba(255,255,255,0.5) !important;
}
body.flag-separator .history-with-bg .section-title::after {
  background: linear-gradient(to right, #002395 33.33%, #FFFFFF 33.33%, #FFFFFF 66.66%, #ED2939 66.66%) !important;
}

/* Carrousel d'images historiques */
.history-carousel {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.carousel-track {
  position: relative;
  min-height: 300px;
}
.carousel-slide {
  display: none;
  width: 100%;
}
.carousel-slide.active {
  display: block;
}
.carousel-slide img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}
.carousel-caption {
  text-align: center;
  padding: 12px 20px;
  background: var(--primary);
  color: white;
  font-size: 0.9rem;
  margin: 0;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  padding: 12px 16px;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 3;
  border-radius: 4px;
  transition: background 0.2s;
}
.carousel-btn:hover {
  background: rgba(0,0,0,0.8);
}
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-dots {
  text-align: center;
  padding: 12px;
  background: #f8f8f8;
}
.carousel-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  margin: 0 5px;
  cursor: pointer;
  transition: background 0.2s;
}
.carousel-dot.active {
  background: var(--primary);
}
@media (max-width: 768px) {
  .carousel-slide img {
    height: 250px;
  }
  .history-with-bg {
    background-attachment: scroll !important;
  }
}

/* Cartes cliquables démarches */
.acte-shortcut:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.acte-shortcut:active {
  transform: translateY(-1px);
}

/* ========================================
   Module Salle des fêtes
   ======================================== */

/* Grille des salles (page publique) */
.salles-grid {
  justify-items: center;
  justify-content: center;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 480px));
  gap: 24px;
}

.salle-card {
  width: 100%;
  background: white;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #e0e0e0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.salle-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.salle-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.salle-card-header h3 {
  margin: 0;
  color: #1a3a5c;
  font-size: 1.2rem;
}
.salle-capacity {
  font-size: 0.85rem;
  color: #666;
  white-space: nowrap;
}

.salle-description {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 12px;
}

.salle-address {
  font-size: 0.85rem;
  color: #666;
  margin: 0 0 12px;
}

.salle-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.amenity-tag {
  background: #e3f2fd;
  color: #1a3a5c;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 500;
}

.salle-tarifs-preview {
  border-top: 1px solid #eee;
  padding-top: 12px;
  margin-top: 12px;
}
.salle-tarifs-preview strong {
  font-size: 0.85rem;
  color: #333;
}
.tarif-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 4px 0;
  color: #555;
}
.tarif-price {
  font-weight: 600;
  color: #1a3a5c;
}

/* Détail salle */
.salle-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.content-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #e0e0e0;
}
.content-card h3 {
  margin: 0 0 16px;
  color: #1a3a5c;
  font-size: 1.1rem;
}

/* Tableau tarifs */
.tarifs-table {
  width: 100%;
  border-collapse: collapse;
}
.tarifs-table th,
.tarifs-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}
.tarifs-table th {
  background: #f5f7fa;
  color: #1a3a5c;
  font-weight: 600;
  font-size: 0.8rem;
}

/* Calendrier disponibilités */
.salle-calendar {
  max-width: 100%;
}
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 1rem;
}
.cal-nav {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}
.cal-nav:hover {
  background: #f0f0f0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day-name {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
  padding: 4px;
}
.cal-cell {
  text-align: center;
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}
.cal-empty {
  background: transparent;
}
.cal-past {
  color: #ccc;
  background: #fafafa;
}
.cal-available {
  background: #e8f5e9;
  color: #2e7d32;
}
.cal-reserved {
  background: #ffebee;
  color: #c62828;
}
.cal-pending {
  background: #fff3e0;
  color: #e65100;
}
.cal-blocked {
  background: #eceff1;
  color: #90a4ae;
  text-decoration: line-through;
  cursor: help;
}
.cal-partial {
  background: linear-gradient(135deg, #e8f5e9 50%, #eceff1 50%);
  color: #555;
  cursor: help;
}
.cal-clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cal-clickable:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 1;
  position: relative;
}
.cal-selected {
  background: #1a3a5c !important;
  color: white !important;
  font-weight: 700;
}

/* Formulaire réservation */
#reservationForm fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
#reservationForm legend {
  font-weight: 600;
  color: #1a3a5c;
  padding: 0 8px;
  font-size: 0.95rem;
}
#reservationForm .form-group {
  margin-bottom: 12px;
}
#reservationForm label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: #333;
}
#reservationForm input,
#reservationForm select,
#reservationForm textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
#reservationForm input:focus,
#reservationForm select:focus,
#reservationForm textarea:focus {
  border-color: #1a3a5c;
  outline: none;
  box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}

/* Wizard stepper */
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  gap: 0;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: #aaa;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
}
.wizard-step.active {
  color: #1a3a5c;
  font-weight: 700;
}
.wizard-step.done {
  color: #27ae60;
}
.wizard-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: #e0e0e0;
  color: #999;
  transition: all 0.3s;
}
.wizard-step.active .wizard-step-number {
  background: #1a3a5c;
  color: white;
}
.wizard-step.done .wizard-step-number {
  background: #27ae60;
  color: white;
}
.wizard-step-line {
  flex: 1;
  max-width: 60px;
  height: 2px;
  background: #e0e0e0;
  transition: background 0.3s;
}
.wizard-step-line.done {
  background: #27ae60;
}
.wizard-panel {
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Btn outline */
.btn-outline {
  background: white;
  color: #1a3a5c;
  border: 2px solid #1a3a5c;
}
.btn-outline:hover {
  background: #e3f2fd;
}

/* Toggle réservation journée/créneau */
.resa-type-toggle {
  display: flex;
  gap: 0;
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #1a3a5c;
}
.resa-type-toggle input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.resa-type-toggle label {
  flex: 1;
  text-align: center;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a3a5c;
  background: white;
  transition: all 0.2s;
  margin: 0;
}
.resa-type-toggle label.active {
  background: #1a3a5c;
  color: white;
}
.resa-type-toggle label:hover:not(.active) {
  background: #e3f2fd;
}

/* Status badges pour admin */
.status-nouvelle { background: #fff3e0; color: #e65100; }
.status-contactee { background: #e8eaf6; color: #283593; }
.status-visite { background: #f3e5f5; color: #6a1b9a; }
.status-confirmee { background: #e8f5e9; color: #2e7d32; }
.status-refusee { background: #ffebee; color: #c62828; }
.status-annulee { background: #f5f5f5; color: #666; }
.status-terminee { background: #e3f2fd; color: #1565c0; }

/* Responsive salle */
@media (max-width: 768px) {
  .salles-grid {
  justify-items: center;
  justify-content: center;
    grid-template-columns: 1fr;
  }
  .salle-detail-grid {
    grid-template-columns: 1fr;
  }
  .cal-cell {
    padding: 6px 2px;
    font-size: 0.75rem;
  }
  .wizard-stepper {
    gap: 4px;
  }
  .wizard-step span {
    display: none;
  }
  .wizard-step.active span {
    display: inline;
  }
}


/* Wizard panels (form steps) */
.wz-panel {
  display: block;
}

.wz-panel .form-control {
  width: 100%;
}

.wz-panel select.form-control {
  min-height: 44px;
}


