*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[x-cloak] { display: none !important; }

:root {
  --bg: #0f172a; --bg2: #1e293b; --bg3: #334155;
  --border: #1e293b; --border2: #334155;
  --text: #f1f5f9; --text2: #94a3b8; --text3: #64748b;
  --safe: #22c55e; --warn: #f97316; --danger: #ef4444;
  --primary: #6366f1; --primary-h: #818cf8;
  --radius: 12px; --radius-sm: 8px;
}

body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 14px; }

/* ── Header ─────────────────────────────────────────────── */
.header { background: var(--bg2); border-bottom: 1px solid var(--border2); padding: 0 24px; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1280px; margin: 0 auto; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 28px; }
.logo-title { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.4px; }
.logo-sub { display: block; font-size: 11px; color: var(--text3); }
.header-stats { display: flex; gap: 8px; }
.stat-chip { display: flex; flex-direction: column; align-items: center; background: var(--bg3); border-radius: var(--radius-sm); padding: 4px 12px; }
.stat-chip.danger .stat-value { color: var(--danger); }
.stat-chip.safe .stat-value { color: var(--safe); }
.stat-value { font-size: 16px; font-weight: 700; }
.stat-label { font-size: 10px; color: var(--text3); }

/* ── Alert banner ────────────────────────────────────────── */
.alert-banner {
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--radius-sm); padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  color: #fca5a5; font-size: 13px; font-weight: 600;
  margin: 16px auto 0; max-width: 1280px;
}

/* ── Main ────────────────────────────────────────────────── */
.main { max-width: 1280px; margin: 0 auto; padding: 20px 24px; }

/* ── Navigation catégories ───────────────────────────────── */
.nav-categories { margin-bottom: 16px; }
.nav-cat-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; margin-top: 10px; font-weight: 600; }
.tabs { display: flex; gap: 4px; background: var(--bg2); border-radius: var(--radius); padding: 4px; flex-wrap: wrap; }
.tab { flex: 1; min-width: 100px; padding: 9px 12px; border: none; background: transparent; color: var(--text2); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .15s; white-space: nowrap; }
.tab:hover { background: var(--bg3); color: var(--text); }
.tab.active { background: var(--primary); color: #fff; }
.tab-icon { font-size: 15px; }

/* ── Grid ────────────────────────────────────────────────── */
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .content-grid { grid-template-columns: 1fr; } }

/* ── Panel ───────────────────────────────────────────────── */
.panel { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius); padding: 24px; }
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.panel-desc { color: var(--text2); font-size: 13px; margin-bottom: 16px; line-height: 1.5; }

/* ── Drop zone ───────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border2); border-radius: var(--radius-sm);
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: all .2s; margin-bottom: 14px;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--primary); background: rgba(99,102,241,.05); }
.drop-zone.has-file { border-style: solid; border-color: var(--primary); background: rgba(99,102,241,.08); }
.hidden { display: none !important; }
.drop-content { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.drop-icon { font-size: 32px; }
.drop-content p { color: var(--text2); font-size: 13px; }
.drop-content strong { color: var(--text); }
.drop-hint { font-size: 11px !important; color: var(--text3) !important; }
.file-preview { display: flex; align-items: center; gap: 12px; padding: 4px; }
.file-icon { font-size: 24px; }
.file-name { display: block; font-size: 13px; font-weight: 500; }
.file-size { font-size: 11px; color: var(--text3); }
.btn-remove { background: none; border: none; color: var(--text3); cursor: pointer; padding: 4px; margin-left: auto; font-size: 16px; }
.btn-remove:hover { color: var(--danger); }

/* ── Danger callout ──────────────────────────────────────── */
.danger-callout {
  display: flex; gap: 10px; background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 12.5px; color: #fca5a5;
  line-height: 1.5; margin-bottom: 14px;
}

