/* =========================================================
   AUDIT-COMMON.CSS — Styles communs aux nouvelles pages
   Dashboard, lead form, score cards, mobile sidebar
   Dépend de : css/theme.css, css/auditms.css
   ========================================================= */

/* ── Sidebar mobile toggle ────────────────────────────────── */
.sb-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text3); padding: .3rem;
}
.sb-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

@media (max-width: 768px) {
  .sb-toggle { display: flex; }
  .sidebar {
    transform: translateX(-100%); transition: transform .2s;
    z-index: 50;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0 !important; }
  .sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 49;
  }
  .sidebar-backdrop.active { display: block; }
}

/* ── Reco critique (rouge) ────────────────────────────────── */
.reco.crit { border-left-color: var(--red); }
.reco.crit h4 { color: var(--red); }

/* ── DASHBOARD — Score cards ──────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
/* 3 colonnes fixes sur le dashboard principal */
#dash-scores {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 680px) {
  #dash-scores { grid-template-columns: 1fr; }
}

/* ── Dashboard — CTA principal ────────────────────────────── */
#dash-main-cta {
  justify-content: center; margin: 1.5rem 0 1.25rem;
}
.dash-cta-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--accent); color: #fff; border: none;
  padding: .9rem 2.5rem; border-radius: 10px;
  font-size: .95rem; font-weight: 500; cursor: pointer;
  font-family: var(--sans); letter-spacing: .01em;
  box-shadow: 0 4px 20px rgba(59,130,246,.35);
  transition: opacity .15s, transform .15s;
}
.dash-cta-btn:hover { opacity: .9; transform: translateY(-1px); }
.dash-cta-btn.crit  {
  background: var(--red);
  box-shadow: 0 4px 20px rgba(239,68,68,.35);
  animation: pulse-cta 2s ease-in-out infinite;
}

/* ── Dashboard — Blur alertes ─────────────────────────────── */
.alert-blur-wrap {
  position: relative; margin-top: .5rem;
}
.alert-blurred {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}
.alert-blur-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(rgba(10,12,16,0) 0%, rgba(10,12,16,.88) 45%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  gap: .75rem; padding: 1.5rem 1rem 1rem;
}
.alert-overlay-txt { font-size: .82rem; color: var(--text3); }
.alert-overlay-sub { font-size: .72rem; color: var(--text2); text-align: center; line-height: 1.5; max-width: 280px; }
.score-card {
  background: var(--bg2); border: 1px solid var(--bd); border-radius: 11px;
  padding: 1.5rem 1.25rem; display: flex; flex-direction: column;
  align-items: center; gap: .75rem;
  cursor: pointer; transition: border-color .15s, background .15s; text-decoration: none;
  color: inherit; position: relative; overflow: hidden;
}
.score-card:hover { border-color: var(--bd2); background: var(--bg3); }
.score-card.loading .sc-score-wrap::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity:.3 } 50% { opacity:.8 } }

.sc-icon {
  width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--bd2);
  display: flex; align-items: center; justify-content: center; margin-bottom: .25rem;
}
.sc-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.sc-title { font-size: .75rem; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: .07em; }

.sc-score-wrap { position: relative; width: 80px; height: 80px; }
.sc-score-wrap svg { transform: rotate(-90deg); }
.sc-score-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.sc-score-num   { font-family: var(--mono); font-size: 1.4rem; font-weight: 500; line-height: 1; }
.sc-score-denom { font-size: .6rem; color: var(--text2); font-family: var(--mono); }

.sc-label {
  font-size: .7rem; font-weight: 500;
  padding: .2rem .65rem; border-radius: 99px;
}
.sc-loading { font-family: var(--mono); font-size: .7rem; color: var(--text2); }

