/* ============================================================
   main.css — DHN Conseil SaaS
   Design : professionnel, sobre, moderne
   ============================================================ */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap');

/* ─── Variables ─── */
:root {
  --font-sans : 'Instrument Sans', sans-serif;
  --font-mono : 'DM Mono', monospace;

  /* Couleurs principales */
  --primary      : #2563eb;
  --primary-dark : #1d4ed8;
  --primary-light: #eff6ff;

  /* Neutres */
  --bg           : #f8fafc;
  --surface      : #ffffff;
  --surface2     : #f1f5f9;
  --border       : #e2e8f0;
  --border-strong: #cbd5e1;

  /* Textes */
  --text         : #0f172a;
  --text-muted   : #64748b;
  --text-light   : #94a3b8;

  /* Statuts */
  --green        : #16a34a;
  --green-bg     : #f0fdf4;
  --red          : #dc2626;
  --red-bg       : #fef2f2;
  --orange       : #d97706;
  --orange-bg    : #fffbeb;
  --blue-bg      : #eff6ff;
  --purple       : #7c3aed;
  --purple-bg    : #f5f3ff;
  --teal         : #0891b2;
  --teal-bg      : #ecfeff;

  /* Layout */
  --sidebar-w    : 260px;
  --radius       : 10px;
  --radius-sm    : 6px;
  --radius-lg    : 16px;
  --shadow       : 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md    : 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg    : 0 8px 32px rgba(0,0,0,.10);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: subpixel-antialiased; }
/* ─── Police monospace — éviter le faux gras ─── */


a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* ============================================================
   PAGES AUTH (login, register, reset...)
   ============================================================ */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
}

.auth-left {
  background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 50%, #1d4ed8 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-left-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.auth-left-logo .logo-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(10px);
}

.auth-left-logo .logo-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.auth-left-body {
  position: relative;
  z-index: 1;
}

.auth-left-body h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.auth-left-body p {
  color: rgba(255,255,255,0.65);
  font-size: 15px;
  line-height: 1.7;
  max-width: 360px;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.auth-feature .feat-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #60a5fa;
  flex-shrink: 0;
}

/* ─── Partie droite (formulaire) ─── */
.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}

.auth-box {
  width: 100%;
  max-width: 420px;
}

.auth-box h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.auth-box .auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

/* ─── Formulaires ─── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-control::placeholder { color: var(--text-light); }

.form-control.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220,38,38,.10);
}

textarea.form-control {
  height: auto;
  padding: 10px 14px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Input avec icône */
.input-group {
  position: relative;
}

.input-group .form-control {
  padding-left: 42px;
}

.input-group .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 16px;
  pointer-events: none;
}

/* Bouton afficher/cacher mot de passe */
.input-group .input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  font-size: 16px;
}

.input-group .input-toggle:hover { color: var(--text-muted); }

/* Erreur inline */
.form-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Boutons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  text-decoration: none;
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--surface2);
  text-decoration: none;
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.btn-full { width: 100%; }

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 50px; padding: 0 28px; font-size: 15px; }

/* ─── Alertes ─── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert-success {
  background: var(--green-bg);
  border-color: #bbf7d0;
  color: #15803d;
}

.alert-error {
  background: var(--red-bg);
  border-color: #fecaca;
  color: #b91c1c;
}

.alert-info {
  background: var(--blue-bg);
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.alert-warning {
  background: var(--orange-bg);
  border-color: #fde68a;
  color: #92400e;
}

/* ─── Divider texte ─── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-light);
  font-size: 12px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Liens sous formulaire ─── */
.auth-links {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 20px;
}

.auth-links a {
  color: var(--primary);
  font-weight: 600;
}

/* ─── Indicateur force mot de passe ─── */
.password-strength {
  margin-top: 8px;
}

.strength-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s, background .3s;
  width: 0%;
}

.strength-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Checkbox ─── */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ─── Spinner ─── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-gray   { background: var(--surface2);    color: var(--text-muted); }
.badge-blue   { background: var(--blue-bg);     color: var(--primary); }
.badge-green  { background: var(--green-bg);    color: var(--green); }
.badge-red    { background: var(--red-bg);      color: var(--red); }
.badge-orange { background: var(--orange-bg);   color: var(--orange); }
.badge-purple { background: var(--purple-bg);   color: var(--purple); }
.badge-teal   { background: var(--teal-bg);     color: var(--teal); }
.badge-yellow { background: #fefce8;            color: #854d0e; }
.badge-dark   { background: #1e293b;            color: #e2e8f0; }

/* ─── Progress bar ─── */
.progress {
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width .4s;
}

/* ─── Pagination ─── */
.pagination { display: flex; justify-content: center; margin-top: 24px; }
.pagination-list { display: flex; list-style: none; gap: 4px; }
.page-link {
  display: flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-muted);
  transition: all .15s;
}
.page-link:hover { background: var(--surface2); text-decoration: none; color: var(--text); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ─── Responsive auth ─── */
@media (max-width: 768px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { padding: 32px 20px; align-items: flex-start; padding-top: 60px; }
}

/* ─── Utilitaires ─── */
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-small   { font-size: 13px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.d-none { display: none; }
/* Montants comptables - rendu net */

.font-mono, td.num, .lite-table td:nth-child(3) { font-weight: 600; }
