/* ========================================================
   Style principal - SAE S3
   ======================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-active: #1e40af;
  --primary-light: #eff6ff;

  --bg-page: #f8fafc;
  --bg-surface: #ffffff;

  --border: #e2e8f0;
  --border-hover: #cbd5e1;

  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;

  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;

  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #15803d;

  --focus-ring: rgba(37, 99, 235, 0.2);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
}

/* Reset & bases */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typographie */
h1, h2, h3 {
  color: var(--text-main);
  line-height: 1.3;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

/* Barre de navigation */
.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
  color: var(--primary-hover);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-item {
  color: var(--text-body);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-item:hover {
  color: var(--text-main);
  background-color: #f1f5f9;
  text-decoration: none;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

.btn-nav,
.btn-register {
  background-color: var(--primary);
  color: #ffffff !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.btn-nav:hover,
.btn-register:hover {
  background-color: var(--primary-hover);
  text-decoration: none;
}

.user-badge,
.user-email {
  font-size: 0.85rem;
  color: var(--text-muted);
  background-color: #f1f5f9;
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-weight: 500;
}

.nav-logout {
  color: var(--danger-text);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-logout:hover {
  background-color: var(--danger-bg);
  color: var(--danger-text);
  text-decoration: none;
}

/* Fallback pour nav sans classes */
nav {
  padding: 0.85rem 1.25rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* Disposition principale */
.main-content,
main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 2.5rem auto;
  padding: 0 1.25rem;
}

/* Cartes */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
}

.welcome-card {
  max-width: 580px;
  margin: 1.5rem auto;
  text-align: center;
}

.welcome-card h1 {
  margin-bottom: 1.25rem;
}

.welcome-text {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

.card-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

/* Mentions légales */
.mentions-card {
  max-width: 820px;
  margin: 1.5rem auto;
  line-height: 1.7;
}

.mentions-card h1 {
  margin-bottom: 2rem;
}

.mentions-section {
  margin-bottom: 2rem;
}

.mentions-section:last-of-type {
  margin-bottom: 1.5rem;
}

.mentions-section h2 {
  font-si| Tâche | Outil | Prompt (résumé) | Solution proposée | Prise de décision |
ze: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.mentions-section p {
  color: var(--text-body);
  margin-bottom: 0.75rem;
}

.mentions-section ul {
  margin: 0.5rem 0 1rem 1.5rem;
  color: var(--text-body);
  list-style-type: disc;
}

.mentions-section li {
  margin-bottom: 0.4rem;
}

.mentions-section code {
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ========================================================
   Plan du site
   ======================================================== */
.sitemap-card {
  max-width: 640px;
  margin: 1.5rem auto;
}

.sitemap-intro {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: -0.25rem;
  margin-bottom: 1.75rem;
}

.sitemap-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--bg-surface);
  overflow: hidden;
}

.sitemap-list li {
  border-bottom: 1px solid var(--border);
}

.sitemap-list li:last-child {
  border-bottom: none;
}

.sitemap-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  color: var(--text-main);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sitemap-list a:hover {
  background-color: var(--bg-page);
  color: var(--primary);
  text-decoration: none;
}

.sitemap-title {
  font-weight: 500;
  font-size: 0.95rem;
}

.sitemap-url {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sitemap-list a:hover .sitemap-url {
  color: var(--primary);
}

/* ========================================================
   Page Membres
   ======================================================== */
.members-card {
  max-width: 640px;
  margin: 1.5rem auto;
}

.members-count {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: -0.25rem;
  margin-bottom: 1.75rem;
}

.members-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

.members-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  margin-bottom: 1rem;
}

.members-table th {
  padding: 0.75rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}

.members-table th:last-child,
.members-table td:last-child {
  text-align: right;
}

.members-table td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-body);
}

.members-table tbody tr:hover {
  background-color: var(--bg-page);
}

.members-table .member-login {
  font-weight: 500;
  color: var(--text-main);
}

.members-table .member-date {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-role-form {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  max-width: none;
}

.admin-role-form select {
  padding: 0.4rem 0.65rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: 6px;
}

.admin-role-form button[type="submit"] {
  width: auto;
  margin-top: 0;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0;
  background: transparent;
  border: none;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ========================================================
   Mon compte
   ======================================================== */
.account-card {
  max-width: 540px;
  margin: 1.5rem auto;
}

.account-info {
  background-color: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0 1.75rem;
}

.account-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}

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

.account-info-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.account-info-value {
  color: var(--text-main);
  font-weight: 600;
}

.account-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.account-section h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.account-card form {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  max-width: 100%;
  margin: 0;
}

.account-card form p {
  margin-bottom: 1rem;
}

.account-card form button {
  width: 100%;
}

.account-danger h2 {
  color: var(--danger-text);
}

.account-danger-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}


/* Formulaires */
form {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  max-width: 420px;
  margin: 1.5rem auto;
  box-shadow: var(--shadow-md);
}

form p {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  display: block;
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1px solid var(--border-hover);
  border-radius: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Boutons */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.7rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

button[type="submit"],
.btn-primary {
  width: 100%;
  background-color: var(--primary);
  color: #ffffff;
  border-color: transparent;
  margin-top: 0.5rem;
}

button[type="submit"]:hover,
.btn-primary:hover {
  background-color: var(--primary-hover);
  text-decoration: none;
}

button[type="submit"]:active,
.btn-primary:active {
  background-color: var(--primary-active);
  transform: translateY(1px);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-body);
  border-color: var(--border-hover);
}

.btn-secondary:hover {
  background-color: #f8fafc;
  color: var(--text-main);
  border-color: #94a3b8;
  text-decoration: none;
}

.btn-danger {
  background-color: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.btn-danger:hover {
  background-color: var(--danger-text);
  color: #ffffff !important;
  border-color: var(--danger-text);
  text-decoration: none;
}

.btn-danger:active {
  background-color: #991b1b;
  transform: translateY(1px);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
}

.btn-disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Liens secondaires et aide */
.auth-helper {
  text-align: center;
  max-width: 420px;
  margin: 1.25rem auto 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-helper a {
  font-weight: 500;
}

/* Messages d'alerte et retours */
.alert,
main > ul {
  max-width: 420px;
  margin: 1rem auto 1.5rem;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.5;
}

.alert-danger,
main > ul {
  list-style-position: inside;
  background-color: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.alert-success {
  background-color: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
  text-align: center;
}

/* Pied de page */
.site-footer {
  border-top: 1px solid var(--border);
  background-color: var(--bg-surface);
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
}
.reseaux{
  height: 32px;
  width: 32px;
}
.footer-container {
  max-width: 960px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 640px) {
  .nav-container {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .main-content,
  main {
    margin: 1.5rem auto;
    padding: 0 1rem;
  }

  form,
  .card {
    padding: 1.5rem 1.25rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .card-actions {
    flex-direction: column;
  }

  .card-actions .btn {
    width: 100%;
  }

  /* Plan du site mobile */
  .sitemap-card,
  .members-card,
  .account-card {
    padding: 1.5rem 1.25rem;
  }

  .sitemap-list a {
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .members-table th,
  .members-table td {
    padding: 0.75rem 0.35rem;
    font-size: 0.875rem;
  }
}

/* Mode sombre automatique basé sur les préférences système */
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-active: #1d4ed8;
    --primary-light: #1e293b;

    --bg-page: #0f172a;
    --bg-surface: #1e293b;

    --border: #334155;
    --border-hover: #475569;

    --text-main: #f8fafc;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;

    --focus-ring: rgba(59, 130, 246, 0.35);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);

    --danger-bg: #450a0a;
    --danger-border: #7f1d1d;
    --danger-text: #fca5a5;

    --success-bg: #052e16;
    --success-border: #14532d;
    --success-text: #86efac;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"] {
    background-color: #0f172a;
    border-color: #334155;
    color: #f8fafc;
  }

  .nav-item:hover {
    background-color: #334155;
    color: #f8fafc;
  }

  .user-badge,
  .user-email {
    background-color: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
  }

  .btn-secondary {
    background-color: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
  }

  .btn-secondary:hover {
    background-color: #334155;
    color: #f8fafc;
    border-color: #475569;
  }

  .btn-danger {
    background-color: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
  }

  .btn-danger:hover {
    background-color: var(--danger-text);
    color: #ffffff;
  }
}
