/* Portail IWS - Infowork Security
   Charte reprise de infowork.fr : bleu canard #266A8F, accents jaune #FECE3B,
   vert #99B223. Mode clair + sombre.
   Principes de design : une échelle de taille franche (gros chiffres, textes
   lisibles), couleurs à plat (pas de dégradés), pas de petites étiquettes en
   capitales espacées, surfaces séparées par un pas de ton plutôt que par des
   filets, coins carrés cohérents.
*/

:root {
  --brand: #1f6286;          /* bleu Infowork, un cran plus profond pour le contraste */
  --brand-ink: #15455f;
  --brand-tint: #e8f0f4;     /* fond bleu très clair */
  --accent: #8aa61f;         /* vert action, assombri pour lisibilité du texte dessus */
  --accent-ink: #1f2a04;
  --yellow: #f0b429;

  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-2: #eceee9;
  --border: #dde0da;
  --ink: #1a2024;            /* texte principal, plein */
  --ink-soft: #566069;       /* texte secondaire */
  --on-brand: #ffffff;

  --crit: #b3261e;
  --high: #c7571c;
  --med:  #b98700;
  --low:  #2f73a8;
  --info: #6b7780;

  --r: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="dark"] {
  --brand: #4a9cc4;
  --brand-ink: #86c3de;
  --brand-tint: #16242c;
  --bg: #10171c;
  --surface: #182530;
  --surface-2: #1f2e3a;
  --border: #2b3c48;
  --ink: #e8eef2;
  --ink-soft: #9fb1bc;
  --on-brand: #ffffff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1 { font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 6px; font-weight: 650; }
h2 { font-size: 19px; letter-spacing: -0.01em; margin: 34px 0 14px; font-weight: 600; }

/* ---------- Logo (mark SVG + mot) ---------- */
.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo .logo-img { height: 34px; width: auto; display: block; }
.logo .logo-sub {
  font-size: 13px; font-weight: 600; color: var(--on-brand);
  padding-left: 12px; border-left: 1px solid rgba(255,255,255,0.35);
  letter-spacing: 0.01em;
}
.topbar .logo .logo-img { height: 30px; }

/* ---------- Barre supérieure ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--brand); color: var(--on-brand);
  padding: 0 22px; height: 62px;
}
.topbar .right { display: flex; align-items: center; gap: 14px; }
.user-chip { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.role-tag {
  font-size: 12px; background: rgba(255,255,255,0.18);
  padding: 3px 9px; border-radius: 20px; font-weight: 500;
}

/* ---------- Boutons ---------- */
.btn {
  border: none; border-radius: var(--r); cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 11px 18px; transition: filter .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: rgba(255,255,255,0.16); color: var(--on-brand); }
.btn-ghost:hover { background: rgba(255,255,255,0.26); }
.btn-sm { padding: 8px 13px; font-size: 14px; }
.icon-btn {
  background: rgba(255,255,255,0.16); color: var(--on-brand);
  border: none; border-radius: 9px; width: 38px; height: 38px;
  cursor: pointer; font-size: 17px; display: grid; place-items: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.28); }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: calc(100vh - 62px); }
