/* ==========================================================================
   AXIOM — DON'T MAKE ME THINK (Ultra-Clean, Intuitif & Moderne)
   ========================================================================== */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #94a3b8;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  --warning-badge: #d97706;
  
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #166534;
  
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

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

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  padding: 24px 16px 60px;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 960px;
  margin: 0 auto;
}

/* ─── Header ────────────────────────────────────────────────── */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--text-main);
}

.brand-badge {
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 6px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #10b981;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* ─── Hero (Steve Krug : simple & direct) ───────────────────── */
.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Exemples rapides ──────────────────────────────────────── */
.quick-examples {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.examples-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.pills-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill:hover {
  background: #f1f5f9;
  border-color: var(--border-focus);
}

.pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* ─── Zone Drop 2 PDFs ──────────────────────────────────────── */
.drop-section {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.drop-card {
  background: var(--surface);
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.drop-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-card.has-file {
  border-color: #10b981;
  background: #f0fdf4;
  border-style: solid;
}

.hidden-input {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.drop-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.drop-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.vs-circle {
  width: 36px;
  height: 36px;
  background: #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
}

.action-bar {
  text-align: center;
  margin-bottom: 24px;
}

.btn-compare {
  font-size: 15px;
  font-weight: 700;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: background 0.15s;
}

.btn-compare:hover {
  background: var(--primary-hover);
}

/* ─── État Vide (Initial) ──────────────────────────────────── */
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  margin-bottom: 32px;
}

.empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* ─── Carte Verdict (Point clé instantané) ─────────────────── */
.verdict-banner {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.08);
}

.verdict-icon {
  font-size: 32px;
  line-height: 1;
}

.verdict-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--warning-badge);
  margin-bottom: 4px;
}

.verdict-content h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.verdict-content p {
  font-size: 14px;
  color: var(--warning-text);
  line-height: 1.5;
}

/* ─── Tableau Comparatif ────────────────────────────────────── */
.comparison-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 40px;
}

.table-header {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  background: #f8fafc;
  border-bottom: 2px solid var(--border);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.claims-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: #f1f5f9;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.claim-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.claim-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.claim-quote {
  font-size: 13px;
  font-style: italic;
  color: var(--text-main);
  line-height: 1.45;
}

/* Lignes de fentes */
.comp-row {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
  transition: background 0.1s;
}

.comp-row:last-child {
  border-bottom: none;
}

.comp-row.is-divergent {
  background: #fffbeb;
  border-left: 4px solid var(--warning-badge);
}

.slot-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slot-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.slot-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}

.slot-badge.divergence {
  background: #fee2e2;
  color: #991b1b;
}

.slot-badge.concordant {
  background: #dcfce7;
  color: #166534;
}

.slot-badge.partiel {
  background: #fef3c7;
  color: #92400e;
}

.slot-badge.silence {
  background: #f1f5f9;
  color: #64748b;
}

.cell-content {
  padding-right: 12px;
}

.val-text {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 6px;
}

.val-text.absent {
  color: var(--text-muted);
  font-style: italic;
}

.btn-proof-mini {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-proof-mini:hover {
  text-decoration: underline;
}

/* ─── Toolbar Carte & Export ────────────────────────────────── */
.card-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.btn-export-audit {
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-export-audit:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* ─── Modal Visionneuse PDF In-App (S11) ────────────────────── */
.proof-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}

.proof-modal-card {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: popIn 0.15s ease-out;
}

@keyframes popIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-badge-cert {
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 20px;
}

/* Simulation de page PDF avec surlignage haute fidélité */
.pdf-page-preview {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02), 0 4px 6px -1px rgba(0,0,0,0.05);
  padding: 20px;
  position: relative;
  margin-bottom: 14px;
}

.page-corner {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 3px;
}

.page-highlight-box {
  margin-top: 10px;
}

.highlight-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.modal-quote {
  background: #fef9c3;
  border-left: 4px solid #eab308;
  padding: 14px 16px;
  font-size: 13.5px;
  font-family: var(--font-sans);
  color: #713f12;
  line-height: 1.6;
  border-radius: 0 4px 4px 0;
}

.modal-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-note {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-copy-quote {
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.1s;
}

.btn-copy-quote:hover {
  background: #f1f5f9;
}

/* ─── Bandeau de télémétrie (PRD §9.3 & §12.2) ──────────────── */
.telemetry-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.tel-label {
  color: var(--text-muted);
}

.tel-val {
  color: var(--text-main);
}

.tel-badge {
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ─── Footer ────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 24px 0 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .drop-section {
    grid-template-columns: 1fr;
  }
  .table-header, .comp-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .claims-row {
    grid-template-columns: 1fr;
  }
}
