/* paroledonnée — base styles */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 6px;
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 1.5rem; }

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.navbar-brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.navbar-links { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.navbar-links a { color: var(--text-muted); font-size: 0.9rem; }
.navbar-links a:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}
.btn:hover { background: var(--bg-alt); text-decoration: none; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-small { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: inherit; }
.btn-link:hover { text-decoration: underline; }
.btn-google { background: #4285f4; color: white; border-color: #4285f4; }

/* Flash */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Forms */
.form-standard { max-width: 500px; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.25rem; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}
.inline-form input { padding: 0.25rem 0.5rem; font-size: 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); }
.inline-form label { font-weight: 500; min-width: 120px; font-size: 0.9rem; }

/* Auth */
.auth-form { max-width: 400px; margin: 2rem auto; }
.auth-form h1 { margin-bottom: 1.5rem; }
.auth-link { margin-top: 1rem; font-size: 0.9rem; }
.oauth-separator { text-align: center; margin: 1rem 0; color: var(--text-muted); }

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.hero p { color: var(--text-muted); margin-bottom: 1.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }

/* Sections */
.section { margin: 2rem 0; }
.section h2 { margin-bottom: 1rem; }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

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

/* Engagement cards */
.engagement-list { display: flex; flex-direction: column; gap: 1rem; }
.engagement-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.engagement-card h3 { margin-bottom: 0.25rem; }
.engagement-card .description { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* Status badges */
.status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 500;
}
.status-draft { background: #f1f5f9; color: #475569; }
.status-proposed { background: #dbeafe; color: #1e40af; }
.status-negotiating { background: #fef3c7; color: #92400e; }
.status-active { background: #dcfce7; color: #166534; }
.status-completing { background: #e0f2fe; color: #075985; }
.status-completed { background: #bbf7d0; color: #14532d; }
.status-disputed { background: #fee2e2; color: #991b1b; }
.status-resolved { background: #e0e7ff; color: #3730a3; }
.status-cancelled { background: #f1f5f9; color: #64748b; }
.status-expired { background: #fef2f2; color: #991b1b; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-validated { background: #dcfce7; color: #166534; }
.status-contested { background: #fee2e2; color: #991b1b; }
.status-fulfilled { background: #e0f2fe; color: #075985; }
.status-verified { background: #bbf7d0; color: #14532d; }
.status-accepted { background: #dcfce7; color: #166534; }
.status-declined { background: #fee2e2; color: #991b1b; }
.status-open { background: #fef3c7; color: #92400e; }

.meta { color: var(--text-muted); font-size: 0.85rem; }

/* Engagement detail */
.engagement-detail { }
.engagement-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.engagement-actions { margin-top: 2rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Point cards */
.point-card {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
.point-header { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.point-type { font-size: 0.8rem; color: var(--text-muted); }
.point-actions { margin-top: 0.5rem; display: flex; gap: 0.5rem; }

/* Party & witness cards */
.party-card, .witness-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.role { color: var(--text-muted); font-size: 0.85rem; }

/* Contestation cards */
.contestation-card {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  background: #fef2f2;
}

/* Profile */
.profile-header { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 1.5rem; }
.avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.handle { color: var(--text-muted); }
.reputation { font-size: 1.1rem; }

/* Dashboard */
.dashboard-stats { display: flex; gap: 1rem; margin-bottom: 2rem; }
.stat {
  padding: 1rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }

/* Badge list */
.badge-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.badge-card {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.badge { background: var(--danger); color: white; border-radius: 50%; padding: 0 0.4em; font-size: 0.75rem; margin-left: 0.25rem; }

/* Notification cards */
.notification-list { display: flex; flex-direction: column; gap: 0.5rem; }
.notification-card {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.notification-card.unread { background: #eff6ff; border-color: #93c5fd; }

/* Template cards */
.template-list { display: flex; flex-direction: column; gap: 1rem; }
.template-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; background: var(--bg-alt); }

/* Algorithm page */
.formula {
  background: var(--bg-alt);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.formula code { display: block; font-size: 1rem; margin-bottom: 0.75rem; }
.positive { color: var(--success); font-weight: 600; }
.negative { color: var(--danger); font-weight: 600; }

/* Admin nav */
.admin-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.admin-nav a { color: var(--text-muted); }
.admin-nav a.active { color: var(--primary); font-weight: 600; }

/* Legal notice on templates */
.legal-notice {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0.5rem 0;
}

/* Legal pages */
.legal-page { max-width: 720px; }
.legal-page h1 { margin-bottom: 0.5rem; }
.legal-page h2 { margin-top: 1.5rem; margin-bottom: 0.5rem; font-size: 1.1rem; }
.legal-page p { margin-bottom: 0.75rem; }
.legal-page ul { margin-left: 1.5rem; margin-bottom: 0.75rem; }
.legal-page li { margin-bottom: 0.25rem; }

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}
.footer-links a { color: var(--text-muted); font-size: 0.8rem; }
.footer-links a:hover { color: var(--text); }

/* Error page */
.error-page { text-align: center; padding: 3rem 0; }
.error-page h1 { margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 640px) {
  .form-row { flex-direction: column; }
  .navbar { flex-direction: column; gap: 0.75rem; }
  .hero h1 { font-size: 1.8rem; }
}
