/* ==========================================================================
   Design tokens – colours taken from the logo's painted hands
   ========================================================================== */
:root {
  --red: #e2334a;
  --red-dark: #b81d33;
  --blue: #3450a8;
  --blue-dark: #253b82;
  --green: #2f9e57;
  --yellow: #f6c23e;
  --orange: #f08a24;
  --purple: #7a4fbf;

  --ink: #1d2433;
  --muted: #5b6477;
  --line: #e3e7ef;
  --bg: #f7f8fc;
  --surface: #ffffff;
  --tint-blue: #eef2fc;
  --tint-green: #e9f6ee;
  --tint-red: #fdecef;
  --tint-yellow: #fff6de;

  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 22px;
  --shadow: 0 1px 2px rgb(29 36 51 / 6%), 0 4px 16px rgb(29 36 51 / 6%);
  --shadow-l: 0 2px 4px rgb(29 36 51 / 6%), 0 12px 32px rgb(29 36 51 / 10%);
  --container: 1100px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", "Nunito", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue-dark); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 0.5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.narrow { max-width: 860px; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.icon { display: inline-flex; flex-shrink: 0; }
.icon svg { display: block; }

/* ==========================================================================
   Header & footer
   ========================================================================== */
sde-header { display: block; min-height: 72px; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgb(255 255 255 / 92%);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
sde-header:has(.site-header) { position: sticky; top: 0; z-index: 20; }
.site-header-inner { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 48px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-display); color: var(--blue); }
.brand-text span { font-size: 0.85rem; color: var(--muted); }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.95rem;
  padding: 8px 12px; border-radius: 999px;
}
.site-nav a:hover { background: var(--tint-blue); color: var(--blue); }
.nav-toggle { display: none; }
@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex; border: 1px solid var(--line); background: var(--surface);
    border-radius: var(--radius-s); padding: 8px; color: var(--ink); cursor: pointer;
  }
  .site-nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; padding: 8px 16px 16px; background: var(--surface);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px; }
}

