/* ============================================================
   SOLYFONTE DEVIS — Design System
   Thème clair · Apple-inspired · Bootstrap 5 + Tailwind CDN
   ============================================================ */

:root {
  --accent:         #ec481d;
  --accent-soft:    rgba(236,72,29,0.12);
  --accent-hover:   #d63e15;

  /* Courbe spring Apple (décélération naturelle) */
  --ease-spring:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out:       cubic-bezier(0.25, 0.1, 0.25, 1);

  /* Système de shadows ambiant */
  --shadow-xs:  0 0 0 1px rgba(0,0,0,.03), 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm:  0 0 0 1px rgba(0,0,0,.03), 0 2px 4px rgba(0,0,0,.05),
                0 8px 16px rgba(0,0,0,.04);
  --shadow-md:  0 0 0 1px rgba(0,0,0,.04), 0 4px 8px rgba(0,0,0,.06),
                0 16px 32px rgba(0,0,0,.06), 0 32px 48px rgba(0,0,0,.03);
  --shadow-lg:  0 0 0 1px rgba(0,0,0,.04), 0 8px 16px rgba(0,0,0,.07),
                0 24px 48px rgba(0,0,0,.08), 0 48px 64px rgba(0,0,0,.04);
}

/* ---------- Base ---------- */
html {
  position: relative;
  min-height: 100%;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (min-width: 768px) { html { font-size: 16px; } }

body {
  background-color: #f0f2f5;
  color: #0f172a;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}

/* ---------- Animation d'entrée de page ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; }   /* ← pas de transform ici : évite le stacking context */
}

/* opacity:0 initial = pas de flash avant que l'animation démarre */
main[role="main"] {
  opacity: 0;
  animation: fadeUp 420ms var(--ease-spring) forwards;
}

/* Sans transform dans "to", fill-mode:forwards ne crée pas de stacking context
   → les modals Bootstrap position:fixed restent ancrées sur la viewport */
@media (prefers-reduced-motion: reduce) {
  main[role="main"] { animation: none; opacity: 1; }
}

/* ---------- Liens ---------- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 150ms var(--ease-out);
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---------- Composant Panel (carte principale élevée) ---------- */
.panel {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,.055);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 250ms var(--ease-spring),
              transform  250ms var(--ease-spring);
}

.panel:hover {
  box-shadow: var(--shadow-md);
}

/* ---------- Cards Bootstrap ---------- */
.card {
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 14px;
  box-shadow: var(--shadow-xs);
  background-color: #fff;
  transition: box-shadow 250ms var(--ease-spring),
              transform  250ms var(--ease-spring);
}

.card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.card-header {
  background-color: #f8fafc;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

/* ---------- Boutons ---------- */
.btn {
  transition: transform 150ms var(--ease-spring),
              box-shadow 150ms var(--ease-spring),
              opacity    150ms ease;
}

.btn-primary {
  --bs-btn-bg:             var(--accent);
  --bs-btn-border-color:   var(--accent);
  --bs-btn-hover-bg:       var(--accent-hover);
  --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-active-bg:      var(--accent-hover);
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(236,72,29,.25), 0 3px 8px rgba(236,72,29,.15);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(236,72,29,.3), 0 8px 20px rgba(236,72,29,.2);
}

.btn-primary:active { transform: translateY(0) scale(0.99); }

.btn-secondary,
.btn-outline-secondary,
.btn-info,
.btn-outline-light {
  border-radius: 8px;
}

/* ---------- Focus ---------- */
.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.btn:focus-visible,
.form-check-input:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

/* ---------- Champs désactivés ---------- */
.form-control:disabled,
.form-control[readonly],
.form-select:disabled,
textarea:disabled,
textarea[readonly] {
  background-color: #f1f5f9 !important;
  color: #64748b;
  cursor: not-allowed;
  opacity: 1 !important;
}

/* ---------- Tables ---------- */
.table thead th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  border-bottom-color: rgba(0,0,0,.06);
}

/* ---------- Badges ---------- */
.badge {
  border-radius: 999px;
  padding-inline: 0.7rem;
  padding-block: 0.3rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ---------- text-white-50 en thème clair ---------- */
.text-white-50 { color: #94a3b8 !important; }
.bg-dark .text-white-50,
.modal-content.bg-dark .text-white-50 { color: rgba(255,255,255,.5) !important; }

/* ---------- Alertes Bootstrap ---------- */
.alert {
  border-radius: 12px;
  border-width: 1px;
}

/* ---------- Formulaires ---------- */
.form-control,
.form-select,
textarea {
  border-radius: 8px;
  border-color: rgba(0,0,0,.12);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

/* ---------- Champ obligatoire vide (validation) ---------- */
.js-invalid,
.input-validation-error,
.js-invalid:focus,
.input-validation-error:focus {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.18) !important;
}

/* ---------- Menus déroulants de navigation (même DA que les pills du menu) ---------- */
header .dropdown-menu {
  padding: 6px;
  margin-top: 6px;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.04);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-family: 'Inter', system-ui, sans-serif;
}

header .dropdown-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: .875rem;              /* text-sm */
  font-weight: 500;
  color: #64748b;                  /* slate-500 */
  transition: color 150ms ease, background-color 150ms ease;
}
header .dropdown-item:hover,
header .dropdown-item:focus {
  color: #0f172a;                  /* slate-900 */
  background-color: rgba(0,0,0,.05);
}
header .dropdown-item.active,
header .dropdown-item:active {
  color: #ea580c;                  /* orange-600 */
  background-color: #fff7ed;       /* orange-50 */
}

header .dropdown-header {
  padding: 6px 12px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;                  /* slate-400 */
  font-weight: 600;
}
