/* Design system */
:root {
  --bg: #f7fafc;
  --panel: #ffffff;
  --text: #0b1b2b;
  --muted: #557086;
  --brand: #0e3a5f;
  --brand-2: #12a4d9;
  --ok: #1f9d55;
  --warn: #f0b429;
  --danger: #e53e3e;
  --shadow: 0 8px 24px rgba(10, 37, 64, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --gap: 1.25rem;
  --container: 1160px;
}

/* Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1rem; }
.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6rem 0; }
h1 { font-size: clamp(1.8rem, 2.6vw + 1rem, 3rem); }
h2 { font-size: clamp(1.3rem, 1.2vw + .9rem, 2rem); margin-top: 2rem; }
h3 { font-size: 1.1rem; margin-top: 1rem; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem .75rem; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.visually-hidden { position: absolute !important; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; width: 1px; overflow: hidden; white-space: nowrap; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.9); backdrop-filter: saturate(150%) blur(6px); border-bottom: 1px solid #e7edf3; }
.header-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; height: 64px; }
.logo { font-weight: 800; color: var(--text); letter-spacing: .2px; }
.logo span { color: var(--brand-2); }
.nav { justify-self: center; }
.menu { display: flex; list-style: none; gap: 1rem; padding: 0; margin: 0; }
.menu > li { display: flex; align-items: center; gap: .25rem; }
.menu a { padding: .5rem .75rem; border-radius: 10px; }
.menu a:hover { background: #eef6fb; text-decoration: none; }
.menu .is-active a, .menu a[aria-current="page"] { background: #e6f4ff; color: #0b3d6b; }
.menu li { position: relative; }
.menu .has-submenu > .submenu-link { display: inline-flex; align-items: center; gap: .25rem; }
.submenu { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid #e7edf3; border-radius: 12px; box-shadow: var(--shadow); padding: .5rem; min-width: 280px; z-index: 45; }
.submenu li { list-style: none; }
.submenu a { display: block; padding: .5rem .75rem; border-radius: 8px; color: var(--text); }
.submenu a:hover { background: #f2f8fd; text-decoration: none; }
.menu .has-submenu:hover > .submenu, .menu .has-submenu:focus-within > .submenu { display: grid; grid-template-columns: 1fr; gap: .25rem; }
.submenu-caret { display: none; }
.header-cta .phone-top { 
  font-weight: 700; 
  color: var(--brand);
  border: 2px solid var(--brand);
  padding: .45rem .75rem;
  border-radius: 12px;
  background: #ffffff;
  transition: background-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.header-cta .phone-top:hover { 
  background: #e6f4ff; 
  text-decoration: none; 
}
.header-cta .phone-top:focus { 
  outline: 2px solid #9bd4ff; 
  outline-offset: 2px; 
}

.burger { display: none; border: 0; background: transparent; padding: .5rem; border-radius: 10px; }
.burger:focus { outline: 2px solid #9bd4ff; }
.burger-line { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; transition: transform .2s ease; }

/* Hero */
.hero { background: radial-gradient(1200px 600px at 20% -10%, #eaf7ff 0%, rgba(234,247,255,0) 70%),
                    radial-gradient(900px 500px at 90% 10%, #f7fff3 0%, rgba(247,255,243,0) 60%); padding: 3rem 0; }
.hero .badges { display: flex; flex-wrap: wrap; gap: .5rem 1rem; color: var(--muted); padding: 0; margin: 1rem 0; list-style: none; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.actions.center { justify-content: center; }
.btn { display: inline-block; padding: .75rem 1rem; border-radius: 12px; background: #e9f3fb; color: var(--brand); font-weight: 700; border: 1px solid #cae6fb; }
.btn:hover { background: #dff0ff; text-decoration: none; }
.btn.primary { background: linear-gradient(180deg, #12a4d9, #0e78b1); border-color: #0e78b1; color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: #b9d8ee; color: var(--brand); }

/* Hero rotator (square, non déformé) */
.hero-media { width: 100%; }
.hero-rotator { width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; border: 1px solid #e1ebf4; box-shadow: var(--shadow); background: #eef3f7; }
.hero-rotator-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .25s ease; }

/* Sections */
.section-intro { max-width: 60ch; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin: 1rem 0 2rem; }
.card { background: var(--panel); border: 1px solid #e9eef3; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); padding-bottom: 1rem; }
.card img { aspect-ratio: 1/1; object-fit: cover; width: 100%; height: auto; background: #eef3f7; }
.card h3, .card h2 { padding: .75rem 1rem 0; }
.card p, .card ul { padding: 0 1rem; margin: .5rem 0; color: var(--muted); }
.card.disabled { opacity: .6; pointer-events: none; }

/* Liste de liens de services (aperçu accueil) */
.service-list { display: flex; flex-wrap: wrap; gap: .5rem .75rem; list-style: none; padding: 0; margin: .5rem 0 1.5rem; }
.service-list a { display: inline-block; padding: .4rem .6rem; border: 1px solid #e1ebf4; border-radius: 10px; background: #fff; color: var(--brand); }
.service-list a:hover { background: #f2f8fd; text-decoration: none; }
.list { padding-left: 1.1rem; }

.portfolio-preview .gallery.grid, .gallery.grid { grid-template-columns: repeat(4, 1fr); }
.gallery a { display: block; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid #e7edf3; background: #f5f9fc; aspect-ratio: 1/1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }

.cta .cta-box { background: linear-gradient(180deg, #ffffff 0%, #f3fbff 100%); border: 1px solid #ddebfa; border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; text-align: center; }
.cta .actions { justify-content: center; }

/* Footer */
.site-footer { margin-top: 3rem; padding: 2rem 0; background: #0b2034; color: #dfeaf5; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: 2fr 1fr 1fr; align-items: start; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links a { color: #dfeaf5; }
.footer-phone { color: #fff; font-weight: 700; }
.site-footer a[href^="mailto:"] { color: #ffffff; }
.site-footer a[href^="mailto:"]:hover { text-decoration: underline; }
.tiny { font-size: .875rem; color: #b8d1e6; }

/* Forms */
.form { display: grid; gap: 1rem; background: var(--panel); border: 1px solid #e9eef3; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form label { display: grid; gap: .4rem; font-weight: 600; }
input, select, textarea { width: 100%; padding: .75rem .8rem; border: 1px solid #cfe1ef; border-radius: 10px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid #9bd4ff; border-color: #86c7ee; }
input:invalid[aria-invalid="true"], textarea:invalid[aria-invalid="true"], select:invalid[aria-invalid="true"] { border-color: var(--danger); background: #fff5f5; }
.form-note { margin: .5rem 0 0; color: var(--muted); }
.form-status { min-height: 1.2rem; font-weight: 600; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }

/* Page header */
.page-header { margin: 1.5rem 0 1rem; }

/* FAQ (accordéon) */
.faq { font-size: 1.06rem; }
.faq details { 
  background: var(--panel);
  border: 1px solid #e9eef3; 
  border-radius: var(--radius);
  padding: .9rem 1rem; 
  margin: .6rem 0; 
  box-shadow: var(--shadow);
}
.faq summary { 
  list-style: none; 
  cursor: pointer; 
  font-weight: 700; 
  display: flex; 
  align-items: center; 
  gap: .6rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details summary::after { 
  content: '▸'; 
  margin-left: auto; 
  color: var(--muted); 
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(90deg); }
.faq .answer { margin-top: .6rem; color: var(--muted); }
.faq summary:focus-visible { outline: 2px solid #9bd4ff; outline-offset: 2px; border-radius: 8px; }

/* FAB phone & To top */
.phone-fab { position: fixed; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 50%; background: #0e78b1; color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); font-size: 24px; z-index: 40; }
.phone-fab:hover { filter: brightness(1.05); text-decoration: none; }
/* Subtle attention animation */
.phone-fab { animation: phone-breath 4s ease-in-out infinite; position: fixed; }
.phone-fab::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(18,164,217,.35); animation: phone-ring 2.6s ease-out infinite; pointer-events: none; }
@keyframes phone-breath { 0%, 100% { transform: scale(1); box-shadow: var(--shadow); } 50% { transform: scale(1.03); box-shadow: 0 10px 26px rgba(14,120,177,.25); } }
@keyframes phone-ring { 0% { transform: scale(.9); opacity: .65; } 70% { transform: scale(1.35); opacity: 0; } 100% { transform: scale(1.35); opacity: 0; } }
/* Reduce motion accessibility */
@media (prefers-reduced-motion: reduce) {
  .phone-fab, .phone-fab::after { animation: none !important; }
}
.to-top { position: fixed; right: 16px; bottom: 86px; padding: .6rem .7rem; border-radius: 10px; border: 0; background: #0b2034; color: #fff; box-shadow: var(--shadow); z-index: 40; opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; }
.to-top.show { opacity: 1; transform: translateY(0); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(4, 14, 24, .85); display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto 1fr auto; gap: 1rem; align-items: center; justify-items: center; z-index: 50; }
.lightbox[hidden] { display: none; }
.lightbox-content { margin: 0; max-width: min(92vw, 1200px); max-height: 86vh; display: grid; place-items: center; }
.lightbox-content img { max-width: 100%; max-height: 86vh; border-radius: 8px; }
.lightbox-close, .lightbox-prev, .lightbox-next { position: relative; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 44px; height: 44px; border-radius: 8px; font-size: 26px; display: grid; place-items: center; }
.lightbox-prev, .lightbox-next { font-weight: 700; }
.lightbox-close { grid-column: 3; grid-row: 1; margin: 1rem; }
.lightbox-prev { grid-column: 1; grid-row: 2; }
.lightbox-next { grid-column: 3; grid-row: 2; }

/* Skeleton */
.skeleton { position: relative; }
.skeleton img { background: linear-gradient(90deg, #eff4f8, #f7fbff, #eff4f8); background-size: 200% 100%; animation: skeleton 1.5s infinite; }
@keyframes skeleton {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* Responsive */
@media (max-width: 1020px) {
  .grid-2 { grid-template-columns: 1fr; }
  .gallery.grid, .portfolio-preview .gallery.grid, .cards { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .header-inner { grid-template-columns: auto 1fr; }
  .nav { justify-self: end; }
  .menu { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; padding: .5rem 0; border-bottom: 1px solid #e7edf3; box-shadow: var(--shadow); z-index: 35; }
  .menu.show { display: grid; grid-template-columns: 1fr; gap: .6rem; }
  .menu a { display: block; padding: 1rem 1.1rem; font-size: 1.05rem; line-height: 1.2; border-radius: 12px; }
  .menu a:hover { background: #f2f8fd; }
  .burger { display: inline-block; }
  .header-cta, .header-cta .phone-top { display: none; }
  .gallery.grid, .portfolio-preview .gallery.grid, .cards, .form-grid { grid-template-columns: 1fr; }
  .cta .actions { justify-content: center; flex-wrap: nowrap; gap: .5rem; }
  .cta .actions .btn { padding: .6rem .8rem; font-size: .95rem; }

  /* Sous-menu mobile */
  .menu .has-submenu > .submenu-link { display: inline-block; }
  .submenu { position: static; box-shadow: none; border: 0; padding: 0 0 0 .5rem; min-width: 0; }
  .submenu li a { padding: .6rem 1.1rem; }
  .submenu { display: none; }
  .has-submenu.open > .submenu { display: grid; grid-template-columns: 1fr; }
  .submenu-caret { display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--brand); padding: .25rem; font-size: 1rem; }
}

/* Hide mobile phone FAB on desktop */
@media (min-width: 721px) {
  .phone-fab { display: none; }
}