/* ── RIB alert ───────────────────────────────────────────── */
.rib-alert {
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.4);
  border-radius: var(--radius-sm); padding: 12px 16px;
  color: #fca5a5; font-size: 13px; line-height: 1.5; margin-bottom: 16px;
}

/* ── Form fields ─────────────────────────────────────────── */
.field-label { display: block; font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 5px; font-weight: 600; }
.input-field {
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px;
  padding: 10px 12px; outline: none; transition: border .15s; font-family: inherit;
}
.input-field:focus { border-color: var(--primary); }
.full-width { width: 100%; margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-col { display: flex; flex-direction: column; }
.field-col .input-field { width: 100%; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text2); }
.checkbox-row input[type=checkbox] { flex-shrink: 0; margin-top: 2px; accent-color: var(--primary); width: 15px; height: 15px; }
.checkbox-row strong { color: var(--text); }

.textarea { width: 100%; background: var(--bg); border: 1px solid var(--border2); border-radius: var(--radius-sm); color: var(--text); font-family: 'Inter', monospace; font-size: 12.5px; padding: 12px; resize: vertical; outline: none; transition: border .15s; }
.textarea:focus { border-color: var(--primary); }

.url-input-wrap { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 0 14px; transition: border .15s; margin-bottom: 14px; }
.url-input-wrap:focus-within { border-color: var(--primary); }
.url-prefix { font-size: 16px; }
.input-field.url-field { border: none; background: transparent; padding: 12px 0; width: 100%; }
.url-input-wrap .input-field:focus { border-color: transparent; }

/* ── Scam types grid ─────────────────────────────────────── */
.scam-types-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.scam-type-chip { background: var(--bg3); border-radius: 20px; padding: 4px 10px; font-size: 11px; color: var(--text2); }

/* ── Examples ────────────────────────────────────────────── */
.url-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; align-items: center; }
.examples-label { font-size: 12px; color: var(--text3); }
.example-chip { background: var(--bg3); border: none; color: var(--text2); border-radius: 20px; padding: 3px 10px; font-size: 11px; cursor: pointer; transition: all .15s; font-family: inherit; }
.example-chip:hover { background: var(--primary); color: #fff; }

/* ── Social grid ─────────────────────────────────────────── */
.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.social-field label { display: block; font-size: 11px; color: var(--text3); margin-bottom: 3px; }
.social-field .input-field { width: 100%; }

/* ── Buttons ─────────────────────────────────────────────── */
.input-actions { display: flex; gap: 10px; margin-top: 16px; }
.btn { padding: 10px 20px; border-radius: var(--radius-sm); border: none; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; flex: 1; justify-content: center; }
.btn-primary:not(:disabled):hover { background: var(--primary-h); }
.btn-ghost { background: var(--bg3); color: var(--text2); }
.btn-ghost:hover { color: var(--text); }
.btn-outline { background: transparent; border: 1px solid var(--border2); color: var(--text2); }
.btn-outline:hover { border-color: var(--primary); color: var(--text); }
.loading-text { display: flex; align-items: center; gap: 8px; justify-content: center; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading state ───────────────────────────────────────── */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 20px; gap: 16px; }
.loading-animation { position: relative; width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; }
.pulse-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--primary); animation: pulse 1.5s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.8); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.loading-icon { font-size: 32px; }
.loading-msg { font-size: 15px; font-weight: 600; }
.loading-sub { font-size: 12px; color: var(--text3); }

