/* ─── TRIFORMS — Base CSS ─────────────────────────────────────────────────── */

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

:root {
  /* Couleurs */
  --bg:           #f8fafc;
  --bg-2:         #f1f5f9;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --border-focus: #6366f1;
  --text:         #1e293b;
  --text-2:       #64748b;
  --text-3:       #94a3b8;

  /* Primaire */
  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-light:#eef2ff;

  /* Statuts */
  --success:      #22c55e;
  --success-bg:   #f0fdf4;
  --warning:      #f59e0b;
  --warning-bg:   #fffbeb;
  --danger:       #ef4444;
  --danger-bg:    #fef2f2;

  /* Accent Triads */
  --accent:       #e8427a;

  /* Vote3D */
  --x-color:      #4d88ff;
  --y-color:      #33c984;
  --z-color:      #f5a623;

  /* Intentions */
  --human:        #e8427a;
  --money:        #33c984;
  --chaos:        #f5a623;
  --philosophy:   #9b59b6;

  /* Espacements */
  --r:            8px;
  --r-lg:         12px;
  --r-xl:         16px;

  /* Ombres */
  --shadow:       0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 24px rgba(0,0,0,.12);

  /* Transitions */
  --t:            150ms ease;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Typographie ─────────────────────────────────────────────────────────── */

h1 { font-size: 1.875rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem;   font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.25rem;  font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.125rem; font-weight: 600; }
h5 { font-size: 1rem;     font-weight: 600; }

p  { color: var(--text-2); }

a  { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

small { font-size: .875rem; color: var(--text-2); }

strong { font-weight: 600; color: var(--text); }

/* ─── Layout helpers ──────────────────────────────────────────────────────── */

.container     { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm  { max-width: 640px;  margin: 0 auto; padding: 0 1.5rem; }
.container-md  { max-width: 800px;  margin: 0 auto; padding: 0 1.5rem; }

.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1         { gap: .5rem; }
.gap-2         { gap: 1rem; }
.gap-3         { gap: 1.5rem; }
.gap-4         { gap: 2rem; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-sm     { font-size: .875rem; }
.text-xs     { font-size: .75rem; }
.text-muted  { color: var(--text-2); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-primary{ color: var(--primary); }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.w-full  { width: 100%; }
.hidden  { display: none !important; }

/* ─── Page skeleton ───────────────────────────────────────────────────────── */

.page-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg);
}

.page-admin {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.page-form {
  min-height: 100vh;
  background: var(--bg);
  padding: 2rem 1rem 4rem;
}

/* ─── Scrollbar ───────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-admin { grid-template-columns: 1fr; }
}