/* ── Alertes dashboard ────────────────────────────────────── */
.dash-alerts { margin-bottom: 1.25rem; }
.alerts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .85rem;
  align-items: start;
}
@media (max-width: 700px) {
  .alerts-grid { grid-template-columns: 1fr; }
}
.alerts-col { display: flex; flex-direction: column; gap: .4rem; }
.alerts-col-head {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .1em;
  font-weight: 600; padding: .35rem .65rem; border-radius: 6px;
  margin-bottom: .25rem; display: flex; align-items: center; justify-content: space-between;
}
.alerts-col-head-red    { color: var(--red);    background: rgba(239,68,68,.08);    border: 1px solid rgba(239,68,68,.2); }
.alerts-col-head-orange { color: var(--orange); background: rgba(245,158,11,.08);   border: 1px solid rgba(245,158,11,.2); }
.alerts-col-head-green  { color: var(--green);  background: rgba(34,197,94,.08);    border: 1px solid rgba(34,197,94,.2); }
.alerts-col-count {
  font-size: .7rem; font-family: var(--mono); opacity: .8;
}
.dash-alert {
  display: flex; align-items: flex-start; gap: .55rem;
  background: var(--bg2); border: 1px solid var(--bd);
  border-left-width: 2px; border-radius: 7px; padding: .55rem .8rem;
  font-size: .76rem; line-height: 1.45;
}
.dash-alert.red    { border-left-color: var(--red);    color: var(--text3); }
.dash-alert.orange { border-left-color: var(--orange); color: var(--text3); }
.dash-alert.green  { border-left-color: var(--green);  color: var(--text3); }
.dash-alert .da-icon { font-size: .8rem; flex-shrink: 0; margin-top: .1rem; }
.alerts-col-empty {
  background: var(--bg2); border: 1px solid var(--bd); border-radius: 7px;
  padding: .55rem .8rem; font-size: .75rem; color: var(--text2); font-style: italic;
}
/* Colonne verrouillée */
.alerts-col-locked { position: relative; min-height: 80px; }
.alerts-col-blur-content { filter: blur(4px); pointer-events: none; user-select: none; display: flex; flex-direction: column; gap: .4rem; }
.alerts-col-blur-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  background: rgba(13,17,23,.7); border-radius: 7px;
  font-size: .78rem; color: var(--text2); text-align: center; padding: .5rem;
}
.alerts-col-blur-overlay strong { color: var(--text); display: block; }
.dash-no-alerts {
  background: rgba(34,197,94,.07); border: 1px solid rgba(34,197,94,.2);
  border-radius: 7px; padding: .7rem 1rem; font-size: .78rem; color: var(--green);
}

/* ── Formulaire lead ──────────────────────────────────────── */
.lead-panel {
  background: var(--bg2); border: 1px solid var(--bd2); border-radius: 12px;
  padding: 1.75rem; margin-bottom: 1.5rem;
  animation: slideIn .3s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateY(12px) } to { opacity:1; transform:none } }
.lead-head { margin-bottom: 1.25rem; }
.lead-head h3 { font-size: 1rem; font-weight: 500; margin-bottom: .35rem; }
.lead-head p  { font-size: .78rem; color: var(--text2); line-height: 1.6; }
.lead-form { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 560px) { .lead-form { grid-template-columns: 1fr; } }
.lead-form input {
  background: var(--bg3); border: 1px solid var(--bd); border-radius: 7px;
  padding: .55rem .85rem; font-size: .82rem; color: var(--text); font-family: var(--sans);
  outline: none; transition: border-color .12s; width: 100%;
}
.lead-form input:focus { border-color: var(--accent); }
.lead-form input::placeholder { color: var(--text2); }
.lead-form .full { grid-column: 1 / -1; }
.lead-submit {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  margin-top: .25rem;
}
.lead-submit p { font-size: .68rem; color: var(--text2); }

.lead-success {
  display: none; text-align: center; padding: 1rem 0;
  color: var(--green); font-size: .85rem;
}
.lead-success .ls-icon { font-size: 2rem; margin-bottom: .5rem; }

/* ── Recommandations complètes (après lead) ───────────────── */
.full-recos { display: none; margin-top: 1.5rem; }
.full-recos.visible { display: block; animation: slideIn .3s ease; }

/* ── Écran login dashboard ────────────────────────────────── */
.dash-login {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 70vh; gap: 1.5rem; text-align: center;
}
.dash-login-logo { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; color: var(--text2); }
.dash-login-box {
  background: var(--bg2); border: 1px solid var(--bd2); border-radius: 12px;
  padding: 2.5rem 2rem; max-width: 400px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
}
.dash-login-box h2 { font-size: 1.2rem; font-weight: 500; }
.dash-login-box p  { font-size: .8rem; color: var(--text2); line-height: 1.6; text-align: center; }

/* ── Bouton primaire login (alias) ────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--accent); color: #fff; border: none;
  padding: .65rem 1.5rem; border-radius: 8px;
  font-size: .85rem; font-weight: 500; cursor: pointer;
  font-family: var(--sans); transition: opacity .15s; width: 100%;
}
.btn-primary:hover { opacity: .85; }

/* ── Section heading avec lien ────────────────────────────── */
.sh-link {
  font-size: .7rem; color: var(--acc2); cursor: pointer;
  text-decoration: none; transition: color .12s;
}
.sh-link:hover { color: var(--text); }