/* ── Score gauge ─────────────────────────────────────────── */
.score-section { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 20px; }
.score-gauge { width: 160px; }
.gauge-svg { width: 100%; }
.gauge-score { font-size: 22px; font-weight: 800; font-family: 'Inter', sans-serif; }
.gauge-label { font-size: 10px; fill: #64748b; font-family: 'Inter', sans-serif; }
.verdict-badge { display: flex; align-items: center; gap: 8px; padding: 8px 20px; border-radius: 30px; font-size: 14px; font-weight: 700; letter-spacing: .5px; }
.verdict-badge.danger { background: rgba(239,68,68,.15); color: var(--danger); border: 1px solid rgba(239,68,68,.3); }
.verdict-badge.warn   { background: rgba(249,115,22,.15); color: var(--warn);   border: 1px solid rgba(249,115,22,.3); }
.verdict-badge.safe   { background: rgba(34,197,94,.15);  color: var(--safe);   border: 1px solid rgba(34,197,94,.3); }

/* ── Summary ─────────────────────────────────────────────── */
.summary-box { border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 18px; border-left: 4px solid; font-size: 13.5px; line-height: 1.6; }
.summary-box.danger { background: rgba(239,68,68,.07); border-color: var(--danger); }
.summary-box.warn   { background: rgba(249,115,22,.07); border-color: var(--warn); }
.summary-box.safe   { background: rgba(34,197,94,.07);  border-color: var(--safe); }

/* ── Company card ────────────────────────────────────────── */
.company-card { background: var(--bg3); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 18px; }
.company-name { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.company-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; }
.company-detail { font-size: 12px; color: var(--text2); margin-top: 4px; line-height: 1.5; }
.status-ok { background: rgba(34,197,94,.15); color: var(--safe); padding: 2px 8px; border-radius: 10px; font-weight: 700; font-size: 11px; }
.status-ko { background: rgba(239,68,68,.15); color: var(--danger); padding: 2px 8px; border-radius: 10px; font-weight: 700; font-size: 11px; }

/* ── Signals / Advice ────────────────────────────────────── */
.detail-section, .advice-section { margin-bottom: 18px; }
.detail-title { font-size: 11px; font-weight: 700; color: var(--text3); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .6px; }
.signal-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.signal-item { padding: 8px 12px; background: var(--bg3); border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.5; }
.scam-badge { display: inline-flex; gap: 8px; align-items: center; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); border-radius: 20px; padding: 5px 14px; margin-bottom: 16px; font-size: 12.5px; color: var(--danger); }
.advice-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.advice-item { padding: 9px 14px; background: rgba(99,102,241,.06); border: 1px solid rgba(99,102,241,.15); border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; }
.advice-item::before { content: "→ "; color: var(--primary); font-weight: 700; }
.result-actions { display: flex; gap: 10px; padding-top: 8px; }