.sidebar {
  width: 216px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 12px; flex-shrink: 0;
}
.sidebar a {
  display: block; padding: 11px 14px; border-radius: 9px; color: var(--ink);
  text-decoration: none; font-size: 15px; font-weight: 500; margin-bottom: 3px;
}
.sidebar a:hover { background: var(--surface-2); }
.sidebar a.active { background: var(--brand); color: #fff; }
.content { flex: 1; padding: 32px 36px; max-width: 1120px; }
.subtitle { color: var(--ink-soft); margin: 0 0 26px; font-size: 16px; }

/* ---------- Carte score (hero du tableau de bord) ---------- */
.score-hero {
  display: flex; align-items: center; gap: 26px;
  background: var(--brand); color: var(--on-brand);
  border-radius: 14px; padding: 26px 30px; margin-bottom: 20px;
}
.score-hero .big { font-size: 68px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.score-hero .big small { font-size: 24px; font-weight: 500; opacity: 0.7; }
.score-hero .label { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.score-hero .note { font-size: 14px; opacity: 0.82; max-width: 300px; }

/* ---------- Tuiles stats ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.stat-card {
  background: var(--surface); border-radius: var(--r); padding: 18px 18px 16px;
  border: 1px solid var(--border);
}
.stat-card .label { font-size: 15px; color: var(--ink-soft); font-weight: 500; }
.stat-card .value { font-size: 34px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }
.stat-card .value.warn { color: var(--high); }

/* petites barres de répartition par sévérité */
.sev-row { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.sev-line { display: grid; grid-template-columns: 90px 1fr 34px; align-items: center; gap: 12px; }
.sev-line .name { font-size: 15px; color: var(--ink-soft); }
.sev-line .track { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.sev-line .fill { display: block; height: 100%; min-width: 6px; border-radius: 6px; }
.sev-line .n { font-size: 15px; font-weight: 600; text-align: right; }

/* ---------- Tableaux ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 16px; font-size: 15px; }
th { color: var(--ink-soft); font-weight: 600; background: var(--surface-2); }
tbody tr { border-top: 1px solid var(--border); cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 13px; font-weight: 600; color: #fff; }
.sev-critical { background: var(--crit); }
.sev-high { background: var(--high); }
.sev-medium { background: var(--med); }
.sev-low { background: var(--low); }
.sev-info { background: var(--info); }

.status { display: inline-block; padding: 3px 11px; border-radius: 7px; font-size: 13px; font-weight: 600; }
.st-detected { background: #fae4e2; color: #8f1f17; }
.st-in_progress { background: #fbefd2; color: #7a5600; }
.st-corrected { background: #dcebf7; color: #16567f; }
.st-verified { background: #e2f0e2; color: #1d6b32; }
.st-accepted, .st-false_positive { background: var(--surface-2); color: var(--ink-soft); }
:root[data-theme="dark"] .st-detected { background: #3a1613; color: #f3a9a2; }
:root[data-theme="dark"] .st-in_progress { background: #38300f; color: #e6c766; }
:root[data-theme="dark"] .st-corrected { background: #112c42; color: #8dc0e8; }
:root[data-theme="dark"] .st-verified { background: #10301d; color: #85d4a3; }

/* ---------- Connexion : composition en deux volets, à plat ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-brand {
  background: var(--brand); color: var(--on-brand);
  padding: 56px 60px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-brand .logo .logo-img { height: 42px; }
.login-brand .pitch { max-width: 420px; }
.login-brand .pitch h2 { font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; color: #fff; margin: 0 0 16px; font-weight: 650; }
.login-brand .pitch p { font-size: 17px; opacity: 0.9; margin: 0; }
.pitch-links { display: flex; gap: 20px; margin-top: 24px; }
.pitch-links a { color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; border-bottom: 2px solid rgba(255,255,255,0.4); padding-bottom: 2px; }
.pitch-links a:hover { border-color: #fff; }
.login-brand .foot { font-size: 14px; opacity: 0.75; }
.login-form-side { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.login-card { width: 340px; }
.login-card h1 { font-size: 26px; margin-bottom: 4px; }
.login-card .lead { color: var(--ink-soft); margin: 0 0 26px; font-size: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--ink-soft); }
.field input {
  width: 100%; padding: 12px 13px; border: 1px solid var(--border);
  border-radius: 9px; font-size: 16px; background: var(--surface); color: var(--ink);
}
.field input:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.login-card .btn { width: 100%; margin-top: 6px; }
.error { color: var(--crit); font-size: 14px; margin-top: 12px; min-height: 18px; }

/* ---------- Détail finding ---------- */
.back { color: var(--ink-soft); text-decoration: none; font-size: 15px; display: inline-block; margin-bottom: 8px; }
.back:hover { color: var(--ink); }
.detail-head { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.detail-advice { background: var(--brand-tint); border-radius: var(--r); padding: 16px 18px; margin: 14px 0; }
.detail-advice strong { color: var(--brand-ink); }
.log-entry { padding: 12px 0 12px 16px; border-left: 2px solid var(--border); margin-left: 3px; }
.log-entry .meta { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.internal-tag { font-size: 12px; background: var(--surface-2); color: var(--ink-soft); padding: 2px 8px; border-radius: 10px; margin-left: 8px; }
select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--ink); font-family: inherit; font-size: 15px; }

.muted { color: var(--ink-soft); }
.hidden { display: none !important; }

/* ---------- Pages publiques (tarifs, démo) ---------- */
.pub-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--brand); color: #fff; padding: 0 clamp(18px, 5vw, 56px); height: 66px;
}
.pub-nav .links { display: flex; align-items: center; gap: 22px; }
.pub-nav .links a { color: #fff; text-decoration: none; font-weight: 500; font-size: 15px; opacity: 0.9; }
.pub-nav .links a:hover, .pub-nav .links a.active { opacity: 1; }
.pub-nav .links .btn { opacity: 1; }
.pub { max-width: 1060px; margin: 0 auto; padding: clamp(40px, 7vw, 86px) clamp(18px, 5vw, 32px) 90px; }
.pub .hero-h { font-size: clamp(32px, 5vw, 46px); line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 14px; font-weight: 650; max-width: 16ch; }
.pub .hero-p { font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-soft); max-width: 56ch; margin: 0 0 8px; }

/* Grille tarifs */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 36px; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px; display: flex; flex-direction: column; }
.plan.feature { background: var(--brand); color: #fff; border-color: var(--brand); }
.plan .pname { font-size: 19px; font-weight: 650; margin-bottom: 4px; }
.plan .ptag { font-size: 15px; color: var(--ink-soft); margin-bottom: 18px; }
.plan.feature .ptag { color: rgba(255,255,255,0.82); }
.plan .price { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.plan .price small { font-size: 16px; font-weight: 500; color: var(--ink-soft); }
.plan.feature .price small { color: rgba(255,255,255,0.8); }
.plan ul { list-style: none; padding: 0; margin: 20px 0 24px; display: flex; flex-direction: column; gap: 11px; }
.plan li { font-size: 15px; padding-left: 26px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.plan.feature li::before { color: var(--yellow); }
.plan .btn { margin-top: auto; text-align: center; text-decoration: none; display: block; }
.plan.feature .btn { background: #fff; color: var(--brand-ink); }
.badge-top { display: inline-block; background: var(--yellow); color: #3a2c00; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; margin-bottom: 12px; align-self: flex-start; }
.pub-note { color: var(--ink-soft); font-size: 15px; margin-top: 28px; max-width: 70ch; }
.oneshot { background: var(--brand-tint); border-radius: 14px; padding: 26px 28px; margin-top: 32px; }
.oneshot h3 { margin: 0 0 6px; font-size: 20px; }
.oneshot p { margin: 0; color: var(--ink-soft); font-size: 16px; }
.oneshot .from { font-size: 28px; font-weight: 700; color: var(--brand-ink); margin-top: 10px; }

/* Démo : bandeau */
.demo-banner { background: var(--brand-tint); border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.demo-banner .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.demo-banner span { font-size: 15px; color: var(--ink); }

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { padding: 36px 28px; }
  .sidebar { display: none; }
  .content { padding: 20px 18px; }
  h1 { font-size: 26px; }
}
