/* Thème RCorp : marine, accent ciel (repris du logo). Partagé par l'accueil et l'administration. */
:root {
  --navy-950: #050D1F;
  --navy-900: #0B1B3A;
  --navy-850: #0F2246;
  --navy-800: #13294B;
  --navy-700: #1B3A66;
  --line: #24497A;
  --accent: #6FC3FF;
  --accent-2: #5A9AD6;
  --brand-deep: #1B4D8C;
  --text: #E8EEF8;
  --muted: #A9BCD6;
  --public: #34D399;
  --public-bg: #0B3B30;
  --private: #FBBF24;
  --private-bg: #3D2E0A;
  --danger: #F87171;
  --danger-bg: #3E1518;
  --radius: 10px;
  --radius-lg: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    url("/assets/img/circuit.svg"),
    radial-gradient(ellipse 70% 40% at 50% 0%, #12305E 0%, var(--navy-900) 70%);
  background-color: var(--navy-900);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; flex-shrink: 0; }

/* Barre supérieure */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(11, 27, 58, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--navy-700);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; }
.nav { display: flex; gap: 20px; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--text); }
.session { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.session .who { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--accent-2); border-radius: var(--radius);
  background: var(--brand-deep); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--navy-800); }
.btn-small { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn .ico { width: 18px; height: 18px; }

/* Accueil */
.page { width: min(1160px, 100%); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 48px; flex: 1; }
.page.narrow { width: min(720px, 100%); }
.hero { text-align: center; padding: clamp(32px, 7vh, 72px) 0 clamp(24px, 4vh, 40px); }
.hero .wordmark { width: min(420px, 80vw); height: auto; }
.hero h1 { margin: 20px 0 8px; font-size: clamp(26px, 4vw, 40px); line-height: 1.2; }
.lead { margin: 0 auto; max-width: 60ch; color: var(--muted); font-size: clamp(15px, 2vw, 18px); }
.status-code { margin: 0; font-size: 56px; font-weight: 700; color: var(--accent); }

/* Pages d'erreur : icône dans un cercle, code discret, contact, heure et référence en pied */
.error .error-icon {
  display: grid; place-items: center; width: 88px; height: 88px; margin: 0 auto 14px;
  border-radius: 50%; background: var(--navy-800); border: 1px solid var(--line); color: var(--accent);
}
.error .error-icon .ico { width: 44px; height: 44px; }
.error .status-code { font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.error h1 { margin-top: 6px; }
.error-warn .error-icon { background: var(--private-bg); border-color: #5C4714; color: var(--private); }
.error-warn .status-code { color: var(--private); }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 24px 0 0; }
.error-meta {
  width: min(460px, 100%); margin: 32px auto 0; padding-top: 14px;
  border-top: 1px solid var(--navy-700); color: #7F95B5; font-size: 13px;
}
.error-meta p, .contact { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0; }
.error-meta .ico, .contact .ico { width: 15px; height: 15px; }

.search {
  display: flex; align-items: center; gap: 10px;
  width: min(560px, 100%); margin: 28px auto 0; padding: 0 14px 0 4px;
  background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--muted);
  transition: width .2s ease, border-radius .2s ease;
}
.search:focus-within { border-color: var(--accent); }
.search-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0;
  padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
}
.search-toggle:hover { color: var(--text); }
/* Repliée : simple bouton rond, la barre se déploie au clic ou avec « / » */
.search.collapsed { width: 50px; padding: 4px; border-radius: 999px; }
.search.collapsed input, .search.collapsed kbd { display: none; }
.search input {
  flex: 1; min-width: 0; height: 48px; border: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 16px; outline: none;
}
.search input::placeholder { color: #7F95B5; }
kbd {
  padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px;
  font: 12px/1.6 var(--font); color: var(--muted);
}

.group { margin-top: 36px; }
.group h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 20px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-public { background: var(--public); }
.dot-private { background: var(--private); }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 999px;
  background: var(--private-bg); color: var(--private); font-size: 13px; font-weight: 600;
}
.tag .ico { width: 15px; height: 15px; }
.hint { color: var(--muted); margin: 0 0 16px; }
.no-result { text-align: center; margin-top: 32px; }

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.card a {
  display: flex; flex-direction: column; height: 100%;
  padding: 16px 16px 10px; border: 1px solid var(--navy-700); border-radius: var(--radius-lg);
  background: rgba(19, 41, 75, 0.72); color: var(--text); text-decoration: none;
  transition: border-color .15s, transform .15s, background .15s;
}
.card a:hover, .card a:focus-visible { border-color: var(--accent-2); background: var(--navy-800); transform: translateY(-2px); }
.card-icon {
  display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 12px; background: var(--navy-900); border: 1px solid var(--line); color: var(--accent);
}
.card-icon .ico { width: 24px; height: 24px; }
.card-top { display: flex; align-items: flex-start; gap: 14px; }
.card-body { display: flex; flex-direction: column; justify-content: center; min-width: 0; min-height: 44px; flex: 1; }
/* Pas de coupure au milieu d'un mot : césure française seulement si un mot ne tient pas seul */
.card-title { font-weight: 650; line-height: 1.35; overflow-wrap: break-word; hyphens: auto; }
.card-desc { color: var(--muted); font-size: 14px; line-height: 1.45; margin-top: 2px; }
.card-foot {
  position: relative; display: flex; justify-content: center;
  margin-top: auto; padding: 10px 22px 0;
  color: #7F95B5; font-size: 13px;
}
.card-top + .card-foot { margin-top: 12px; border-top: 1px solid var(--navy-700); }
.card-url { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot .card-go { position: absolute; right: 0; bottom: 2px; width: 16px; height: 16px; color: #5A7AA3; transition: color .15s; }
.card a:hover .card-go, .card a:focus-visible .card-go { color: var(--accent); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; max-width: 45%;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge .ico { width: 13px; height: 13px; }
.badge-public { background: var(--public-bg); color: var(--public); }
.badge-private { background: var(--private-bg); color: var(--private); }
.card-private a { border-color: #3A3A2A; }

.footer {
  padding: 20px clamp(16px, 4vw, 40px);
  border-top: 1px solid var(--navy-700);
  color: var(--muted); font-size: 14px; text-align: center;
}

@media (max-width: 720px) {
  .topbar { gap: 12px; flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; gap: 16px; }
  .session .who span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card a, .search { transition: none; }
  .card a:hover { transform: none; }
}
