/* ═══════════════════════════════════════════════════════════════
   AutoMate — global.css
   Styles partagés entre index.html, espace-client et admin
   ═══════════════════════════════════════════════════════════════ */

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

/* ── VARIABLES — Palette AutoMate ── */
:root {
  /* Couleurs principales */
  --marine:      #1a1a2e;
  --marine-2:    #16213e;
  --marine-80:   rgba(26, 26, 46, 0.8);
  --blue:        #4f8ef7;
  --blue-dark:   #2563eb;
  --blue-light:  #e8f0fe;
  --blue-dim:    rgba(79, 142, 247, 0.15);
  --blue-glow:   rgba(79, 142, 247, 0.06);

  /* Fond & surface */
  --bg:          #f8fafc;
  --bg-alt:      #f1f5f9;
  --surface:     #ffffff;
  --white:       #ffffff;

  /* Texte & bordures */
  --text:        #0f172a;
  --muted:       #64748b;
  --border:      #e2e8f0;

  /* Alias grille grise (espace-client) */
  --grey-50:     #f1f5f9;
  --grey-100:    #e2e8f0;
  --grey-300:    #94a3b8;
  --grey-500:    #64748b;
  --grey-700:    #334155;
  --grey-900:    #0f172a;

  /* États */
  --green:       #10b981;
  --green-dim:   rgba(16, 185, 129, 0.12);
  --amber:       #f59e0b;
  --amber-dim:   rgba(245, 158, 11, 0.12);
  --orange:      #f59e0b;
  --red:         #ef4444;
  --red-dim:     rgba(239, 68, 68, 0.12);

  /* Espacements & formes */
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   20px;

  /* Ombres */
  --shadow:      0 1px 3px rgba(0,0,0,0.06), 0 4px 20px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 24px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.12);

  /* Transition commune */
  --t:           0.2s cubic-bezier(.4, 0, .2, 1);
}

/* ── TYPOGRAPHIE DE BASE ── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .brand {
  font-family: 'Syne', sans-serif;
}

/* ── UTILITAIRES ── */

/* Police monospace */
.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ── BOUTONS PARTAGÉS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  background: var(--marine);
  padding: 9px 20px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t), transform 0.15s;
}
.btn-primary:hover {
  background: #12122a;
  transform: translateY(-1px);
}
.btn-primary.blue {
  background: var(--blue);
}
.btn-primary.blue:hover {
  background: var(--blue-dark);
}
.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t);
}
.btn-ghost:hover {
  background: var(--bg-alt);
}

/* ── BADGES STATUT ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
}
.badge::before {
  content: '●';
  font-size: 7px;
}

.badge-green  { background: var(--green-dim);  color: var(--green); }
.badge-amber  { background: var(--amber-dim);  color: var(--amber); }
.badge-orange { background: var(--amber-dim);  color: var(--amber); }
.badge-red    { background: var(--red-dim);    color: var(--red); }
.badge-blue   { background: var(--blue-dim);   color: var(--blue); }
.badge-grey   { background: var(--grey-50);    color: var(--grey-500); }

/* ── ANIMATIONS REVEAL (scroll) ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── ANIMATIONS COMMUNES ── */
@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.4); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--green-dim); }
  50%       { box-shadow: 0 0 0 6px var(--green-dim); }
}

/* ── TOAST — Notification utilisateur ── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--grey-900);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 99px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#toast.success { background: var(--green); }
#toast.error   { background: var(--red); }
#toast.warning { background: var(--amber); color: var(--grey-900); }

/* ── CHAMPS DE FORMULAIRE ── */
.form-input,
.form-select,
.form-textarea,
.field-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.field-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.12);
  background: var(--surface);
}
.form-textarea,
.field-input[rows] {
  resize: vertical;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  section { padding: 64px 20px; }
}
