*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-y: scroll; }

:root {
    --bg:       #f5f5f4;
    --surface:  #ffffff;
    --border:   #e2e2df;
    --text:     #111111;
    --muted:    #6b7280;
    --accent:   #111111;
    --accent2:  #444444;
    --danger:   #c0392b;
    --success:  #166534;
    --radius:   5px;
    --shadow:   0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
}

html { font-size: 15px; }
body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Layout */
.wrap     { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }
.wrap--sm { max-width: 640px; }
.wrap--md { max-width: 860px; }

/* Header */
.header { background: #111; color: #fff; border-bottom: 1px solid #222; position: sticky; top: 0; z-index: 50; }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.header__brand { font-size: .9rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #fff; }
.header__nav { display: flex; align-items: center; gap: 1.5rem; }
.header__nav a { font-size: .82rem; color: rgba(255,255,255,.65); transition: color .15s; }
.header__nav a:hover { color: #fff; }
.header__nav .btn-nav { background: #fff; color: #111; padding: .3rem .85rem; border-radius: var(--radius); font-size: .78rem; font-weight: 700; }
.header__nav .btn-nav:hover { background: #f0f0f0; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 1.25rem 0; text-align: center; font-size: .78rem; color: var(--muted); margin-top: 4rem; }

/* Page */
.page { padding: 2.5rem 0 3rem; }
.page-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.5rem; }
.page-title span { color: var(--muted); font-weight: 400; font-size: 1rem; }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .55rem 1.1rem; border-radius: var(--radius); font-size: .87rem; font-weight: 600; border: none; cursor: pointer; transition: opacity .15s, transform .1s; white-space: nowrap; text-decoration: none; font-family: inherit; }
.btn:hover { opacity: .88; }
.btn:active { transform: translateY(1px); }
.btn--dark    { background: #111; color: #fff; }
.btn--outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn--outline:hover { background: #f5f5f4; opacity: 1; }
.btn--danger  { background: var(--danger); color: #fff; }
.btn--sm      { padding: .3rem .75rem; font-size: .78rem; }
.btn--full    { width: 100%; justify-content: center; }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.form-group label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.form-control { width: 100%; padding: .55rem .8rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .9rem; font-family: inherit; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.form-control:focus { outline: none; border-color: #999; box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }

/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.card--form { max-width: 440px; }

/* Alertes */
.alert { padding: .7rem 1rem; border-radius: var(--radius); font-size: .86rem; margin-bottom: 1rem; }
.alert--error   { background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; }
.alert--success { background: #f0fdf4; border: 1px solid #86efac; color: #14532d; }
.alert--info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a5f; }

/* Badges */
.badge { display: inline-block; padding: .18rem .55rem; border-radius: 3px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.badge--open     { background: #dbeafe; color: #1d4ed8; }
.badge--progress { background: #fef9c3; color: #854d0e; }
.badge--closed   { background: #dcfce7; color: #166534; }
.badge--planned  { background: #f3e8ff; color: #7e22ce; }
.badge--urgent   { background: #fee2e2; color: #991b1b; }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
thead { background: #f9f9f8; }
th { padding: .6rem 1rem; text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
td { padding: .65rem 1rem; border-top: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover td { background: #fafaf9; }

/* Section title */
.section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .75rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.stat__label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stat__value { font-size: 1.8rem; font-weight: 700; margin-top: .15rem; }

/* Vitrine */
.hero { padding: 3.5rem 0 2.5rem; }
.hero__eyebrow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .6rem; }
.hero__title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.15; }
.hero__sub { font-size: 1rem; color: var(--muted); margin-top: .9rem; max-width: 480px; }
.hero__cta { display: flex; gap: .75rem; margin-top: 1.75rem; flex-wrap: wrap; }

.services { padding: 2.5rem 0; border-top: 1px solid var(--border); }
.services__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.service-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.service-card__title { font-size: .9rem; font-weight: 700; margin-bottom: .35rem; }
.service-card__text { font-size: .82rem; color: var(--muted); }

/* Admin */
.admin-layout { min-height: calc(100vh - 54px); }
.admin-sidebar { background: #111; padding: 1.5rem 0; position: fixed; top: 0; left: 0; width: 200px; height: 100vh; padding-top: 54px; overflow-y: auto; z-index: 40; }
.admin-sidebar__label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #555; padding: 0 1.25rem; margin-bottom: .5rem; }
.admin-sidebar a { display: block; padding: .5rem 1.25rem; font-size: .84rem; color: rgba(255,255,255,.6); border-left: 2px solid transparent; transition: color .15s, background .15s; }
.admin-sidebar a:hover { color: #fff; background: rgba(255,255,255,.04); }
.admin-sidebar a.active { color: #fff; border-left-color: #fff; background: rgba(255,255,255,.06); }
.admin-body { padding: 2rem; margin-left: 200px; }

/* Canvas signature */
.sig-wrap { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; display: inline-block; }
canvas { display: block; cursor: crosshair; touch-action: none; }
.sig-clear { font-size: .75rem; color: var(--muted); cursor: pointer; margin-top: .25rem; display: inline-block; }
.sig-clear:hover { color: var(--danger); }

/* Responsive */
@media (max-width: 720px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform .25s ease; top: 54px; height: calc(100vh - 54px); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-body { margin-left: 0; }
    .admin-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
    .admin-overlay.open { display: block; }
    .admin-hamburger { display: flex !important; }
}
@media (max-width: 480px) {
    .hero__cta { flex-direction: column; }
    .stats { grid-template-columns: 1fr 1fr; }
}


/* ════════════════════════════════
   HOME PAGE
   ════════════════════════════════ */

/* Fix overflow horizontal global */
body { overflow-x: hidden; }

/* Bandes alternées */
.home-band { padding: 3rem 0; }
.home-band--alt { background: #f9f9f8; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.home-band__title { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.home-band__text { color: var(--muted); max-width: 640px; font-size: .95rem; line-height: 1.7; }

/* Hero */
.home-hero { padding: 3.5rem 0 2.5rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.home-hero__inner { display: grid; grid-template-columns: 3fr 2fr; gap: 3rem; align-items: center; }
.home-hero__title { font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 700; line-height: 1.25; margin-bottom: 1.25rem; }
.home-hero__btns { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.25rem; }
.home-hero__coords { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); }
.home-hero__coords a { color: var(--text); text-decoration: none; }
.home-hero__coords a:hover { text-decoration: underline; }
.home-hero__media img { width: 100%; object-fit: cover; display: block; }

/* Sections split image + texte */
.home-split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.home-split--reverse .home-split__text { order: -1; }
.home-split__img img { width: 100%; object-fit: cover; display: block; }
.home-split__text h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }
.home-split__text p { font-size: .9rem; color: var(--muted); line-height: 1.7; margin-bottom: .6rem; }

/* Prestations */
.home-services { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.home-service { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.home-service__title { font-size: .9rem; font-weight: 700; margin-bottom: .4rem; }
.home-service__text { font-size: .82rem; color: var(--muted); line-height: 1.6; }

/* CTA bande */
.home-cta-band { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.home-cta-band__label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .3rem; }
.home-cta-band__sub { font-size: .88rem; color: var(--muted); }

/* Responsive */
@media (max-width: 720px) {
  .home-hero__inner { grid-template-columns: 1fr; }
  .home-hero__media { display: none; }
  .home-split { grid-template-columns: 1fr; }
  .home-split--reverse .home-split__text { order: 0; }
  .home-split__img { display: none; }
}

/* Bandeau mode test */
.dev-banner { background: #854d0e; color: #fff; text-align: center; padding: .4rem 1rem; font-size: .8rem; }
.dev-banner strong { font-weight: 700; }

/* Références & marques */
.home-refs { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.home-list { list-style: none; margin-top: .75rem; display: flex; flex-direction: column; gap: .4rem; }
.home-list li { font-size: .9rem; color: var(--muted); padding-left: .9rem; position: relative; }
.home-list li::before { content: '—'; position: absolute; left: 0; color: var(--border); }

@media (max-width: 720px) {
  .home-refs { grid-template-columns: 1fr; gap: 2rem; }
}
