/* ---------- Exoquiz CSS commun — brand ExoService ---------- */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Conteneur max */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 12px; }
@media(min-width:1200px){ .wrap { max-width: 1200px; } }

/* Marque */
.brand { font-weight: 800; letter-spacing: -.01em; }
.brand-lg { font-size: 1.5rem; }
@media(min-width:768px){ .brand-lg { font-size: 1.875rem; } }

/* Cartes */
.card {
  background: var(--card-bg, #fff);
  border: 1px solid #E5E5E3;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: box-shadow .2s, transform .05s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); }

/* Badges */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: .15rem .25rem .15rem 0;
  border: 1px solid var(--border, rgba(0,0,0,.12));
  background: var(--badge-bg, rgba(210,176,96,.08));
  color: var(--exoMid, #6B6B6B);
}
.badge.ok {
  background: var(--badge-ok-bg, rgba(147,190,213,.12));
  color: var(--badge-ok-txt, #5A9AB8);
  border-color: var(--badge-ok-bdr, rgba(147,190,213,.3));
}

/* Overlay modale */
.overlay {
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  background: var(--overlay-bg, rgba(0,0,0,.55));
  z-index: 10000;
}
.modal-card {
  width: min(800px, 92vw);
  background: var(--card-bg, #fff);
  border: 1px solid var(--border2, rgba(0,0,0,.08));
  border-radius: 6px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
}

/* Navbar */
header.navbar {
  background: var(--navbar-bg, rgba(255,255,255,.92));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border2, rgba(0,0,0,.08));
  padding-top: .6rem;
  padding-bottom: .8rem;
}
.nav-gap { height: 10px; }
@media(min-width:900px){ .nav-gap { height: 14px; } }
header.navbar nav a {
  font-size: .9rem;
  padding: .5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--exoGold, #D2B060);
  color: #101415;
  border: 1px solid var(--exoGoldDark, #A88C40);
  transition: background .15s, color .15s;
}
header.navbar nav a:hover { background: var(--exoGoldLight, #E0C478); }
header.navbar nav a.active { background: #101415; color: #fff; border-color: #101415; }

/* ==== LAYOUT LATÉRAL ==== */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* Sidebar — toujours sombre (ExoBlack) */
.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  padding: 16px 12px;
  border-right: 1px solid rgba(210,176,96,.12);
  background: #101415;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; letter-spacing: .5px; font-size: 18px;
  color: #FDFDFD;
  padding: 4px 8px 16px;
  border-bottom: 1px solid rgba(210,176,96,.12);
  margin-bottom: 8px;
}

/* Label groupe nav */
.sidebar .nav-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 12px 10px 4px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: rgba(253,253,253,.65);
  font-weight: 500;
  font-size: .875rem;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar nav a svg { flex-shrink: 0; opacity: .7; transition: opacity .15s; }
.sidebar nav a:hover { background: rgba(210,176,96,.08); color: #FDFDFD; }
.sidebar nav a:hover svg { opacity: 1; }
.sidebar nav a.active {
  background: rgba(210,176,96,.12);
  color: #D2B060;
  font-weight: 600;
  border-left: 2px solid #D2B060;
  padding-left: 8px;
}
.sidebar nav a.active svg { opacity: 1; color: #D2B060; }

/* Logout — couleur atténuée */
.sidebar nav a#logoutLink { color: rgba(253,253,253,.4); margin-top: 8px; }
.sidebar nav a#logoutLink:hover { color: rgba(253,253,253,.75); background: rgba(255,255,255,.04); }

/* User card en bas de sidebar */
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 4px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .8rem;
  color: rgba(253,253,253,.6);
  opacity: 0;
  transition: opacity .15s ease;
}
.user-card.loaded { opacity: 1; }
.user-card .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(210,176,96,.15);
  border: 1px solid rgba(210,176,96,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}
.user-card .info { min-width: 0; }
.user-card .name {
  font-weight: 600;
  font-size: .825rem;
  color: #FDFDFD;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-card .role {
  font-size: .7rem;
  color: rgba(253,253,253,.4);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-top: 1px;
}

/* Mobile sidebar */
@media(max-width:1199px){
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto;
    flex-direction: row; flex-wrap: wrap; gap: 4px;
    align-items: center;
    border-right: none; border-bottom: 1px solid rgba(210,176,96,.12);
  }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar .nav-label { display: none; }
  .sidebar .user-card { display: none; }
}

/* ==== BANDEAU HERO ==== */
.top-banner {
  margin: 16px 0 24px;
  border-radius: 6px;
  border: 1px solid rgba(210,176,96,.18);
  background: linear-gradient(110deg, #101415 0%, #1a2025 60%, #1f2a30 100%);
  color: #fff;
  padding: 20px 24px;
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden;
}
/* Nid d'abeille — discret */
.top-banner::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='54'%3E%3Cpath d='M0 0L16 9M32 0L16 9L16 27L0 36L0 54M16 27L32 36L32 54' fill='none' stroke='rgba(210,176,96,.07)' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
}
.top-banner::before {
  content: '';
  position: absolute; top: -40px; left: -40px;
  width: 240px; height: 240px;
  background: radial-gradient(ellipse, rgba(210,176,96,.2) 0%, transparent 70%);
  pointer-events: none;
}
.top-banner .emoji {
  width: 44px; height: 44px; border-radius: 6px;
  background: rgba(210,176,96,.15);
  border: 1px solid rgba(210,176,96,.3);
  display: grid; place-items: center;
  font-size: 1.2rem;
  position: relative; z-index: 1;
  flex-shrink: 0;
}
.top-banner .title {
  font-weight: 700; font-size: 1.1rem;
  color: #FDFDFD;
  position: relative; z-index: 1;
}
.top-banner .sub {
  font-size: .85rem;
  color: rgba(253,253,253,.6);
  position: relative; z-index: 1;
}

/* ==== BOUTON PRINCIPAL (ExoGold) ==== */
.btn-gold {
  background: #D2B060;
  border: 1px solid #A88C40;
  color: #101415 !important;
  font-weight: 700;
  font-size: .875rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  transition: background .15s, box-shadow .15s, transform .05s;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 4px;
}
.btn-gold:hover { background: #E0C478; box-shadow: 0 2px 8px rgba(210,176,96,.3); }
.btn-gold:active { transform: translateY(1px); }

/* ==== BOUTON SECONDAIRE (ExoBlack) ==== */
.btn-dark {
  background: #101415;
  border: 1px solid #101415;
  color: #FDFDFD !important;
  font-weight: 600;
  font-size: .875rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: background .15s;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 4px;
}
.btn-dark:hover { background: #1f2a30; }

/* ==== BOUTON STEEL ==== */
.btn-blue, .btn-steel {
  background: rgba(147,190,213,.12);
  border: 1px solid rgba(147,190,213,.3);
  color: #5A9AB8 !important;
  font-weight: 600;
  font-size: .875rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: background .15s;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 4px;
}
.btn-blue:hover, .btn-steel:hover { background: rgba(147,190,213,.2); }

/* ==== CARTES QUIZ (dashboard) ==== */
.dash-quiz-card {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid #E5E5E3;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow .18s, transform .12s;
  text-decoration: none; color: inherit;
}
.dash-quiz-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); transform: translateY(-2px); }
.dash-quiz-card-accent { height: 3px; background: #D2B060; }
.dash-quiz-card-body { padding: 14px 14px 10px; flex: 1; }
.dash-quiz-card-body .title { font-weight: 600; font-size: .95rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dash-quiz-card-body .meta { font-size: .75rem; color: var(--exoMid, #6B6B6B); margin-top: 4px; }
.dash-quiz-card-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  padding: 8px 14px;
  border-top: 1px solid #E5E5E3;
  background: #F4F4F2;
  flex-wrap: wrap;
}
.dash-quiz-card-footer a,
.dash-quiz-card-footer button {
  font-size: .8rem; font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  cursor: pointer; white-space: nowrap;
  text-decoration: none; color: #101415;
  transition: background .12s;
  display: inline-flex; align-items: center; gap: 5px;
}
.dash-quiz-card-footer a:hover,
.dash-quiz-card-footer button:hover { background: #F4F4F2; }
.dash-quiz-card-footer .btn-edit { background: #D2B060; border-color: #A88C40; color: #101415; font-weight: 700; }
.dash-quiz-card-footer .btn-edit:hover { background: #E0C478; }
.dash-quiz-card-footer .btn-launch { background: #101415; border-color: #101415; color: #fff; font-weight: 700; }
.dash-quiz-card-footer .btn-launch:hover { background: #1f2a30; }

/* ==== CARTES RAPPORT (dashboard) ==== */
.dash-report-card {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid #E5E5E3;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow .18s, transform .12s;
}
.dash-report-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); transform: translateY(-2px); }
.dash-report-card-accent { height: 3px; background: #93BED5; }
.dash-report-card-body { padding: 14px 14px 10px; flex: 1; }
.dash-report-card-body .title { font-weight: 600; font-size: .95rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #101415; }
.dash-report-card-body .meta { font-size: .75rem; color: var(--exoMid, #6B6B6B); margin-top: 4px; }
.dash-report-card-footer {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 8px 14px;
  border-top: 1px solid #E5E5E3;
  background: #F4F4F2;
}
.dash-report-card-footer a {
  font-size: .8rem; font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  background: #101415; color: #fff;
  text-decoration: none;
  transition: background .12s;
  display: inline-flex; align-items: center; gap: 5px;
}
.dash-report-card-footer a:hover { background: #1f2a30; }

/* ==== CHAMPS DE RECHERCHE ==== */
.big-input, .big-btn { height: 48px; border-radius: 4px; }
.big-input {
  max-width: 400px; padding: 0 1rem;
  font-size: 1rem;
  border: 1px solid #D0D0CE;
  background: #fff;
}
.big-input:focus {
  outline: none;
  border-color: #D2B060;
  box-shadow: 0 0 0 3px rgba(210,176,96,.15);
}
.big-btn { padding: 0 1.5rem; white-space: nowrap; }
.grower { flex: 1 1 520px; }

/* ==== DARK MODE overrides ==== */
html.dark .dash-quiz-card { background: var(--card-bg); border-color: var(--border2); color: var(--text); }
html.dark .dash-quiz-card-footer { background: var(--bg3); border-top-color: var(--border2); }
html.dark .dash-quiz-card-footer a,
html.dark .dash-quiz-card-footer button { background: var(--bg4); border-color: var(--border); color: var(--text); }
html.dark .dash-quiz-card-footer .btn-edit { background: #D2B060; color: #101415; border-color: #A88C40; }
html.dark .dash-quiz-card-footer .btn-launch { background: #101415; color: #fff; border-color: transparent; }
html.dark .dash-report-card { background: var(--card-bg); border-color: var(--border2); }
html.dark .dash-report-card-body .title { color: var(--text); }
html.dark .dash-report-card-body .meta { color: var(--text3); opacity: 1; }
html.dark .dash-report-card-footer { background: var(--bg3); border-top-color: var(--border2); }
html.dark .big-input { background: var(--input-bg) !important; color: var(--text) !important; border-color: var(--border) !important; }
html.dark .user-card { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); }
html.dark .top-banner { border-color: rgba(210,176,96,.15); }

/* ==== UTILITAIRES ==== */
.full-wrap { padding: 0 16px 24px; }
@media(min-width:900px){ .full-wrap { padding: 0 28px 28px; } }
