@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,650;1,400&family=Outfit:wght@500;600;700&display=swap');

:root {
  --night: #0A3D4A;
  --night-soft: #125A66;
  --primary: #0E9A96;
  --primary-hover: #0B7F7B;
  --primary-glow: rgba(14, 154, 150, 0.28);
  --action: #FF4D2E;
  --action-hover: #E03D20;
  --sun: #F5C518;
  --bg-warm: #FFF8EE;
  --ink: var(--night);
  --brand: var(--primary);
  --brand-hover: var(--primary-hover);
  --accent: var(--action);
  --bg: #F3FAF9;
  --surface: #FFFFFF;
  --text: #0A1218;
  --muted: #5C6B76;
  --border: #D0E4E2;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(10, 61, 74, 0.06);
  --shadow-md: 0 12px 40px rgba(10, 61, 74, 0.1);
  --font-display: "Outfit", system-ui, sans-serif;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: 180ms cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

body.ms-tpl {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 480px at 10% -10%, rgba(14, 154, 150, 0.12), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(245, 197, 24, 0.1), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

.ms-skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--night);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10000;
}
.ms-skip-link:focus { left: 0; }

.ms-container {
  width: min(1140px, calc(100% - 40px));
  margin-inline: auto;
}

.ms-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(243, 250, 249, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  min-height: var(--header-h);
}
.ms-site-header.is-nav-open { z-index: 200; }
.ms-site-header.is-solid {
  background: rgba(243, 250, 249, 0.96);
  border-bottom-color: var(--border);
}

.ms-header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  width: min(1140px, calc(100% - 40px));
  margin-inline: auto;
}

.ms-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--night);
  flex: 0 1 auto;
  min-width: 0;
}
.ms-brand:hover { color: var(--night); text-decoration: none; }
.ms-brand .brand-logo,
.ms-brand-logo {
  display: block;
  height: 56px;
  width: auto;
  max-width: min(220px, 55vw);
  object-fit: contain;
  object-position: left center;
}
.ms-brand .ms-brand-word {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ms-brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.ms-nav-desktop {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}
.ms-nav-public,
.ms-nav-scrim,
.ms-nav-drawer-head {
  display: none;
}
.ms-nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem 1.2rem;
  margin: 0;
  padding: 0;
}
.ms-nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  opacity: 0.8;
}
.ms-nav-links a:hover,
.ms-nav-links a.ms-link-pro:hover {
  opacity: 1;
  color: var(--brand);
}
.ms-nav-links a.ms-link-pro {
  color: var(--night-soft);
}

.ms-nav-drawer-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-left: auto;
}

.ms-chip-territoire {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 12rem;
  padding: 0.35rem 0.65rem 0.35rem 0.5rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.15;
}
.ms-chip-territoire:hover,
.ms-chip-territoire:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
}
.ms-chip-territoire-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  color: var(--brand);
}
.ms-chip-territoire-icon svg { width: 100%; height: 100%; display: block; }
.ms-chip-territoire-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}
.ms-chip-territoire-kicker {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ms-chip-territoire [data-territoire-label] {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-chip-territoire-chevron {
  font-size: 10px;
  opacity: 0.55;
  margin-left: 0.1rem;
}

.ms-territory-modal[hidden] { display: none !important; }
.ms-territory-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(7, 27, 36, 0.5);
}
.ms-territory-dialog {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.65rem;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-md);
}
.ms-territory-dialog h2 {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}
.ms-territory-suggest {
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(14, 154, 150, 0.08);
  color: var(--night);
  font-size: 13px;
  font-weight: 600;
}
.ms-territory-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  border: none;
  background: transparent;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}
.ms-territory-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr 1fr;
  margin-top: 1rem;
}
@media (min-width: 560px) {
  .ms-territory-grid { grid-template-columns: repeat(3, 1fr); }
}
.ms-territory-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.ms-territory-card:hover:not(:disabled) {
  border-color: var(--brand);
  box-shadow: var(--shadow);
}
.ms-territory-card strong { font-size: 14px; }
.ms-territory-card span { font-size: 12px; color: var(--muted); }
.ms-territory-card.is-soon:not(:disabled) {
  opacity: 0.85;
}
.ms-territory-card:disabled,
.ms-territory-card.is-soon:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ms-territory-card.is-active {
  border-color: var(--action);
  box-shadow: 0 0 0 3px rgba(255, 77, 46, 0.15);
}

.ms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 650;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  line-height: 1.2;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.ms-btn-sm {
  padding: 0.5rem 0.9rem;
  font-size: 13px;
  white-space: nowrap;
}
.ms-btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}
.ms-btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.ms-btn-accent {
  background: var(--action);
  border-color: var(--action);
  color: #fff;
}
.ms-btn-accent:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
  color: #fff;
}