/* ── Placeholder ─────────────────────────────────────────── */
.placeholder-panel { display: flex; align-items: center; justify-content: center; min-height: 360px; }
.placeholder-content { text-align: center; max-width: 320px; }
.placeholder-icon { font-size: 52px; margin-bottom: 16px; opacity: .5; }
.placeholder-content h3 { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.placeholder-content p { color: var(--text2); font-size: 13px; line-height: 1.6; margin-bottom: 20px; }
.threat-list { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.threat-item { background: var(--bg3); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px; color: var(--text2); }

/* ── History ─────────────────────────────────────────────── */
.history-section { margin-top: 28px; }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.history-list { display: flex; flex-direction: column; gap: 5px; }
.history-item { display: flex; align-items: center; gap: 12px; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 10px 14px; transition: border .15s; }
.history-item:hover { border-color: var(--primary); }
.history-type-icon { font-size: 18px; flex-shrink: 0; }
.history-info { flex: 1; min-width: 0; }
.history-input { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-date { font-size: 11px; color: var(--text3); }
.history-score { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.score-dangereux { background: rgba(239,68,68,.15); color: var(--danger); }
.score-suspect   { background: rgba(249,115,22,.15); color: var(--warn); }
.score-sur       { background: rgba(34,197,94,.15);  color: var(--safe); }
.history-verdict { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; flex-shrink: 0; }
.verdict-dangereux { background: rgba(239,68,68,.15); color: var(--danger); }
.verdict-suspect   { background: rgba(249,115,22,.15); color: var(--warn); }
.verdict-sûr, .verdict-sur { background: rgba(34,197,94,.15); color: var(--safe); }

/* ── Toasts ──────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 9000; pointer-events: none; }
.toast {
  padding: 14px 16px 17px; border-radius: var(--radius-sm); font-size: 13px;
  max-width: 340px; box-shadow: 0 8px 32px rgba(0,0,0,.5);
  display: flex; align-items: flex-start; gap: 10px;
  pointer-events: all; cursor: pointer; position: relative; overflow: hidden;
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1);
}
.toast-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: 12.5px; margin-bottom: 2px; }
.toast-msg { font-size: 12px; opacity: .88; line-height: 1.45; }
.toast-progress { position: absolute; bottom: 0; left: 0; height: 3px; background: rgba(255,255,255,.35); animation: toastProgress linear forwards; }
.toast-success { background: #14532d; border: 1px solid #22c55e; color: #dcfce7; }
.toast-error   { background: #7f1d1d; border: 1px solid #ef4444; color: #fecaca; }
.toast-warning { background: #7c2d12; border: 1px solid #f97316; color: #fed7aa; }
.toast-info    { background: var(--bg3); border: 1px solid var(--border2); color: var(--text); }
.toast-danger  { background: #3b0000; border: 1px solid #ef4444; color: #fca5a5; animation: toastIn .3s cubic-bezier(.34,1.56,.64,1), dangerShake .45s .3s ease; }
@keyframes toastIn { from { opacity:0; transform:translateX(50px) scale(.93); } to { opacity:1; transform:translateX(0) scale(1); } }
@keyframes toastProgress { from { width:100%; } to { width:0%; } }
@keyframes dangerShake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-5px)} 40%,80%{transform:translateX(5px)} }

/* ── SOS Overlay ─────────────────────────────────────────── */
.sos-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(8,0,0,.93); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: sosIn .25s ease;
}
@keyframes sosIn { from { opacity:0; } to { opacity:1; } }
.sos-modal {
  background: #1c0000; border: 2px solid var(--danger);
  border-radius: 20px; padding: 48px 40px; max-width: 520px; width: 90%;
  text-align: center; position: relative;
  box-shadow: 0 0 100px rgba(239,68,68,.35);
  animation: sosPulse 2s ease infinite;
}
@keyframes sosPulse { 0%,100%{box-shadow:0 0 80px rgba(239,68,68,.3)} 50%{box-shadow:0 0 140px rgba(239,68,68,.6)} }
.sos-icon { font-size: 64px; display: block; margin-bottom: 16px; animation: sosBounce .9s ease infinite alternate; }
@keyframes sosBounce { from{transform:scale(1)} to{transform:scale(1.1)} }
.sos-title { font-size: 1.9rem; font-weight: 900; color: var(--danger); margin-bottom: 6px; letter-spacing: -.5px; }
.sos-score { font-size: 3.8rem; font-weight: 900; color: var(--danger); line-height: 1; margin-bottom: 6px; }
.sos-type { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #f87171; margin-bottom: 20px; opacity: .8; }
.sos-summary { font-size: .95rem; color: #fca5a5; line-height: 1.65; margin-bottom: 28px; padding: 14px 18px; background: rgba(239,68,68,.08); border-radius: 10px; border: 1px solid rgba(239,68,68,.2); }
.sos-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.sos-btn-close { padding: 12px 26px; border-radius: 50px; background: transparent; border: 1px solid rgba(239,68,68,.4); color: #f87171; font-size: .88rem; font-weight: 600; cursor: pointer; transition: all .2s; font-family: inherit; }
.sos-btn-close:hover { background: rgba(239,68,68,.1); }
.sos-btn-guardian { padding: 12px 26px; border-radius: 50px; background: var(--danger); color: #fff; font-size: .88rem; font-weight: 700; cursor: pointer; border: none; transition: opacity .2s; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.sos-btn-guardian:hover { opacity: .85; }
