/* ==========================================================================
   SITE — style « mxrveuh_lib » : panneaux translucides sombres, Montserrat,
   labels en majuscules, rayon 6 px, accent bleu.
   Les anciens noms de variables (--primary, --card…) sont gardés pour que
   les style="" inline existants reprennent la nouvelle palette.
   ========================================================================== */

:root {
  /* palette lib */
  --accent: #4a9eff;
  --accent-hi: #7bb8ff;
  --accent-30: rgba(74, 158, 255, 0.3);
  --accent-40: rgba(74, 158, 255, 0.4);
  --accent-55: rgba(74, 158, 255, 0.55);
  --on-accent: #04101f;
  --ok: #3ecf6b;
  --ko: #ff5c5c;
  --warn: #f5b041;
  --text: #f2f5fa;
  --muted: #9aa3b2;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --panel: linear-gradient(180deg, rgba(18, 20, 26, 0.94), rgba(8, 9, 12, 0.9));
  --radius: 6px;

  /* compatibilité : anciens noms en HSL (triplets), utilisés par les style="" */
  --primary: 213 100% 65%;
  --accent-hsl: 213 100% 65%;
  --background: 222 30% 4%;
  --card: 222 30% 7%;
  --foreground: 210 40% 98%;
  --muted-foreground: 215 15% 65%;
  --border: 217 20% 20%;
}

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

html {
  min-height: 100%;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(74, 158, 255, 0.08), transparent 60%),
              linear-gradient(180deg, #050608 0%, #0a0c10 45%, #101319 100%);
}

