/* =========================================================
   BASE — reset, tokens du design system, typographie, utilitaires
   Les couleurs de marque (--c-primary, --c-accent, --c-secondary)
   sont surchargées par les paramètres du site (layout).
   ========================================================= */

:root {
  /* Marque */
  --c-primary: #0B2545;
  --c-accent: #E0A458;
  --c-secondary: #13A89E;
  --c-primary-deep: color-mix(in srgb, var(--c-primary) 82%, #000);
  --c-primary-soft: color-mix(in srgb, var(--c-primary) 8%, #fff);
  --c-accent-soft: color-mix(in srgb, var(--c-accent) 18%, #fff);
  --c-accent-strong: color-mix(in srgb, var(--c-accent) 78%, #000);

  /* Neutres chauds */
  --c-bg: #FAF8F4;
  --c-surface: #FFFFFF;
  --c-sand: #F3EDE3;
  --c-text: #16202C;
  --c-muted: #5B6573;
  --c-line: #E6E0D6;
  --c-on-dark: #F7F4EE;
  --c-on-dark-muted: rgba(247, 244, 238, .72);

  /* États */
  --c-success: #1F8A5B;
  --c-danger: #C2412D;

  /* Typographie */
  --font-title: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: clamp(.75rem, .72rem + .1vw, .8rem);
  --fs-sm: clamp(.85rem, .8rem + .2vw, .925rem);
  --fs-base: clamp(1rem, .96rem + .2vw, 1.0625rem);
  --fs-lg: clamp(1.1rem, 1rem + .4vw, 1.25rem);
  --fs-h4: clamp(1.1rem, 1rem + .4vw, 1.3rem);
  --fs-h3: clamp(1.3rem, 1.1rem + .8vw, 1.7rem);
  --fs-h2: clamp(1.9rem, 1.4rem + 2vw, 3rem);
  --fs-h1: clamp(2.5rem, 1.6rem + 4vw, 5.25rem);

  /* Espacements */
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: clamp(4.5rem, 3rem + 6vw, 8rem);

  /* Formes & profondeur */
  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 24px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(11, 37, 69, .06), 0 2px 8px rgba(11, 37, 69, .05);
  --shadow-2: 0 10px 30px -12px rgba(11, 37, 69, .25);
  --shadow-3: 0 24px 60px -20px rgba(11, 37, 69, .35);

  /* Mouvement */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .3s;

  --container: 1200px;
  --header-h: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
ul[class], ol[class] { list-style: none; padding: 0; }
p, li { overflow-wrap: break-word; }

/* ---------- Typographie ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-title);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: -.03em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-family: var(--font-body); font-weight: 600; letter-spacing: -.01em; }
em { font-style: italic; }
h1 em, h2 em { color: var(--c-accent); font-style: italic; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--c-accent-strong);
}
.eyebrow::before {
  content: "";
  width: 28px;
  border-top: 1.5px dashed currentColor;
}
.lead { font-size: var(--fs-lg); color: var(--c-muted); max-width: 60ch; }
.muted { color: var(--c-muted); }

/* ---------- Mise en page ---------- */
.container { width: min(var(--container), 100% - 2rem); margin-inline: auto; }
.section { padding-block: var(--space-6); }
.section--sand { background: var(--c-sand); }
.section--dark { background: var(--c-primary); color: var(--c-on-dark); }
.section-head { display: grid; gap: var(--space-2); margin-bottom: var(--space-5); max-width: 720px; }
.section-head--center { margin-inline: auto; text-align: center; justify-items: center; }

/* ---------- Icônes ---------- */
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }
.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.75em; height: 1.75em; }

/* ---------- Boutons ---------- */
.btn {
  --btn-bg: var(--c-primary);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 48px;
  padding: .75rem 1.5rem;
  border: 1.5px solid var(--btn-bg);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease),
              color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn--accent { --btn-bg: var(--c-accent); --btn-fg: var(--c-primary-deep); }
.btn--accent:hover { --btn-bg: color-mix(in srgb, var(--c-accent) 88%, #fff); }
.btn--ghost { background: transparent; color: var(--c-primary); border-color: currentColor; }
.btn--ghost:hover { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn--light { --btn-bg: #fff; --btn-fg: var(--c-primary); }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn--outline-light:hover { background: #fff; color: var(--c-primary); border-color: #fff; }
.btn--sm { min-height: 42px; padding: .55rem 1.15rem; }
.btn--lg { min-height: 56px; padding: 1rem 2rem; font-size: var(--fs-base); }
.btn--block { width: 100%; }

.link-arrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-weight: 600; font-size: var(--fs-sm); text-decoration: none; color: var(--c-primary);
}
.link-arrow .icon { transition: transform var(--dur) var(--ease); }
.link-arrow:hover .icon { transform: translateX(4px); }

/* ---------- Formulaires (base) ---------- */
input:not([type="checkbox"], [type="radio"]), select, textarea {
  width: 100%;
  min-height: 48px;
  padding: .7rem 1rem;
  border: 1.5px solid var(--c-line);
  border-radius: var(--radius-s);
  background: var(--c-surface);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* Même hauteur pour champs texte et listes ; flèche de liste dessinée (identique sur tous les navigateurs) */
input:not([type="checkbox"], [type="radio"], [type="file"], [type="color"]), select { height: 3.1rem; line-height: 1.3; }
select {
  appearance: none;
  padding-inline-end: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235B6573' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  cursor: pointer;
  text-overflow: ellipsis;
}
[dir="rtl"] select { background-position: left 1rem center; }
input::placeholder, textarea::placeholder { color: var(--c-muted); opacity: .7; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-primary) 14%, transparent);
}
.field-error { color: var(--c-danger); font-size: var(--fs-sm); margin-top: .35rem; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Puces de choix (radio / case à cocher) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center;
  min-height: 38px;
  padding: .4rem .85rem;
  border: 1.5px solid var(--c-line);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip:hover span { border-color: var(--c-primary); }
.chip input:checked + span { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.chip input:focus-visible + span { outline: 2.5px solid var(--c-accent); outline-offset: 2px; }

/* ---------- Accessibilité ---------- */
:focus-visible { outline: 2.5px solid var(--c-accent); outline-offset: 3px; border-radius: 4px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -100px; left: 1rem; z-index: 1000;
  padding: .75rem 1.25rem; background: var(--c-primary); color: #fff; border-radius: var(--radius-s);
}
.skip-link:focus { top: 1rem; }

/* ---------- Apparition au scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Messages flash (site et administration) ---------- */
.toasts { position: fixed; z-index: 300; left: 50%; bottom: 5.5rem; transform: translateX(-50%); display: grid; gap: .6rem; width: min(440px, 100% - 2rem); }
.toast {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--c-primary-deep);
  color: #fff;
  box-shadow: var(--shadow-3);
  animation: toast-in .45s var(--ease);
}
.toast p { flex: 1; font-size: var(--fs-sm); }
.toast--success > .icon { color: #5FD3A0; }
.toast--error > .icon { color: #FF9C8A; }
.toast--info > .icon { color: var(--c-accent); }
.toast__close { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--c-on-dark-muted); }
.toast__close:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.toast.is-leaving { opacity: 0; transform: translateY(10px); transition: all .3s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } }
