:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #2a2d2e;
  --muted: #6b6f70;
  --line: #e2dfd8;
  --accent: #4f6b5b;
  --accent-dark: #3c5446;
  --accent-soft: #e7eee9;
  --warn: #9a6a12;
  --warn-soft: #fbf1dc;
  --danger: #a3392f;
  --danger-soft: #f8e3e0;
  --info-soft: #e6eef6;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent-dark); }
h1 { font-size: 1.7rem; font-weight: 600; margin: 0 0 .6rem; }
h2 { font-size: 1.25rem; font-weight: 600; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; }
p { margin: .4rem 0 .8rem; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.sr { position: absolute; left: -9999px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.demo-banner { background: #2f3b45; color: #fff; font-size: .875rem; }
.demo-inner { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding-top: 7px; padding-bottom: 7px; }
.demo-banner strong { background: #f2c14e; color: #2f3b45; padding: 1px 8px; border-radius: 4px; letter-spacing: .05em; }
.demo-form { margin-left: auto; }
.demo-form select { padding: 4px 6px; border-radius: 6px; border: 0; max-width: 100%; }

.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.nav { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-left: auto; }
.nav a { text-decoration: none; color: var(--text); }
.nav a:hover { color: var(--accent); }
.nav a.btn, .nav a.btn:hover { color: #fff; }
.who { font-size: .8rem; color: var(--muted); padding-bottom: 8px; }

.site-footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: .85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.6rem; font-weight: 600; margin-top: 2px; }
.stat .hint { color: var(--muted); font-size: .8rem; }
.stat.alert { border-color: #e5c68a; background: var(--warn-soft); }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font-size: 1rem; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--accent-dark); }
.btn-small { padding: 6px 12px; font-size: .875rem; }
.btn-light { background: var(--accent-soft); color: var(--accent-dark); }
.btn-light:hover { background: #d6e3da; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8a2f27; }
.btn-ghost { background: transparent; color: var(--accent-dark); border: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.inline { display: inline; }

form .field { margin-bottom: 14px; }
label { display: block; font-weight: 500; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cfcbc2; border-radius: 8px; font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 80px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.help { color: var(--muted); font-size: .85rem; margin-top: 3px; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; }
.flash-success { background: var(--accent-soft); }
.flash-error { background: var(--danger-soft); color: #6d2019; }
.flash-info { background: var(--info-soft); }
.flash-warn { background: var(--warn-soft); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
tfoot td { font-weight: 600; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; background: #ecebe7; white-space: nowrap; }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-awaiting_payment { background: var(--info-soft); color: #2b5378; }
.badge-payment_overdue { background: var(--danger-soft); color: var(--danger); }
.badge-confirmed { background: var(--accent-soft); color: var(--accent-dark); }
.badge-completed { background: #e3e7ef; color: #3a4a66; }
.badge-refused, .badge-cancelled, .badge-expired, .badge-no_show { background: #eeeceb; color: #777; }
.tag { display: inline-block; font-size: .75rem; padding: 1px 7px; border-radius: 5px; background: #efede8; color: var(--muted); }

.hero { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: center; margin-bottom: 28px; }
.hero h1 { font-size: 2rem; }
.photo { background: linear-gradient(135deg, #d9ded6, #c4cdc3); border-radius: var(--radius); aspect-ratio: 4/3; display: flex; align-items: flex-end; padding: 12px; color: #4b5a4f; font-size: .85rem; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.steps li::before { counter-increment: s; content: counter(s); display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); align-items: center; justify-content: center; font-weight: 600; margin-bottom: 6px; }

.cal { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cal th { text-align: center; padding: 4px; }
.cal td { border: 0; padding: 0; height: 64px; }
.cal .day { display: block; height: 100%; border-radius: 8px; padding: 6px; text-decoration: none; color: inherit; font-size: .85rem; background: #fff; border: 1px solid var(--line); }
.cal .day b { display: block; font-size: 1rem; }
.cal .free { background: var(--accent-soft); border-color: #c9d9cf; }
.cal .free:hover { background: #d6e3da; }
.cal .full { background: #f3e5d3; }
.cal .closed { background: #eeeceb; color: #999; }
.cal .past, .cal .later { color: #aaa; }
.cal .selected { outline: 2px solid var(--accent); }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot input { position: absolute; opacity: 0; }
.slot span { display: inline-block; padding: 6px 12px; border: 1px solid #cfcbc2; border-radius: 7px; cursor: pointer; background: #fff; font-weight: 400; }
.slot input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }

.timeline { position: relative; height: 54px; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 6px 0 14px; }
.timeline .seg { position: absolute; top: 6px; bottom: 6px; border-radius: 5px; font-size: .72rem; padding: 2px 5px; overflow: hidden; white-space: nowrap; color: #fff; }
.seg.b { background: var(--accent); }
.seg.p { background: #c9963b; }
.seg.clean { background: repeating-linear-gradient(45deg, #ddd, #ddd 4px, #eee 4px, #eee 8px); color: #777; }
.seg.block { background: #8a8f94; }
.hours { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }

.options-list .opt { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.options-list .opt input[type=number] { width: 80px; }
.code-box { font-family: ui-monospace, Menlo, monospace; font-size: 1.3rem; letter-spacing: .12em; background: var(--accent-soft); padding: 8px 14px; border-radius: 8px; display: inline-block; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.menu-grid a { display: block; text-decoration: none; color: inherit; }
.menu-grid a:hover .card { border-color: var(--accent); }
.invoice { max-width: 820px; margin: 0 auto; }

/* Menus à tuiles (espace partenaire, gestion) */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.page-head h1 { margin-bottom: 2px; }
.page-head p { margin: 0; }
.btn-big { padding: 13px 22px; font-size: 1.05rem; font-weight: 600; border-radius: 10px; }
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.tile { display: flex; gap: 16px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; min-height: 118px; }
.tile:hover, .tile:focus-visible { border-color: #b9c7bd; box-shadow: 0 6px 18px rgba(40, 50, 45, .08); transform: translateY(-1px); outline: none; }
.tile-icon { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tone-soft); color: var(--tone); }
.tile-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile-title { font-weight: 600; font-size: 1.05rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.tile-desc { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.tile-meta { font-size: .85rem; font-weight: 500; color: var(--tone); margin-top: 4px; }
.tile-badge { font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--info-soft); color: #2b5378; white-space: nowrap; }
.tile-badge.is-alert { background: var(--danger); color: #fff; }
.tile-featured { background: linear-gradient(135deg, #f1f6f2, #fff 70%); border-color: #c9d9cf; }
.tile-featured .tile-icon { background: var(--accent); color: #fff; }
.tone-green { --tone: #3c6b50; --tone-soft: #e3efe7; }
.tone-blue { --tone: #2f5f86; --tone-soft: #e2edf6; }
.tone-amber { --tone: #8c6216; --tone-soft: #f8edd6; }
.tone-plum { --tone: #6c4a7c; --tone-soft: #efe6f3; }
.tone-slate { --tone: #4a5866; --tone-soft: #e8ecef; }
.tone-rose { --tone: #9a4237; --tone-soft: #f7e4e1; }
.tile-section { margin-bottom: 8px; }
.tile-section h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin: 22px 0 10px; }
.tile-search { position: relative; flex: 0 1 340px; }
.tile-search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.tile-search input { width: 100%; padding: 10px 12px 10px 38px; border: 1px solid #cfcbc2; border-radius: 99px; font: inherit; background: #fff; }
.demo-reset { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-top: 28px; padding: 14px 18px; border: 1px dashed #d8b9b4; border-radius: 12px; background: #fdf8f7; }
.demo-reset .tile-icon { flex-basis: 44px; width: 44px; height: 44px; }
.demo-reset .tile-icon .ico { width: 22px; height: 22px; }
.demo-reset button { margin-left: auto; }
.next-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.next-row:hover b { color: var(--accent); }
.next-row { flex-wrap: wrap; }
.next-date { display: flex; flex-direction: column; flex: 1 1 200px; }
.nav a.is-active { color: var(--accent); font-weight: 600; }
.who a { color: var(--muted); }

/* ---------- Deux sites : la salle des fêtes a ses propres couleurs ---------- */
body.site-salle {
  --bg: #f7f3ee; --line: #e6ddd2; --accent: #7a5230; --accent-dark: #5c3d22; --accent-soft: #f3e7da;
}
.site-salle .btn-light:hover { background: #ead8c4; }
.site-salle .cal .free { background: #e7eee9; border-color: #c9d9cf; }
.site-salle .cal .free:hover { background: #d6e3da; }
.site-salle .cal .full { background: #e8d2bc; border-color: #d9bc9f; }
.site-salle .tile-featured { background: linear-gradient(135deg, #f8efe6, #fff 70%); border-color: #e2cdb6; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: inline-flex; width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: #fff; align-items: center; justify-content: center; }
.brand-mark .ico { width: 22px; height: 22px; }
.brand small { display: block; font-weight: 400; font-size: .75rem; color: var(--muted); max-width: 320px; line-height: 1.3; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font: inherit; cursor: pointer; }
.site-switch a { color: #fff; margin-left: 6px; opacity: .75; }
.site-switch a.is-on { opacity: 1; font-weight: 600; text-decoration: underline; }
.admin-site a { margin-left: 2px; }

/* Pied de page */
.footer-grid { display: grid; gap: 18px 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer .footer-grid { display: grid; }
.footer-grid strong { color: var(--text); }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.footer-links a, .site-footer a { color: var(--muted); }

/* Pages publiques */
.hero-photo { display: block; position: relative; min-height: 360px; border-radius: 16px; overflow: hidden; background: #3a2a1c var(--hero) center / cover no-repeat; color: #fff; padding: 48px 32px; }
.hero-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(30, 20, 12, .82), rgba(30, 20, 12, .35) 70%, rgba(30, 20, 12, .1)); }
.hero-text { position: relative; max-width: 620px; }
.hero-photo h1 { color: #fff; }
.hero-photo .btn-light { background: rgba(255, 255, 255, .92); }
.hero-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 600; opacity: .85; margin: 0 0 6px; }
.facts { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.facts li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.facts strong { font-size: 1.5rem; color: var(--accent-dark); }
.facts span { color: var(--muted); font-size: .88rem; }
.event-type { border-top: 4px solid var(--type, var(--accent)); }
.event-type h3 { margin-top: 0; }
.event-card { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.event-card:hover { border-color: var(--accent); }
.event-date { flex: 0 0 64px; height: 64px; border-radius: 12px; background: var(--accent); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .78rem; text-transform: uppercase; }
.event-date b { font-size: 1.5rem; line-height: 1; }
.gallery img { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); display: block; }
.gallery-big { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.gallery-big figure { margin: 0; }
.gallery-big figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }
details.faq { border-bottom: 1px solid var(--line); padding: 10px 0; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq summary h2 { display: inline; font-size: 1.02rem; margin: 0; }
.price-list { list-style: none; padding: 0; margin: 0; }
.price-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.price-list strong { white-space: nowrap; }
.price-big { font-size: 2rem; font-weight: 700; color: var(--accent-dark); margin: 0; }
.estimate { font-size: 1.1rem; background: var(--accent-soft); padding: 10px 14px; border-radius: 8px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.choice label { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; border: 1px solid #cfcbc2; border-radius: 8px; padding: 7px 12px; background: #fff; cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.label { display: block; font-weight: 500; margin-bottom: 4px; }
.req { color: var(--danger); }
.field-wide { grid-column: 1 / -1; }
.hp { position: absolute; left: -9999px; }
.cal-salle .day span { display: block; font-size: .7rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .partial { background: #fff6df; border-color: #ecd9a6; }
.seg.b.s { background: #8a5a2b; }
.tag-salle { background: #f3e7da; color: #6b4a2a; }
.tag-pompe { background: #e7eee9; color: #3c5446; }
.tag-alert { background: var(--danger-soft); color: var(--danger); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: 0; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: 4px 0 4px 26px; position: relative; }
.checklist li::before { content: "○"; position: absolute; left: 4px; color: var(--muted); }
.checklist li.ok::before { content: "✓"; color: var(--accent); font-weight: 700; }
.checklist li.ko::before { content: "✕"; color: var(--danger); font-weight: 700; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: .82rem; }
.ical-box h2 .ico, .btn .ico { width: 18px; height: 18px; vertical-align: -3px; }
.stat strong { display: block; font-size: 1.5rem; }
.card.is-new { border-left: 4px solid var(--accent); }
.seg-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.seg-tabs a { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--text); background: #fff; }
.seg-tabs a.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
tr.is-selected td { background: var(--accent-soft); }
.serp { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fff; font-family: arial, sans-serif; display: flex; flex-direction: column; gap: 2px; max-width: 640px; margin-bottom: 10px; }
.serp-url { font-size: .8rem; color: #202124; }
.serp-title { font-size: 1.15rem; color: #1a0dab; }
.serp-desc { font-size: .85rem; color: #4d5156; }
.paypal-box { border-color: #c9d6ea; }
.pp-logo { font-weight: 800; font-style: italic; color: #003087; background: #ffc439; padding: 1px 6px; border-radius: 4px; margin-right: 4px; }
.paypal-simu { background: #ffc439; color: #111; }
.paypal-simu:hover { background: #f2b52e; }
@media (max-width: 800px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; margin: 0; }
  .nav a { padding: 10px 2px; border-top: 1px solid var(--line); }
  .nav a.btn { margin-top: 8px; text-align: center; }
  .nav-open .nav { display: flex; }
  .hero-photo { padding: 32px 18px; min-height: 0; }
  .brand small { display: none; }
}
@media print {
  .demo-banner, .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  .hero h1 { font-size: 1.6rem; }
  .cal td { height: 52px; }
  .cal .day { padding: 4px; font-size: .72rem; }
  .demo-form { margin-left: 0; width: 100%; }
  .demo-form select { width: 100%; }
  .tiles { grid-template-columns: 1fr; gap: 10px; }
  .tile { min-height: 0; padding: 14px; gap: 14px; }
  .tile-icon { flex-basis: 52px; width: 52px; height: 52px; }
  .tile-icon .ico { width: 24px; height: 24px; }
  .tile-search { flex-basis: 100%; }
  .page-head .btn-big { width: 100%; text-align: center; }
}

/* Accès et invitations (admin) */
.access-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.notice { background: #fff6df; border: 1px solid #ecd9a6; border-radius: var(--radius); padding: 10px 12px; font-size: .9rem; }
.text-warn { color: #8a5a00; }

/* Texte de présentation mis en avant */
.lead { font-size: 1.12rem; line-height: 1.6; border-left: 4px solid var(--accent); padding: 4px 0 4px 14px; margin: 12px 0 14px; }
