/* ─────────────────────────────────────────────────────────────
   Stracle — Global Styles
   Partagé entre toutes les pages. Ne contient que les composants
   réutilisables : tokens, boutons, modal, toast, animations.
   Les styles spécifiques à une page restent dans son <style>.
   ───────────────────────────────────────────────────────────── */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700;12..96,800&family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design tokens ── */
:root {
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body:    'Manrope', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --gold:     #c9a84c;
  --gold2:    #f0d080;
  --gold-rgb: 201, 168, 76;
  --gold-glow: rgba(var(--gold-rgb), 0.06);
  --bg:     #07090f;
  --bg2:    #090b13;
  --bg3:    #0c0f1a;
  --border: #1e2236;
  --text:   #eceef8;
  --muted:  #7880a8;
  --muted2: #4e5878;

  /* Feedback states */
  --error:   #e07b54;
  --success: #6bbf7a;

  /* Semantic status colors (analyses, tags, risk levels) */
  --status-ok:      #4ade80;
  --status-warning: #fbbf24;
  --status-risk:    var(--error);
  --status-muted:   #545e80;
  --tag-purple:     #b5a1d4;
  --tag-blue:       #7eb8d4;
  --tag-blue-grey:  #9bb5d4;
  --tag-kaki:       #7a8460;
  --data-green:     #8bc48a;

  /* Produits */
  --lease:   #9b7fd4;
  --lease2:  #c4a8f0;
  --model:   #5b9bd4;
  --model2:  #88c0f0;
  --insight: #3ecfc6;
  --insight2:#7eeae4;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: #0a0c14; }
::-webkit-scrollbar-thumb { background: #1e2130; border-radius: 2px; }

/* Base */
body {
  background: #07090f;
  color: #eceef8;
  font-family: var(--font-body);
  min-height: 100vh;
}

/* ── Interactive elements ── */
.tbtn {
  cursor: pointer;
  transition: all 0.15s;
}
.tbtn:hover { background: #111520 !important; }

.rbtn { transition: background 0.1s; }
.rbtn:hover { background: #0d0f18 !important; cursor: pointer; }

/* Delete button — visible only on row hover */
.delbtn {
  opacity: 0;
  transition: opacity 0.15s;
  cursor: pointer;
}
tr:hover .delbtn { opacity: 1; }

/* Drop zone */
.dropz {
  transition: all 0.2s;
  cursor: pointer;
}
.dropz:hover {
  border-color: #c9a84c !important;
  background: #c9a84c07 !important;
}

/* File / action buttons */
.fbtn {
  cursor: pointer;
  transition: all 0.15s;
}
.fbtn:hover {
  background: #c9a84c14 !important;
  border-color: #c9a84c77 !important;
}

/* Metric / toggle buttons */
.mbtn {
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}
.mbtn:hover { opacity: 0.8; }

/* Asset cards */
.acard {
  transition: all 0.18s;
  cursor: pointer;
  border: 1px solid #141720 !important;
}
.acard:hover {
  border-color: #c9a84c44 !important;
  transform: translateY(-1px);
}

/* ── Animations ── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

.fi { animation: fadeIn 0.25s ease both; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #c9a84c33;
  border-top-color: #c9a84c;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

/* ── Boutons communs ─────────────────────────────────────────
   Utilisés sur subscription.html, account.html, et tout nouveau composant.
   ─────────────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #07090f; border: none; border-radius: 8px;
  padding: 10px 20px; font-family: var(--font-body);
  font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  border-radius: 8px; padding: 9px 20px; font-family: var(--font-body);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: #2a3050; color: var(--text); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-danger-outline {
  background: transparent; border: 1px solid rgba(239,68,68,0.25); color: #f87171;
  border-radius: 8px; padding: 9px 20px; font-family: var(--font-body);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: all 0.15s;
}
.btn-danger-outline:hover { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.5); }

/* ── Composant Modal ─────────────────────────────────────────
   Usage :
     <div class="modal-overlay" id="myModal">
       <div class="modal-box">
         <div class="modal-header"> … </div>
         <div class="modal-body"> … </div>
         <div class="modal-footer"> … </div>
       </div>
     </div>
   Ouvrir  : document.getElementById('myModal').classList.add('open')
   Fermer  : document.getElementById('myModal').classList.remove('open')
   ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5,7,15,0.82);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-box {
  background: #0c0f1a;
  border: 1px solid #1e2235;
  border-radius: 16px;
  width: 100%; max-width: 680px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}

.modal-header {
  padding: 22px 28px 18px;
  border-bottom: 1px solid #1a1d2a;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.modal-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--text); }
.modal-subtitle { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.modal-close {
  background: none; border: none; color: var(--muted2);
  font-size: 18px; cursor: pointer; padding: 2px; line-height: 1; flex-shrink: 0;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 24px 28px;
  overflow-y: auto; flex: 1;
  font-size: 13px; color: var(--muted); line-height: 1.75;
}
.modal-body h3 {
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  color: var(--text); text-transform: uppercase; letter-spacing: 0.06em;
  margin: 20px 0 8px;
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin-bottom: 10px; }
.modal-body table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12px; }
.modal-body th {
  text-align: left; padding: 8px 12px;
  background: rgba(255,255,255,0.03); border: 1px solid #1a1d2a;
  color: var(--text); font-weight: 500;
}
.modal-body td { padding: 8px 12px; border: 1px solid #1a1d2a; }

.modal-footer {
  padding: 18px 28px 22px;
  border-top: 1px solid #1a1d2a;
  display: flex; flex-direction: column; gap: 14px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.modal-check-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.modal-check-row input[type=checkbox] {
  width: 17px; height: 17px; flex-shrink: 0;
  accent-color: var(--gold); margin-top: 1px; cursor: pointer;
}
.modal-check-label { font-size: 13px; color: var(--text); line-height: 1.5; }

/* Boutons dans les modales */
.modal-btn-cancel {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 8px; padding: 9px 20px;
  font-family: var(--font-body); font-size: 13px; cursor: pointer;
  transition: all 0.15s;
}
.modal-btn-cancel:hover { border-color: #2a3050; color: var(--text); }

.modal-btn-confirm {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #07090f; border: none; border-radius: 8px; padding: 9px 22px;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.modal-btn-confirm:hover { opacity: 0.88; }
.modal-btn-confirm:disabled { opacity: 0.4; cursor: not-allowed; }

.modal-btn-danger {
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.35);
  color: #f87171; border-radius: 8px; padding: 9px 22px;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.modal-btn-danger:hover { background: rgba(239,68,68,0.2); }

/* ── Toast notifications ─────────────────────────────────────
   Générées dynamiquement par dialog.js — showToast(msg, type)
   ─────────────────────────────────────────────────────────── */
.toast {
  position: fixed; top: 68px; right: 24px;
  padding: 12px 20px; border-radius: 10px;
  font-family: var(--font-body); font-size: 13px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 9999; animation: fadeIn 0.2s ease both;
  max-width: 360px; line-height: 1.4;
}
.toast-success { background: #0d1a0d; border: 1px solid rgba(74,222,128,0.3);  color: #4ade80; }
.toast-error   { background: #1a0d0d; border: 1px solid rgba(239,68,68,0.3);   color: #f87171; }
.toast-info    { background: #0d1020; border: 1px solid rgba(96,165,250,0.3);  color: #60a5fa; }
.toast-warning { background: #1a1500; border: 1px solid rgba(251,191,36,0.3);  color: #fbbf24; }