.ms-nav-toggle {
  display: none;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  color: var(--ink);
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ms-nav-toggle-bars,
.ms-nav-toggle-bars::before,
.ms-nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.ms-nav-toggle-bars {
  position: relative;
}
.ms-nav-toggle-bars::before,
.ms-nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.ms-nav-toggle-bars::before { top: -6px; }
.ms-nav-toggle-bars::after { top: 6px; }
.ms-nav-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background var(--ease), transform var(--ease);
}
.ms-nav-close:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.04);
}

@media (min-width: 641px) {
  .ms-brand .brand-logo,
  .ms-brand-logo {
    height: 72px;
    max-width: min(260px, 40vw);
  }
}

@media (max-width: 920px) {
  body.ms-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  .ms-header-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: min(1140px, calc(100% - 24px));
    min-height: 56px;
  }
  .ms-brand {
    flex: 1 1 auto;
    max-width: calc(100% - 3.5rem);
  }
  .ms-brand .brand-logo,
  .ms-brand-logo {
    height: 40px;
    max-width: 150px;
  }

  .ms-nav-desktop {
    display: none !important;
  }

  .ms-nav-toggle {
    display: inline-flex;
    flex-shrink: 0;
    min-width: 42px;
    min-height: 42px;
    position: relative;
    z-index: 1;
  }

  .ms-nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 280;
    background: rgba(4, 22, 28, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 320ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .ms-nav-scrim.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
  .ms-nav-scrim[hidden] {
    display: none !important;
  }

  /* Hors <header> : fixed viewport réel (backdrop-filter du header ne confine plus) */
  .ms-nav-public {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 290;
    width: 100% !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100% !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding:
      max(1rem, env(safe-area-inset-top))
      max(1.25rem, env(safe-area-inset-right))
      max(1.5rem, env(safe-area-inset-bottom))
      max(1.25rem, env(safe-area-inset-left));
    background-color: #0A3D4A !important;
    background-image:
      radial-gradient(900px 420px at 100% 0%, rgba(255, 77, 46, 0.22), transparent 55%),
      radial-gradient(700px 380px at 0% 100%, rgba(14, 154, 150, 0.28), transparent 50%),
      linear-gradient(165deg, #0A3D4A 0%, #0E5A66 48%, #0A3D4A 100%);
    color: #fff;
    transform: translate3d(100%, 0, 0) !important;
    visibility: hidden;
    pointer-events: none;
    transition:
      transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 360ms;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.28);
  }
  .ms-nav-public.is-open,
  body.ms-nav-open .ms-nav-public {
    transform: translate3d(0, 0, 0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .ms-nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
  }
  .ms-nav-drawer-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
  }

  .ms-nav-public .ms-nav-drawer-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding: 0 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }
  .ms-nav-public .ms-nav-drawer-actions .ms-chip-territoire {
    max-width: none;
    width: 100%;
    justify-content: flex-start;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 14px;
  }
  .ms-nav-public .ms-nav-drawer-actions .ms-chip-territoire-kicker {
    display: block;
    color: rgba(255, 255, 255, 0.72);
  }
  .ms-nav-public .ms-nav-drawer-actions .ms-chip-territoire-icon { color: #fff; }
  .ms-nav-public .ms-nav-drawer-actions .ms-chip-territoire [data-territoire-label] {
    font-size: 15px;
  }
  .ms-nav-public .ms-nav-drawer-actions .ms-btn {
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
    padding: 0.75rem 1rem;
  }
  .ms-nav-public .ms-nav-drawer-actions .ms-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
  }
  .ms-nav-public .ms-nav-drawer-actions .ms-nav-cta-organiser {
    font-size: 16px;
    font-weight: 700;
    min-height: 52px;
    box-shadow: 0 10px 28px rgba(255, 77, 46, 0.35);
  }

  .ms-nav-public .ms-nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    flex: 1 1 auto;
    width: 100%;
  }
  .ms-nav-public .ms-nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff !important;
    opacity: 1;
    font-size: 1.125rem;
    font-weight: 650;
    padding: 0.95rem 0.35rem 0.95rem 0.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: -0.01em;
  }
  .ms-nav-public .ms-nav-links a::after {
    content: "›";
    font-size: 1.35rem;
    opacity: 0.55;
    line-height: 1;
  }
  .ms-nav-public .ms-nav-links a.is-active {
    color: var(--sun) !important;
  }
  .ms-nav-public .ms-nav-links a.is-active::after {
    color: var(--sun);
    opacity: 1;
  }

  .ms-site-header.is-on-hero .ms-nav-toggle {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--night);
  }
}

.ms-main { padding: 2rem 0 3rem; }

.ms-site-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  background: var(--night);
  color: rgba(255,255,255,0.85);
  padding: 2.5rem 0 2rem;
  margin-top: auto;
}
.ms-footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0 1rem;
  font-size: 14px;
}
.ms-footer-legal a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}
.ms-footer-legal a:hover { color: var(--action); }
.ms-footer-note { margin: 0; font-size: 0.9rem; opacity: 0.8; }

h1, h2, .ms-brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

a { color: var(--brand); }
a:hover { color: var(--brand-hover); }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