body {
  min-height: 100vh;
  background: transparent;
  color: var(--text);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

a { color: var(--accent); }

/* ---------- surfaces ---------- */
.glass, .glass-card, .info-card, .entry-card, .partner-card, .job-card, .empty-card, .video-card, .item-row, .doc-btn {
  background: var(--panel);
  border: 1px solid var(--accent-30);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
}
.glass-card, .entry-card, .partner-card, .job-card { transition: border-color 0.2s ease, transform 0.2s ease; }
.glass-card:hover, .entry-card:hover, .partner-card:hover, .job-card:hover { border-color: var(--accent-55); }

.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.silver-text { color: var(--text); }
.glow { box-shadow: 0 0 20px -5px var(--accent-40); }
.grid-pattern {
  background-image: linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ---------- animations ---------- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInScale { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes typing { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

.anim-logo { animation: fadeInScale 0.6s ease both; }
.anim-1 { animation: fadeInUp 0.5s ease both; }
.anim-2 { animation: fadeInUp 0.5s 0.08s ease both; }
.anim-3 { animation: fadeInUp 0.5s 0.16s ease both; }
.anim-4 { animation: fadeInUp 0.5s 0.24s ease both; }
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s ease infinite; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.feature-card { transition: transform 0.25s ease; }
.feature-card:hover { transform: translateY(-4px); }

/* ---------- boutons ---------- */
.btn, .btn-primary, .btn-secondary, .btn-outline, .btn-outline-white, .btn-outline-primary,
.btn-danger, .btn-visit, .join-metiers, .join-org, .join-fa, .join-disabled, .cat-btn, .tab-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.btn-primary, .join-metiers, .join-org, .join-fa, .btn-visit:hover {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 0 18px -4px var(--accent-40);
}
.btn-primary { padding: 10px 20px; }
.btn-primary:hover { background: var(--accent-hi); box-shadow: 0 0 26px -4px var(--accent-55); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-secondary, .btn-outline, .btn-outline-primary { background: rgba(255,255,255,0.05); color: var(--text); border-color: var(--line-strong); padding: 10px 20px; }
.btn-secondary:hover, .btn-outline:hover, .btn-outline-primary:hover { background: rgba(255,255,255,0.1); border-color: var(--accent-40); }
.btn-outline-white { background: transparent; color: var(--text); border-color: rgba(255,255,255,0.4); padding: 10px 20px; }
.btn-outline-white:hover { background: rgba(255,255,255,0.08); }

.btn-danger { background: rgba(255,92,92,0.12); color: var(--ko); border-color: rgba(255,92,92,0.4); padding: 8px 14px; }
.btn-danger:hover { background: rgba(255,92,92,0.22); }

.btn-sm { height: 34px; padding: 0 14px; font-size: 11px; }
.btn-md { height: 44px; padding: 0 20px; font-size: 12px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 13px; }

.btn-visit { height: 44px; width: 100%; background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-visit:hover { border-color: var(--accent); }

.join-metiers, .join-org, .join-fa { height: 44px; width: 100%; }
.join-metiers:hover, .join-org:hover, .join-fa:hover { background: var(--accent-hi); transform: translateY(-1px); }
.join-disabled { height: 44px; width: 100%; background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.35); border-color: var(--line); cursor: not-allowed; }

.cat-btn { height: 50px; padding: 0 22px; font-size: 12px; background: rgba(255,255,255,0.04); color: var(--muted); border-color: var(--line-strong); }
.cat-btn:hover { color: var(--text); border-color: var(--accent-40); }
.cat-btn-org-on, .cat-btn-fdo-on { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 0 18px -4px var(--accent-40); }
.cat-btn-org-off, .cat-btn-fdo-off { background: transparent; color: var(--muted); border-color: var(--accent-30); }
.cat-btn-org-off:hover, .cat-btn-fdo-off:hover { color: var(--text); border-color: var(--accent-55); }
.cat-off { background: rgba(255,255,255,0.04); color: var(--muted); border-color: var(--line); }
.cat-off:hover { color: var(--text); background: rgba(255,255,255,0.08); }

/* ---------- navigation ---------- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(7, 9, 13, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--accent-30);
}
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; height: 62px; display: flex; align-items: center; justify-content: space-between; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-link {
  color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; text-decoration: none; transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-admin { display: none; }

/* ---------- formulaires ---------- */
.form-label { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.form-input, .input-field, .search-input {
  width: 100%;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus, .input-field:focus, .search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-30); }
.form-input::placeholder, .input-field::placeholder, .search-input::placeholder { color: var(--muted); }
select.form-input option { background: #0c0e13; }
textarea.form-input { resize: vertical; min-height: 84px; }
.search-wrap { position: relative; }
.search-input { border-radius: 999px; padding: 12px 16px 12px 44px; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--accent); pointer-events: none; }
.dropzone {
  border: 1px dashed var(--accent-40); border-radius: var(--radius); padding: 28px; text-align: center;
  cursor: pointer; background: rgba(0,0,0,0.25); transition: all 0.2s;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent); background: var(--accent-30); }

/* ---------- onglets ---------- */
.tab-btn { padding: 10px 18px; font-size: 11px; background: rgba(255,255,255,0.04); color: var(--muted); border-color: var(--line-strong); }
.tab-btn:hover:not(.active) { color: var(--text); border-color: var(--accent-40); }
.tab-btn.active { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 0 18px -4px var(--accent-40); }
.tab-section { display: none; }
.tab-section.active { display: block; }

/* ---------- lignes, cartes d'info, documents ---------- */
.item-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.item-row:hover { border-color: var(--accent-55); }
.item-thumb { width: 52px; height: 52px; border-radius: var(--radius); object-fit: cover; flex-shrink: 0; background: rgba(0,0,0,0.4); border: 1px solid var(--line); }
.info-card { display: flex; align-items: center; gap: 18px; padding: 20px; animation: fadeInLeft 0.4s ease both; }
.info-icon { width: 44px; height: 44px; border-radius: var(--radius); background: var(--accent-30); border: 1px solid var(--accent-40); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--accent); }
.info-grid { grid-template-columns: 1fr !important; }
.doc-btn { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: var(--text); text-decoration: none; }
.doc-btn:hover { border-color: var(--accent-55); background: rgba(74,158,255,0.08); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius);
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-green, .badge-open { background: rgba(62,207,107,0.14); color: var(--ok); border-color: rgba(62,207,107,0.4); }
.badge-orange, .badge-full { background: rgba(245,176,65,0.14); color: var(--warn); border-color: rgba(245,176,65,0.4); }
.badge-red, .badge-closed { background: rgba(255,92,92,0.14); color: var(--ko); border-color: rgba(255,92,92,0.4); }

/* ---------- toast ---------- */
#toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 999;
  padding: 12px 18px; border-radius: var(--radius); font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--panel); border: 1px solid var(--accent-40); color: var(--text);
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  opacity: 0; transform: translateY(10px); transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.success { border-color: rgba(62,207,107,0.5); color: var(--ok); }
#toast.error { border-color: rgba(255,92,92,0.5); color: var(--ko); }

/* ---------- modales, lightbox, PDF, vidéo ---------- */
#modal-overlay, #pdf-modal, #lightbox, #video-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(3,4,6,0.88); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
#modal-overlay { z-index: 100; }
#modal-overlay.open, #pdf-modal.open, #lightbox.open, #video-modal.open { display: flex; }
#modal-box {
  background: var(--panel); border: 1px solid var(--accent-40); border-radius: var(--radius);
  padding: 26px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
}
#modal-close, #lightbox-close {
  position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; border-radius: var(--radius);
  background: rgba(255,255,255,0.06); border: 1px solid var(--line-strong); color: var(--text); cursor: pointer;
}
#modal-close:hover, #lightbox-close:hover { border-color: var(--accent); color: var(--accent); }
#lightbox img, #video-modal video { max-width: 100%; max-height: 85vh; object-fit: contain; border-radius: var(--radius); animation: scaleIn 0.25s ease; }
.pdf-container {
  width: 100%; max-width: 1024px; height: 90vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--accent-40); border-radius: var(--radius);
}
.pdf-header { height: 52px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.pdf-close { width: 34px; height: 34px; border-radius: var(--radius); background: rgba(255,255,255,0.06); border: 1px solid var(--line-strong); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pdf-close:hover { border-color: var(--accent); color: var(--accent); }
#pdf-frame { flex: 1; width: 100%; border: none; background: #fff; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.video-card { overflow: hidden; }
.video-card iframe, .video-card video { width: 100%; height: 200px; display: block; background: #000; }

/* ---------- galerie / listes ---------- */
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; padding-bottom: 14px; border-bottom: 1px solid var(--accent-30); }
.section-eyebrow { font-size: 10px; letter-spacing: 0.45em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; font-weight: 700; }
.section-title { font-size: 26px; font-weight: 800; color: var(--text); }
.section-count { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.empty-state, .empty-card { text-align: center; padding: 48px 24px; color: var(--muted); }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.entry-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; animation: fadeInUp 0.4s ease both; }
.entry-card img { width: 100%; height: 180px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.masonry { columns: 1; column-gap: 18px; }
.masonry-item { break-inside: avoid; margin-bottom: 18px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--accent-30); cursor: pointer; position: relative; }
.masonry-item img { width: 100%; height: auto; display: block; transition: transform 0.4s ease; }
.masonry-item:hover img { transform: scale(1.04); }
.masonry-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 60%); opacity: 0; transition: opacity 0.3s; }
.masonry-item:hover .masonry-overlay { opacity: 1; }