.site-footer { background: var(--ink); color: #d6dbe6; padding: 40px 0; margin-top: 64px; font-size: 0.92rem; }
.site-footer strong { color: #fff; }
.site-footer p { margin: 4px 0 0; }
.site-footer a { color: #d6dbe6; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 2fr 1.3fr 1.3fr; gap: 24px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Buttons, badges, cards
   ========================================================================== */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid transparent; border-radius: 999px; padding: 12px 22px;
  font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
  background: var(--red); color: #fff; transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.button:hover { background: var(--red-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.button:disabled { opacity: 0.6; cursor: wait; transform: none; }
.button-secondary { background: var(--blue); }
.button-secondary:hover { background: var(--blue-dark); }
.button-ghost { background: transparent; color: var(--blue); border-color: currentColor; }
.button-ghost:hover { background: var(--tint-blue); color: var(--blue-dark); }
.button-light { background: #fff; color: var(--blue); }
.button-light:hover { background: var(--tint-blue); color: var(--blue-dark); }
.button-small { padding: 7px 14px; font-size: 0.9rem; }
.icon-button {
  display: inline-flex; border: none; background: transparent; color: var(--muted);
  padding: 6px; border-radius: 999px; cursor: pointer;
}
.icon-button:hover { background: var(--tint-red); color: var(--red-dark); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.badge-open { background: var(--tint-green); color: var(--green); }
.badge-closed { background: var(--tint-red); color: var(--red-dark); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card h2 { font-size: 1.35rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: auto; padding-top: 8px; }

.meta { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; color: var(--muted); font-size: 0.93rem; }
.meta li { display: flex; gap: 8px; align-items: flex-start; }
.meta .icon { margin-top: 3px; color: var(--blue); }

.notice { border-radius: var(--radius-s); padding: 14px 16px; margin: 12px 0; }
.notice-error { background: var(--tint-red); color: #8a1224; border: 1px solid #f6c3cc; }
.notice-success { background: var(--tint-green); color: #1d5e33; border: 1px solid #bfe3cb; }
.notice-warning { background: var(--tint-yellow); color: #6b4c00; border: 1px solid #f3dca0; }
.notice-info { background: var(--tint-blue); color: var(--blue-dark); border: 1px solid #cfd9f5; }
.hint { color: var(--muted); font-size: 0.87rem; margin: 6px 0 0; }

/* ==========================================================================
   Home page
   ========================================================================== */
.hero {
  position: relative; overflow: hidden; padding: 64px 0 72px;
  background:
    radial-gradient(40rem 22rem at 90% 10%, rgb(246 194 62 / 28%), transparent 70%),
    radial-gradient(34rem 20rem at 5% 95%, rgb(47 158 87 / 18%), transparent 70%),
    radial-gradient(30rem 18rem at 60% 110%, rgb(226 51 74 / 14%), transparent 70%),
    linear-gradient(180deg, #fff, var(--bg));
}
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); color: var(--blue-dark); }
.hero h1 .accent { color: var(--red); }
.hero-lead { font-size: 1.15rem; color: var(--muted); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-logo {
  justify-self: center; width: min(100%, 380px); padding: 24px;
  background: #fff; border-radius: 50%; aspect-ratio: 1; display: grid; place-items: center;
  box-shadow: var(--shadow-l);
}
.hero-logo img { width: 78%; }
@media (max-width: 820px) {
  .hero { padding: 40px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-logo { order: -1; width: 200px; padding: 14px; }
}

.section { padding: 64px 0 8px; }
.section-head { max-width: 680px; margin-bottom: 28px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.eyebrow {
  display: inline-block; font-weight: 800; font-size: 0.8rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--red); margin-bottom: 8px;
}

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { background: var(--surface); border-radius: var(--radius); padding: 24px; border: 1px solid var(--line); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  margin-bottom: 14px; color: #fff;
}
.feature:nth-child(1) .feature-icon { background: var(--red); }
.feature:nth-child(2) .feature-icon { background: var(--blue); }
.feature:nth-child(3) .feature-icon { background: var(--green); }
.feature p { color: var(--muted); margin: 0; }
@media (max-width: 820px) { .features { grid-template-columns: 1fr; } }

.agenda { display: grid; gap: 16px; }
.agenda-card {
  display: grid; grid-template-columns: 96px 1fr; gap: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.agenda-body h3 { margin-bottom: 6px; }
.agenda-body > p { color: var(--muted); }
.date-badge {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border-radius: var(--radius); background: var(--blue); color: #fff; min-height: 96px; padding: 8px;
  align-self: start;
  font-family: var(--font-display);
}
.date-badge-day { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.date-badge-month { font-size: 0.95rem; font-weight: 700; text-transform: uppercase; line-height: 1.2; overflow-wrap: anywhere; }
.kind-bourse .date-badge { background: var(--green); }
.kind-marche-noel .date-badge { background: var(--red); }
.kind-vente .date-badge { background: var(--orange); }
.kind-fete .date-badge { background: var(--purple); }
@media (max-width: 560px) {
  .agenda-card { grid-template-columns: 1fr; }
  .date-badge { min-height: 0; flex-direction: row; gap: 8px; justify-content: flex-start; padding: 8px 14px; }
  .date-badge-day { font-size: 1.4rem; }
}

.registration-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.registration-card {
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--line); border-top: 6px solid var(--red); padding: 24px; box-shadow: var(--shadow);
}
.registration-card:nth-child(2n) { border-top-color: var(--green); }
.registration-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.price-from { color: var(--muted); }
.price-from strong { color: var(--ink); font-size: 1.15rem; }

.campaign-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.campaign-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
}
.campaign-card img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; background: var(--tint-blue); }
.campaign-card div { padding: 16px 20px 20px; }
.campaign-card:hover { box-shadow: var(--shadow-l); color: var(--ink); }

.help-band {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff;
  border-radius: var(--radius-l); padding: 36px;
}
.help-band h3 { color: #fff; }
.help-band p { color: #dfe5f7; }
.help-band a:not(.button) { color: #fff; }
@media (max-width: 820px) { .help-band { grid-template-columns: 1fr; padding: 28px; } }

.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.contact-item {
  display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.contact-item .icon { color: var(--red); background: var(--tint-red); padding: 10px; border-radius: 12px; }
.contact-item strong { display: block; }
.contact-item a { overflow-wrap: anywhere; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; text-align: center; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, #eef0f5, #f7f8fb, #eef0f5); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ==========================================================================
   Inner pages (registration, confirmation, legal)
   ========================================================================== */
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); color: var(--blue-dark); }
.breadcrumb { font-size: 0.9rem; margin-bottom: 12px; }
.breadcrumb a { text-decoration: none; }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }

.step-title { display: flex; align-items: center; gap: 12px; }
.step-number {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 0.95rem; font-weight: 800;
}

details.rules { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
details.rules summary { cursor: pointer; font-weight: 700; color: var(--blue); }
details.rules h4 { margin: 16px 0 4px; }
details.rules p { color: var(--muted); margin: 0; }

/* Form fields */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { min-width: 0; }
fieldset.field { border: none; padding: 0; margin: 0; }
.label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  font: inherit; color: var(--ink); background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: #c9d0de; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgb(52 80 168 / 15%); }
textarea { min-height: 90px; resize: vertical; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer;
  padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: #fff;
}
.choice:has(input:checked) { border-color: var(--blue); background: var(--tint-blue); }
.choice input { margin-top: 5px; accent-color: var(--blue); width: 18px; height: 18px; flex-shrink: 0; }
.choice-block { width: 100%; margin-bottom: 10px; }
.field-error { color: var(--red-dark); font-size: 0.9rem; font-weight: 600; margin: 6px 0 0; min-height: 0; }
.field-error:empty { display: none; }

/* Order table */
.order { width: 100%; border-collapse: collapse; }
.order td { padding: 12px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.order .order-help { display: block; color: var(--muted); font-size: 0.85rem; }
.order .order-price { color: var(--muted); white-space: nowrap; text-align: right; }
.order .order-qty { width: 96px; }
.order .order-qty input[type=number] { text-align: center; }
.order .order-qty input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--blue); }
.order .order-amount { width: 96px; text-align: right; white-space: nowrap; font-weight: 600; }
.order tfoot td { border-bottom: none; font-size: 1.15rem; font-weight: 800; }
@media (max-width: 560px) {
  .order .order-price { display: none; }
}

/* Submit bar */
.submit-bar {
  position: sticky; bottom: 12px; z-index: 10; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center;
  justify-content: space-between; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-l);
}
.submit-total { font-size: 1.1rem; }
.submit-total strong { font-size: 1.35rem; color: var(--blue-dark); }

/* <sde-file-drop> */
sde-file-drop { display: block; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; cursor: pointer;
  padding: 28px 16px; border: 2px dashed #c3cbe0; border-radius: var(--radius); background: #fafbff;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--blue); background: var(--tint-blue); }
.dropzone.is-dragging { border-color: var(--green); background: var(--tint-green); border-style: solid; }
.dropzone.is-full { cursor: default; opacity: 0.6; }
.dropzone-icon { color: var(--blue); margin-bottom: 4px; }
.dropzone-title { font-weight: 700; }
.dropzone-sub { color: var(--muted); font-size: 0.92rem; }
sde-file-drop:has(:invalid) .dropzone { border-color: var(--red); }
.file-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.file-list:empty { display: none; }
.file-item {
  display: grid; grid-template-columns: 48px 1fr auto auto; gap: 12px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff;
}
.file-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--tint-blue); }
.file-thumb-icon { display: grid; place-items: center; color: var(--blue); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-size { color: var(--muted); font-size: 0.85rem; }

/* ==========================================================================
   Admin
   ========================================================================== */
.admin .container { width: min(100% - 32px, 1400px); }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0 16px; }
.toolbar select { width: auto; max-width: min(100%, 340px); }
.toolbar .spacer { flex: 1; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 14px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 16px; }
table.list { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
table.list th, table.list td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
table.list th { background: #f1f4fa; position: sticky; top: 0; font-size: 0.85rem; }
table.list td .button { margin: 0 4px 4px 0; }
.status { font-weight: 700; white-space: nowrap; }
.status.paid { color: var(--green); }
.status.pending_payment, .status.offline_pending { color: #a86b00; }
.status.cancelled { color: var(--red-dark); }