/* ── Partial scan notice ──────────────────────────────────── */
.partial-notice {
  display: none;
  background: rgba(59,130,246,.06); border: 1px solid rgba(59,130,246,.2);
  border-radius: 7px; padding: .65rem 1rem; font-size: .75rem; color: var(--acc2);
  margin-bottom: .75rem; line-height: 1.6;
}

/* ── Icônes sécurité GPO ──────────────────────────────────── */
.gpo-sec-icon { font-size: .9rem; }
.gpo-legend {
  display: flex; flex-wrap: wrap; gap: .65rem;
  font-size: .68rem; color: var(--text2); padding: .65rem 1.1rem;
  border-top: 1px solid var(--bd);
}
.gpo-legend span { display: flex; align-items: center; gap: .25rem; }

/* ── Alarm banner ─────────────────────────────────────────── */
.alarm-banner {
  border-radius: 8px; padding: .85rem 1.1rem; margin-bottom: 1.1rem;
  border: 1px solid; border-left-width: 3px;
}
.alarm-orange { background: rgba(245,158,11,.06); border-color: rgba(245,158,11,.2); border-left-color: var(--orange); }
.alarm-red    { background: rgba(239,68,68,.06);  border-color: rgba(239,68,68,.2);  border-left-color: var(--red); }
.alarm-text   { font-size: .82rem; color: var(--text); margin-bottom: .5rem; line-height: 1.6; }
.alarm-list   { list-style: none; display: flex; flex-direction: column; gap: .3rem; margin: 0; padding: 0; }
.alarm-item   { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--text3); }
.alarm-dot    { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.alarm-dot-red    { background: var(--red); }
.alarm-dot-orange { background: var(--orange); }

/* ── Score critique (bannière rouge) ──────────────────────── */
.low-score-banner {
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3);
  border-radius: 7px; padding: .7rem 1.1rem; font-size: .8rem;
  color: var(--red); margin-bottom: 1.1rem; line-height: 1.5;
}
#lead-low-score-banner { display: none; }

/* ── CTA flottant ─────────────────────────────────────────── */
#lead-cta { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 20; }
.lead-cta-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent); color: #fff; border: none;
  padding: .7rem 1.4rem; border-radius: 9px;
  font-size: .85rem; font-weight: 500; cursor: pointer;
  font-family: var(--sans); box-shadow: 0 4px 16px rgba(59,130,246,.35);
  transition: opacity .15s, transform .15s;
}
.lead-cta-btn:hover   { opacity: .9; transform: translateY(-1px); }
.lead-cta-urgent      { background: var(--red); box-shadow: 0 4px 16px rgba(239,68,68,.35); animation: pulse-cta 2s ease-in-out infinite; }
@keyframes pulse-cta  { 0%,100% { box-shadow: 0 4px 16px rgba(239,68,68,.35); } 50% { box-shadow: 0 4px 24px rgba(239,68,68,.6); } }
.lead-cta-icon        { font-size: 1rem; }

/* ── Inputs lead modal ────────────────────────────────────── */
.lead-form-input {
  background: var(--bg3); border: 1px solid var(--bd); border-radius: 7px;
  padding: .55rem .85rem; font-size: .82rem; color: var(--text); font-family: var(--sans);
  outline: none; transition: border-color .12s; width: 100%;
}
.lead-form-input:focus       { border-color: var(--accent); }
.lead-form-input::placeholder { color: var(--text2); }

/* ── Barre de progression import GPO ─────────────────────── */
.import-bar {
  background: var(--bg2); border: 1px solid var(--bd); border-radius: 9px;
  padding: 1.25rem; text-align: center; margin-bottom: 1rem;
}
.import-bar .ib-icon { font-size: 2rem; margin-bottom: .5rem; }
.import-bar h3 { font-size: .9rem; font-weight: 500; margin-bottom: .3rem; }
.import-bar p  { font-size: .75rem; color: var(--text2); line-height: 1.6; }
.import-bar .ib-cmd {
  background: var(--bg4); border: 1px solid var(--bd); border-radius: 6px;
  padding: .5rem .85rem; font-family: var(--mono); font-size: .72rem;
  color: var(--acc2); display: inline-block; margin-top: .65rem; text-align: left;
  white-space: pre-wrap; word-break: break-all;
}
.import-actions { display: flex; gap: .75rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