/* ---------- texte éditorial ---------- */
.prose-section p { color: var(--muted); line-height: 1.8; font-size: 14px; margin-bottom: 14px; }
.prose-section p:last-child { margin-bottom: 0; }
.prose-section p strong, .prose-content strong { color: var(--text); }
.prose-section ul { list-style: disc; padding-left: 22px; color: var(--muted); line-height: 1.8; }
.prose-section ul li { margin-bottom: 6px; }
.prose-content { color: rgba(242,245,250,0.82); font-size: 13px; line-height: 1.75; }
.prose-content p { margin-bottom: 10px; }
.prose-content p:last-child { margin-bottom: 0; }
.prose-content ul { list-style: disc; padding-left: 20px; margin-bottom: 10px; }
.prose-content ol { list-style: decimal; padding-left: 20px; margin-bottom: 10px; }
.prose-content li { margin-bottom: 4px; }
.prose-content a { color: var(--accent); text-decoration: underline; }
.prose-content h1, .prose-content h2, .prose-content h3 { color: var(--text); margin: 16px 0 8px; font-size: 15px; }

/* ---------- FAQ ---------- */
.faq-item { border-radius: var(--radius); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; font-size: 13px; line-height: 1.7; color: var(--muted); }
.faq-item.open .faq-answer { max-height: 240px; }
.faq-icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; transition: all 0.25s ease; }
.faq-item.open .faq-icon { background: var(--accent-30); border-color: var(--accent-55); color: var(--accent); }
.faq-bar { height: 2px; background: var(--accent); opacity: 0; margin-top: 16px; transition: opacity 0.4s; }
.faq-item.open .faq-bar { opacity: 1; }
.faq-grid { grid-template-columns: 1fr !important; }

