/* ═══════════════════════════════════════════════════════
   SENVIRTUEL v2 — Base Reset + Typographie
═══════════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--txt-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { object-fit: cover; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--txt-1);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* ── Sélection ── */
::selection { background: var(--primary-soft); color: var(--txt-1); }

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── App shell ── */
#sv-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

#sv-main {
  flex: 1;
  padding-top: calc(var(--header-h) + var(--catbar-h));
}

/* ── Pages sans catbar ── */
#sv-main.no-catbar {
  padding-top: var(--header-h);
}

/* ── Page d'accueil : catbar masquée, on retire son espace ── */
body.on-hero #sv-main {
  padding-top: var(--header-h);
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
@media (max-width: 768px) {
  .container { padding: 0 var(--sp-4); }
}

/* ── Grille ── */
.grid { display: grid; }
.flex { display: flex; }
.hidden { display: none !important; }

/* ── Utilitaires texte ── */
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--txt-2); }
.text-xs  { font-size: var(--text-xs); }
.text-sm  { font-size: var(--text-sm); }
.text-lg  { font-size: var(--text-lg); }
.text-xl  { font-size: var(--text-xl); }
.font-bold   { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }

/* ── États de chargement ── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.4s ease infinite;
  border-radius: var(--r-md);
}
@keyframes skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Animations d'entrée ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes slideInUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.animate-in   { animation: fadeIn var(--dur-normal) var(--ease) both; }
.animate-scale { animation: fadeInScale var(--dur-normal) var(--ease) both; }

/* ── Page transitions ── */
.page-enter {
  animation: fadeIn 200ms var(--ease) both;
}

/* ── Séparateur ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-6) 0;
}

/* ── Badge dot ── */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.dot.warning { background: var(--warning); }
.dot.danger  { background: var(--danger); }

/* ── Overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-drawer);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-normal) var(--ease);
}
.overlay.active {
  opacity: 1;
  pointer-events: all;
}