/* ---------- métiers ---------- */
.jobs-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.job-wrap { width: 100%; animation: fadeInUp 0.4s ease both; }
.job-card { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 24px; min-height: 320px; }
.job-card:hover { transform: translateY(-2px); }
.job-card-bg { position: absolute; inset: 0; z-index: 0; }
.job-card-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.45; transition: opacity 0.5s ease; }
.job-card:hover .job-card-bg img { opacity: 0.6; }
.job-card-bg-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(7,9,13,0.92) 0%, rgba(7,9,13,0.4) 55%, transparent 100%); }
.job-card-content { position: relative; z-index: 10; display: flex; flex-direction: column; flex: 1; justify-content: space-between; }
.job-card-footer { position: relative; z-index: 20; margin-top: 22px; }

/* ---------- partenaires ---------- */
.partners-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.partner-card { padding: 24px; display: flex; flex-direction: column; position: relative; overflow: hidden; animation: fadeInUp 0.4s ease both; }
.logo-box { width: 76px; height: 76px; border-radius: var(--radius); background: rgba(0,0,0,0.35); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.partner-card:hover .logo-box { border-color: var(--accent-55); }
.logo-box img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.promo-box { background: var(--accent-30); border: 1px solid var(--accent-40); border-radius: var(--radius); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; }

/* ---------- grilles de mise en page ---------- */
.presentation-grid { grid-template-columns: 1fr !important; }
.footer-grid { grid-template-columns: 1fr 1fr !important; }
.masonry-item, .glass-card, .entry-card { will-change: auto; }

/* ---------- utilitaires JS ---------- */
.typing span, .typing-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: typing 1.2s infinite; }
#ai-messages::-webkit-scrollbar { width: 4px; }
#ai-messages::-webkit-scrollbar-track { background: transparent; }
#ai-messages::-webkit-scrollbar-thumb { background: var(--accent-40); border-radius: 2px; }
::selection { background: var(--accent-40); color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 768px) {
  .nav-links { display: none !important; }
  .section-title { font-size: 21px; }
  .footer-grid { grid-template-columns: 1fr !important; }
  .cards-grid, .partners-grid { grid-template-columns: 1fr; }
}
@media (min-width: 640px) {
  .masonry { columns: 2; }
}
@media (min-width: 1024px) {
  .masonry { columns: 3; }
}

/* ---------- règlement (regulations.html) ---------- */
.cat-on { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 0 18px -4px var(--accent-55); }
.reg-section { display: none; }
.reg-section.active { display: flex; flex-direction: column; gap: 20px; }
.reg-card { padding: 26px; border-radius: var(--radius); }
.reg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 10px; }
.warn-card {
  background: rgba(245,176,65,0.08); border: 1px solid rgba(245,176,65,0.35); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 12px;
  font-size: 12px; color: #ffd391; line-height: 1.6;
}
.sub-title { display: flex; gap: 12px; margin-bottom: 18px; align-items: flex-start; }
.prose p { color: var(--muted); font-size: 14px; line-height: 1.8; margin-bottom: 12px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 700; }
.prose ul { list-style: none; padding: 0; margin-bottom: 12px; }
.prose ul li { position: relative; padding-left: 20px; margin-bottom: 8px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.prose ul li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-size: 12px; top: 3px; }
.prose h4 { color: var(--text); font-size: 12px; font-weight: 800; margin: 18px 0 8px; letter-spacing: 0.08em; text-transform: uppercase; }
