/* Variables */
:root {
  --blue:        #3746FF;
  --blue-hover:  #2535EE;
  --black:       #000000;
  --dark:        #1E1E1E;
  --near-white:  #FFFBFB;
  --gray-input:  #F1F1F1;
  --gray-ph:     #C7C7C7;
  --white:       #FFFFFF;
  --bg:          #F5F4F9;
  --border:      #EBEBEB;

  --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.08);
  --r-card:      50px;
  --r-pill:      30px;
  --r-input:     10px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--black);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

a { text-decoration: none; color: inherit; }

img { max-width: 100%; display: block; }

/* Header */

.site-header {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 999;
  align-items: center;
  justify-content: space-between;
  padding: 0 58px;
  height: 108px;
  background: transparent;
  flex-shrink: 0;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0 0 -48px 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

.header-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  white-space: nowrap;
}


/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.footer-logo-icon {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-name-first {
  font-size: 16px;
  font-weight: 400;
  color: var(--blue);
}

.logo-name-last {
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
}

/* Nav */

.header-nav a {
  font-size: 20px;
  font-weight: 400;
  color: var(--black);
  padding: 16px 30px;
  transition: color 0.15s;
}

.header-nav a:hover { color: var(--blue); }

/* Connexion / Déconnexion button */
.btn-connexion {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--r-pill);
  padding: 0 24px;
  height: 51px;
  font-size: 15px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-connexion:hover {
  background: var(--blue-hover);
  color: var(--white);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.btn-tdb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.btn-tdb:hover { color: var(--blue-hover); }

/*Footer*/
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 48px 60px 40px;
  flex-shrink: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1353px;
}

.footer-section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 20px;
}

.footer-nav a,
.footer-mentions p,
.footer-mentions a {
  font-size: 15px;
  font-weight: 400;
  color: var(--black);
  display: block;
  margin-bottom: 10px;
  text-decoration: none;
}

.footer-nav a:hover { color: var(--blue); }

.footer-logo-area {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.footer-logo-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

.footer-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: #0077B5;
  text-decoration: none;
  transition: opacity 0.15s;
}

.footer-linkedin:hover { opacity: 0.75; }

.footer-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.footer-logo-text {
  font-size: 22px;
  font-weight: 400;
  color: var(--black);
  line-height: 1.3;
}

.footer-logo-first { color: var(--blue); }

.footer-bottom {
  margin-top: 32px;
  position: relative;
}

/* ============================================================
   Auth pages — login / register
   (Card: r=50, title fs=50/700, labels fs=30/400, input h=80 r=10)
   ============================================================ */
.page-auth {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 24px 80px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 40px 48px;
  width: 100%;
  max-width: 500px;
}

.auth-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--black);
  text-align: center;
  margin-bottom: 28px;
  font-family: 'DM Sans', Georgia, serif;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 15px;
  font-weight: 400;
  color: var(--black);
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  height: 50px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-input);
  padding: 0 16px;
  font-size: 15px;
  font-weight: 400;
  color: var(--black);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  background-size: 22px;
  padding-right: 54px;
}

.form-group input::placeholder { color: var(--gray-ph); }

.form-group input:focus,
.form-group select:focus {
  border-color: var(--blue);
  background: var(--white);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  background: var(--blue);
  color: var(--near-white);
  border: none;
  border-radius: var(--r-input);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  margin-top: 8px;
}

.btn-primary:hover {
  background: var(--blue-hover);
  color: var(--white);
}

.auth-switch {
  text-align: center;
  font-size: 14px;
  color: var(--black);
  margin-top: 20px;
}

.auth-switch a {
  color: var(--blue);
  font-weight: 500;
}

.auth-switch a:hover { text-decoration: underline; }

/* Alerts */
.alert {
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 16px;
  line-height: 1.5;
}

.alert-error {
  background: #FFF0F0;
  color: #CC0000;
  border: 1px solid #FFCCCC;
}

.alert-success {
  background: #F0FFF4;
  color: #006620;
  border: 1px solid #BBDDCC;
}

/* ============================================================
   Projets page
   ============================================================ */
.page-projets {
  padding: 60px 60px 80px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.projets-title {
  font-size: 90px;
  font-weight: 400;
  line-height: 1.05;
  text-align: center;
  color: var(--black);
  margin-bottom: 60px;
  font-family: 'DM Sans', Georgia, sans-serif;
}

.projets-title strong { 
  font-weight: 700; 
  font-family: 'Playfair Display', Georgia, serif;
}

.trace-hidden { display: none !important; }

.projets-more {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.btn-afficher-plus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 51px;
  padding: 0 36px;
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--black);
  border: 1.5px solid var(--border);
  font-size: 16px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-afficher-plus:hover {
  background: var(--blue);
  color: var(--white);
}

/* ============================================================
   Dashboard  (Figma: Tableau-de-bord frame)
   ============================================================ */
.page-dashboard {
  padding: 60px 60px 80px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* Title: "Tableau / De Bord" */
.dashboard-title {
  font-size: 90px;
  font-weight: 400;
  line-height: 1.05;
  text-align: center;
  color: var(--black);
  margin-bottom: 60px;
  font-family: 'DM Sans', Georgia,sans-serif;
}

.dashboard-title strong { 
  font-weight: 700; 
  font-family: 'Playfair Display', Georgia, serif;
}

/* Filter rows */
.dashboard-filters { margin-bottom: 40px; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--black);
  white-space: nowrap;
}

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

.filter-pill {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  background: var(--white);
  color: var(--black);
  border: 1.5px solid var(--border);
  white-space: nowrap;
}

.filter-pill.active,
.filter-pill:hover {
  background: var(--blue);
  color: var(--near-white);
}

/* Add trace button + actions */
.dashboard-add-btn {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.btn-add-trace {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue);
  color: var(--white);
  border-radius: 40px;
  padding: 0 18px;
  height: 36px;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-add-trace:hover {
  background: var(--blue-hover);
  color: var(--white);
}

.btn-comm {
  background: var(--white);
  color: var(--black);
  border: 1.5px solid var(--border) !important;
}

.btn-comm:hover {
  background: #e0e0e0;
  color: var(--black);
}

/* ============================================================
   Gestion commentaires
   ============================================================ */
.comm-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comm-card {
  background: var(--white);
  border-radius: 30px;
  box-shadow: var(--shadow-card);
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.comm-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.comm-trace-badge {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 16px;
  border-radius: 40px;
  background: var(--blue);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.comm-trace-badge:hover { background: var(--blue-hover); }

.comm-author {
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
}

.comm-date {
  font-size: 13px;
  font-weight: 400;
  color: var(--gray-ph);
  white-space: nowrap;
}

.comm-content {
  font-size: 17px;
  font-weight: 400;
  color: var(--dark);
  line-height: 1.7;
  margin: 0;
}

.comm-count {
  text-align: center;
  font-size: 14px;
  color: var(--gray-ph);
  margin-top: 24px;
}

/* ============================================================
   Gestion profils
   ============================================================ */
.profil-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profil-card {
  background: var(--white);
  border-radius: 30px;
  box-shadow: var(--shadow-card);
  padding: 24px 36px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.profil-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.profil-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.profil-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 10px;
}

.profil-self-badge {
  font-size: 11px;
  font-weight: 500;
  background: var(--gray-input);
  color: var(--dark);
  border-radius: 20px;
  padding: 2px 10px;
}

.profil-email {
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-ph);
}

.profil-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.profil-role-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 14px;
  border-radius: 40px;
  border: 1.5px solid;
  font-size: 12px;
  font-weight: 600;
}

.profil-valide-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 14px;
  border-radius: 40px;
  font-size: 12px;
  font-weight: 500;
}

.profil-valide-badge.valide {
  background: rgba(22, 163, 74, 0.08);
  border: 1.5px solid #16a34a;
  color: #16a34a;
}

.profil-valide-badge.invalide {
  background: rgba(220, 53, 69, 0.07);
  border: 1.5px solid #dc3545;
  color: #dc3545;
}

.profil-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.profil-actions .btn-action {
  font-size: 16px;
}

.btn-valider-profil {
  color: #16a34a !important;
}

.btn-valider-profil:hover { color: #15803d !important; }

.btn-invalider {
  color: #dc3545 !important;
}

.btn-invalider:hover { color: #b91c1c !important; }

/* Checkbox profil */
.profil-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
}

.profil-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

.profil-date-info {
  font-size: 18px;
  font-weight: 400;
  color: var(--dark);
  margin-top: 4px;
}

/* Compteur filtre */
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 20px;
  background: rgba(255,255,255,0.3);
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
  margin-left: 4px;
}

.filter-pill.active .filter-count,
.filter-pill:hover .filter-count {
  background: rgba(255,255,255,0.25);
}

/* Trace cards (Figma: white card r=50, desc fs=25, actions fs=25) */

.no-traces {
  text-align: center;
  font-size: 24px;
  color: var(--gray-ph);
  padding: 60px 0;
}

.traces-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.trace-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.trace-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #E8E8E8;
  flex-shrink: 0;
}

.trace-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E8E8E8;
  color: var(--gray-ph);
}

.trace-card-content {
  flex: 1;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trace-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.trace-card-title-line {
  font-size: 28px;
  font-weight: 400;
  color: var(--black);
  line-height: 1.3;
}

.trace-card-title-name { font-weight: 700; }

.trace-card-type-badge {
  font-size: 20px;
  font-weight: 400;
  color: var(--dark);
  margin-left: 6px;
}

.trace-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.trace-card-desc {
  font-size: 20px;
  font-weight: 400;
  color: var(--black);
  line-height: 1.6;
  overflow: hidden;
  max-height: calc(1.6em * 4);
  flex: 1;
}

.trace-card-footer {
  display: flex;
  align-items: center;
}

.btn-lire-plus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 25px;
  font-weight: 400;
  color: rgb(30, 30, 30);
  text-decoration: none;
  transition: color 0.15s;
}

.btn-lire-plus:hover { color: var(--blue); }

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 400;
  color: rgb(30, 30, 30);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  padding: 0;
  transition: color 0.15s;
  white-space: nowrap;
}

.btn-action:hover { color: var(--blue); }
.btn-action-delete:hover { color: #CC0000; }
.btn-en-avant { color: var(--gray-ph); }
.btn-en-avant:hover { color: #f0a500; }
.btn-en-avant-active { color: #f0a500; }

/* ============================================================
   Trace form — add / edit
   ============================================================ */
.page-trace-form {
  padding: 60px 80px 80px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.trace-form-title {
  font-size: 60px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 12px;
  color: var(--black);
  line-height: 1.1;
  font-family: 'DM Sans', Georgia, sans-serif;
}

.trace-form-title strong {
  font-weight: 700;
  font-family: 'Playfair Display', Georgia, sans-serif;
}

.trace-form-subtitle {
  font-size: 22px;
  font-weight: 400;
  text-align: center;
  color: var(--black);
  margin-bottom: 60px;
}

.trace-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  margin-bottom: 48px;
}

.trace-form-field {
  margin-bottom: 36px;
}

.trace-form-label {
  display: block;
  font-size: 22px;
  font-weight: 400;
  color: var(--black);
  margin-bottom: 12px;
}

.trace-form-input {
  width: 100%;
  height: 52px;
  background: transparent;
  border: 1.5px solid #CCCCCC;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 18px;
  font-family: inherit;
  color: var(--black);
  outline: none;
  transition: border-color 0.15s;
}

.trace-form-input:focus { border-color: var(--blue); }

.trace-form-input::placeholder { color: var(--gray-ph); }

.trace-form-textarea {
  width: 100%;
  min-height: 260px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 18px;
  font-family: inherit;
  color: var(--black);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.6;
}

.trace-form-textarea:focus { border-color: var(--blue); }

.trace-form-textarea::placeholder { color: var(--gray-ph); }

/* Radio / checkbox groups */
.radio-group {
  display: flex;
  gap: 24px 40px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 400;
  cursor: pointer;
}

.radio-group input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-group {
  display: flex;
  gap: 16px 32px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 400;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

/* AC checkboxes grid */
.ac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px 16px;
  margin-top: 8px;
}

.ac-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
}

.ac-grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

/* Logiciels — sélecteur icônes dans les formulaires */
.logiciels-check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.logiciel-check-label {
  position: relative;
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 2px solid transparent;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
  opacity: 0.45;
}

.logiciel-check-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.logiciel-check-label img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.logiciel-check-label .tool-icon-figma-img,
.logiciel-check-label .tool-icon-vscode-img {
  object-fit: cover;
  border-radius: 0;
}

.logiciel-check-label:hover {
  opacity: 1;
  border-color: var(--border);
}

.logiciel-check-label.selected,
.logiciel-check-label:has(input:checked) {
  opacity: 1;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(55, 70, 255, 0.15);
}

/* Logiciels — affichage icônes sur trace.php */
.trace-logiciels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* File upload (Figma: + icon circle + "Ajouter des fichiers" fs=20) */
.file-upload-wrapper {
  margin-top: 16px;
}

.file-upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.file-upload-row input[type="file"] {
  display: none;
}

.file-upload-icon {
  width: 48px;
  height: 48px;
  background: var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s;
}

.file-upload-row:hover .file-upload-icon { background: var(--blue-hover); }

.file-upload-label {
  font-size: 20px;
  font-weight: 400;
  color: var(--black);
}

.file-names-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.file-names-existing .file-name-item {
  color: var(--dark);
}

.file-name-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 400;
  color: var(--blue);
}

.file-name-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.file-principal-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-left: 4px;
}

.file-principal-label input[type="radio"] { display: none; }

.file-principal-star {
  font-size: 16px;
  color: var(--gray-ph);
  transition: color 0.15s;
  line-height: 1;
}

.file-principal-label:hover .file-principal-star { color: #f0a500; }

.file-principal-label input[type="radio"]:checked + .file-principal-star { color: #f0a500; }

.drag-handle {
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
  color: var(--gray-ph);
  cursor: grab;
  flex-shrink: 0;
}

.drag-handle:active { cursor: grabbing; }

.file-sortable {
  cursor: default;
  transition: opacity 0.15s, background 0.15s;
  border-radius: 8px;
  padding: 2px 4px;
}

.file-sortable.dragging {
  opacity: 0.4;
  background: rgba(55, 70, 255, 0.06);
}

.file-sortable[draggable="true"]:not(.dragging):hover {
  background: rgba(55, 70, 255, 0.04);
  border-radius: 8px;
}

.file-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  width: 16px;
  height: 16px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
}

.file-remove-btn:hover { color: #dc3545; }

.file-current {
  font-size: 13px;
  color: var(--gray-ph);
  margin-top: 8px;
}

/* Message de succès sous le bouton Valider */
.form-success {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 32px;
  border-radius: 50px;
  background: rgba(55, 70, 255, 0.08);
  border: 2px solid var(--blue);
  color: var(--blue);
  font-size: 15px;
  font-weight: 500;
}

/* ============================================================
   Pages légales — Mentions légales & RGPD
   ============================================================ */
.page-legal {
  max-width: 860px;
  margin: 0 auto;
  padding: 72px 40px 100px;
  width: 100%;
}

.legal-header {
  margin-bottom: 64px;
}

.legal-title {
  font-size: 80px;
  font-weight: 400;
  line-height: 1.05;
  color: var(--black);
  font-family: 'DM Sans', Georgia, sans-serif;
}

.legal-title strong {
  font-weight: 700;
  font-family: 'Playfair Display', Georgia, serif;
}

.legal-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.legal-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.legal-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--black);
  font-family: 'Playfair Display', Georgia, serif;
}

.legal-section p,
.legal-section li {
  font-size: 17px;
  font-weight: 400;
  color: var(--dark);
  line-height: 1.75;
}

.legal-section ul {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legal-section a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-section a:hover { color: var(--blue-hover); }

@media (max-width: 768px) {
  .page-legal { padding: 48px 24px 72px; }
  .legal-title { font-size: 52px; }
  .legal-header { margin-bottom: 40px; }
}

/* Message de succès dans le tableau de bord (suppression) */
.dashboard-success {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 32px;
  border-radius: 50px;
  background: rgba(55, 70, 255, 0.08);
  border: 2px solid var(--blue);
  color: var(--blue);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 32px;
}

/* Form actions (Valider / Annuler) */
.trace-form-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 48px;
}

.btn-valider {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 256px;
  height: 54px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-size: 22px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-valider:hover { background: var(--blue-hover); }

.btn-annuler {
  font-size: 22px;
  font-weight: 400;
  color: var(--black);
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s;
}

.btn-annuler:hover { color: var(--blue); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .site-header { padding: 0 32px; }
  .page-dashboard { padding: 48px 32px 60px; }
  .page-projets { padding: 48px 32px 60px; }
  .projets-title { font-size: 70px; }
  .page-trace-form { padding: 48px 40px 60px; }
  .dashboard-title { font-size: 70px; }
  .trace-form-grid { gap: 40px; }
}

@media (max-width: 900px) {
  .trace-form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .dashboard-title { font-size: 56px; }
}

/* ============================================================
   Menu hamburger mobile
   ============================================================ */
.mobile-header-right { display: none; }

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}

/* Croix quand ouvert */
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu mobile overlay */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  top: 72px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 998;
  flex-direction: column;
  padding: 40px 32px;
  overflow-y: auto;
}

.mobile-menu.open { display: flex; }

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav a {
  font-size: 28px;
  font-weight: 400;
  color: var(--black);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: color 0.15s;
}

.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { color: var(--blue); }

.mobile-nav-tdb {
  color: var(--blue) !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center;
  gap: 8px;
}

/* Bouton connexion réduit (mobile) */
.btn-connexion-sm {
  height: 38px !important;
  padding: 0 16px !important;
  font-size: 13px !important;
}

@media (max-width: 768px) {
  .site-header { padding: 0 20px; height: 72px; }
  .header-nav { display: none; }
  .header-actions { display: none; }
  .mobile-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .auth-card { padding: 28px 24px; }
  .auth-title { font-size: 26px; }

  .page-dashboard { padding: 36px 20px 60px; }
  .page-projets { padding: 36px 20px 60px; }
  .projets-title { font-size: 48px; margin-bottom: 36px; }
  .dashboard-title { font-size: 44px; }
  .trace-form-title { font-size: 40px; }
  .page-trace-form { padding: 36px 20px 60px; }

  .traces-list { grid-template-columns: 1fr; }
  .trace-card-content { padding: 24px 20px; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-logo-area { display: none; }
  .site-footer { padding: 36px 24px 28px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .filter-row { flex-direction: column; align-items: flex-start; }
  .trace-card-top { flex-direction: column; }
  .trace-card-actions { flex-direction: row; align-items: center; }
}

/* ============================================================
   Home Page — Hero
   ============================================================ */
.page-home {
  position: relative;
  overflow: hidden;
}

.deco-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.deco-bg img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.deco-group {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deco-inner {
  flex-shrink: 0;
  width: 1080px;
  height: 1080px;
}

.deco-group img,
.deco-inner img {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.82;
}

/* G1 — left=-764 top=-56, conteneur 1353×1354 */
.deco-g1 {
  left: -764px;
  top: -56px;
  width: 1353px;
  height: 1354px;
}
.deco-g1 .deco-inner {
  transform: rotate(107.33deg);
}

/* G2 — left=721 top=601, 1080×1080 */
.deco-g2 {
  left: 721px;
  top: 431px;
  width: 1080px;
  height: 1080px;
}
.deco-g2 .deco-inner {
  transform: rotate(180deg) scaleY(-1);
}

.deco-g3 {
  left: -481px;
  top: 1525px;
  width: 1080px;
  height: 1080px;
}
.deco-g3 .deco-inner {
  transform: rotate(180deg) scaleY(-1);
}

.deco-g4 {
  left: 1052px;
  top: 1869px;
  width: 1080px;
  height: 1080px;
}

/* Tout le contenu de la home doit être au-dessus du fond */
.page-home > *:not(.deco-bg) {
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  padding: 80px 58px 100px;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-text {
  position: relative;
  z-index: 1;
  line-height: 1;
}

.hero-name {
  font-size: 200px;
  font-weight: 700;
  line-height: 0.9;
  display: block;
  font-family: 'DM Sans', Georgia, sans-serif;
}

.hero-name-first {
  display: inline-block;
  position: relative;
}

.hero-name-first::before {
  content: '';
  position: absolute;
  inset: 0 -16px;
  background: var(--blue);
  z-index: -1;
  border-radius: 4px;
  transform-origin: left center;
  transform: scaleX(0);
  animation: highlight-expand 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

@keyframes highlight-expand {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.hero-name-first-text {
  color: var(--near-white);
  position: relative;
}

.hero-name-last {
  color: var(--black);
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
}

.hero-tagline {
  font-size: 40px;
  font-weight: 400;
  margin-top: 32px;
  color: var(--black);
  font-family: 'DM Sans', Georgia, sans-serif;
}

.hero-tagline strong { 
  font-weight: 700; 
  font-family: 'Playfair Display', Georgia, serif;
}

/* ============================================================
   Home Page — About
   ============================================================ */
.section-apropos {
  padding: 80px 58px;
}

.section-title {
  font-size: 50px;
  font-weight: 400;
  margin-bottom: 40px;
  font-family: 'DM Sans', Georgia, sans-serif;
}

.section-title strong { 
  font-weight: 700; 
  font-family: 'Playfair Display', Georgia, serif;
}

.apropos-card {
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 60px 60px 80px 60px;
  display: flex;
  gap: 60px;
  align-items: flex-start;
  position: relative;
}

.apropos-image {
  width: 280px;
  min-width: 280px;
  height: 350px;
  background: var(--gray-input);
  border-radius: 30px;
  object-fit: cover;
  flex-shrink: 0;
}

.apropos-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.apropos-bio {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--dark);
}

.apropos-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.tool-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.15s, opacity 0.15s;
}

.tool-icon-vscode-wrap {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}

.tool-icon-vscode-wrap:hover {
  transform: scale(1.15);
  opacity: 0.85;
}

.tool-icon-vscode-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.25);
  transform-origin: center;
}

.tool-icon-figma-wrap {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}

.tool-icon-figma-wrap:hover {
  transform: scale(1.15);
  opacity: 0.85;
}

.tool-icon-figma-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.15);
  transform-origin: center;
}

.tool-icon:hover {
  transform: scale(1.15);
  opacity: 0.85;
}

.apropos-cv {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 20px;
}

.btn-cv-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.btn-cv-circle:hover { background: var(--blue-hover); }

.btn-cv-circle svg { color: var(--white); }

.apropos-cv-label {
  font-size: 18px;
  font-weight: 400;
  color: var(--black);
}

.icon-linkedin {
  display: inline-flex;
  opacity: 1;
  transition: opacity 0.15s;
}

.icon-linkedin:hover { opacity: 0.7; }

.icon-linkedin-apropos {
  position: absolute;
  bottom: 26px;
  right: 40px;
}

.icon-linkedin-footer {
  position: absolute;
  bottom: 0;
  right: 0;
}

/* ============================================================
   Home Page — Latest Creations
   ============================================================ */
.section-projets {
  padding: 80px 58px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 24px;
  flex-wrap: wrap;
}

.home-trace-card {
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.home-trace-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--gray-input);
  flex-shrink: 0;
}

.home-trace-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--gray-input);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-trace-image-placeholder svg {
  color: var(--gray-ph);
}

.home-trace-body {
  padding: 32px 36px 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.home-trace-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-trace-type {
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  background: rgba(55, 70, 255, 0.08);
  border-radius: 20px;
  padding: 4px 14px;
}

.home-trace-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--black);
}

.home-trace-desc {
  font-size: 18px;
  font-weight: 400;
  color: var(--dark);
  line-height: 1.7;
  overflow: hidden;
  max-height: calc(1.7em * 4);
  flex: 1;
}

.home-trace-lire {
  font-size: 18px;
  font-weight: 600;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.home-trace-lire:hover { color: var(--blue-hover); }

/* Boutons d'action dans le tableau de bord */
.tdb-card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.btn-voir-tous {
  display: inline-flex;
  align-items: center;
  height: 51px;
  padding: 0 28px;
  border-radius: var(--r-pill);
  background: var(--blue);
  color: var(--white);
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}

.btn-voir-tous:hover { background: var(--blue-hover); color: var(--white); }

/* ============================================================
   Home Page — CTA / Contact
   ============================================================ */
.section-contact-cta {
  padding: 80px 58px;
  text-align: center;
}

.cta-title {
  font-size: 40px;
  font-weight: 400;
  margin-bottom: 16px;
  color: var(--black);
  font-family: 'DM Sans', Georgia, sans-serif;
}

.cta-title strong { 
  font-weight: 700; 
  font-family: 'Playfair Display', Georgia, serif;
}

.cta-subtitle {
  font-size: 25px;
  font-weight: 400;
  color: var(--dark);
  margin-bottom: 32px;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  height: 51px;
  padding: 0 40px;
  border-radius: var(--r-pill);
  background: var(--blue);
  color: var(--white);
  font-size: 20px;
  font-weight: 400;
  transition: background 0.2s;
}

.btn-contact:hover { background: var(--blue-hover); color: var(--white); }

/* ============================================================
   Home Page — Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .hero { padding: 60px 40px 80px; }
  .hero-name { font-size: 140px; }
  .hero-tagline { font-size: 32px; }
  .section-apropos,
  .section-projets,
  .section-contact-cta { padding: 60px 40px; }
}

@media (max-width: 900px) {
  .hero-name { font-size: 100px; }
  .hero-tagline { font-size: 26px; }
  .apropos-card { flex-direction: column; gap: 36px; }
  .apropos-image { width: 100%; min-width: unset; height: 260px; }
  .section-title { font-size: 38px; }
}

@media (max-width: 768px) {
  .hero { padding: 40px 24px 60px; min-height: unset; }
  .hero-name { font-size: 19vw; }
  .hero-tagline { font-size: 22px; margin-top: 20px; }
  .section-apropos,
  .section-projets,
  .section-contact-cta { padding: 48px 24px; }
  .apropos-card { padding: 36px 28px; }
  .apropos-bio { font-size: 18px; }
  .apropos-cv-label { font-size: 18px; }
  .section-title { font-size: 30px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .home-trace-desc { font-size: 18px; }
  .cta-title { font-size: 28px; }
  .cta-subtitle { font-size: 18px; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 19vw; }
  .hero-tagline { font-size: 18px; }
}

/* ============================================================
   Modal de confirmation de suppression
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--white);
  border-radius: 24px;
  padding: 40px 48px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.modal-text {
  font-size: 18px;
  font-weight: 400;
  color: var(--black);
  text-align: center;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

/* Bouton Annuler — style feedback bleu (comme .contact-success) */
.btn-modal-annuler {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 32px;
  border-radius: 50px;
  background: rgba(55, 70, 255, 0.08);
  border: 2px solid var(--blue);
  color: var(--blue);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-modal-annuler:hover {
  background: rgba(55, 70, 255, 0.15);
}

/* Bouton Supprimer — même style mais en rouge */
.btn-modal-supprimer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 32px;
  border-radius: 50px;
  background: rgba(220, 53, 69, 0.07);
  border: 2px solid #dc3545;
  color: #dc3545;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-modal-supprimer:hover {
  background: rgba(220, 53, 69, 0.15);
}

/* ============================================================
   Contact page
   ============================================================ */
.page-contact {
  padding: 60px 58px 100px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.contact-header {
  text-align: center;
  margin-bottom: 56px;
}

.contact-title {
  font-size: 50px;
  font-weight: 400;
  color: var(--black);
  margin-bottom: 20px;
  font-family: 'DM Sans', Georgia, serif;
  line-height: 1.2;
}

.contact-title strong {
  font-weight: 700;
  font-family: 'Playfair Display', Georgia, serif;
}

.contact-subtitle {
  font-size: 20px;
  font-weight: 400;
  color: var(--dark);
  line-height: 1.7;
  margin-bottom: 20px;
}

.contact-social-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.contact-email-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
  transition: opacity 0.15s;
}

.contact-email-link:hover {
  opacity: 0.75;
  color: var(--blue);
}

.contact-linkedin-link {
  color: #0077B5;
}

.contact-linkedin-link:hover {
  color: #0077B5;
}

/* Form grid */
.contact-form-wrapper {
  width: 100%;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.contact-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-field-group {
  display: flex;
  flex-direction: column;
}

.contact-field-grow {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.contact-field-grow .contact-textarea {
  flex: 1;
  min-height: 260px;
  resize: vertical;
}

.contact-label {
  font-size: 16px;
  font-weight: 400;
  color: var(--black);
  margin-bottom: 10px;
  display: block;
}

/* Inputs — override Bootstrap form-control to match site style */
.contact-input.form-control {
  height: 54px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-input);
  padding: 0 18px;
  font-size: 15px;
  font-weight: 400;
  color: var(--black);
  font-family: inherit;
  box-shadow: none;
  transition: border-color 0.15s, background 0.15s;
}

.contact-input.form-control:focus {
  background: var(--white);
  border-color: var(--blue);
  box-shadow: none;
  outline: none;
}

.contact-input.form-control::placeholder {
  color: var(--gray-ph);
}

.contact-input.form-control.is-invalid {
  border-color: #dc3545;
  background: var(--gray-input);
}

.contact-input.form-control.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: none;
}

.contact-textarea.form-control {
  height: auto;
  padding: 16px 18px;
  resize: vertical;
}

/* Submit area */
.contact-submit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.btn-envoyer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 60px;
  border-radius: 50px;
  background: var(--blue);
  color: var(--white);
  font-size: 20px;
  font-weight: 400;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}

.btn-envoyer:hover { background: var(--blue-hover); }

/* Success message — même forme que .btn-envoyer, fond bleu clair */
.contact-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 60px;
  border-radius: 50px;
  background: rgba(55, 70, 255, 0.08);
  border: 2px solid var(--blue);
  color: var(--blue);
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
}

/* Responsive */
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; gap: 0; }
  .contact-col { gap: 20px; margin-bottom: 20px; }
  .contact-field-grow .contact-textarea { min-height: 180px; }
}

@media (max-width: 768px) {
  .page-contact { padding: 40px 24px 60px; }
  .contact-title { font-size: 34px; }
  .contact-subtitle { font-size: 16px; }
  .contact-header { margin-bottom: 36px; }
  .btn-envoyer, .contact-success { padding: 0 36px; font-size: 16px; }
}

/* ============================================================
   Trace detail page — trace.php
   ============================================================ */
.page-trace {
  padding: 48px 60px 80px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ← Retour */
.trace-retour {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 400;
  color: var(--dark);
  text-decoration: none;
  width: fit-content;
  transition: color 0.15s;
}
.trace-retour:hover { color: var(--blue); }

/* Main card */
.trace-card-detail {
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Card header: title + tags */
.trace-detail-header {
  padding: 52px 60px 40px;
  border-bottom: 1px solid var(--border);
}

.trace-detail-title {
  font-size: 48px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.2;
  margin-bottom: 24px;
  font-family: 'Playfair Display', Georgia, serif;
}

.trace-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.trace-tag {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 18px;
  border-radius: 40px;
  background: var(--blue);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.trace-detail-sae {
  font-size: 16px;
  font-weight: 400;
  color: var(--gray-ph);
  margin-top: 4px;
}

/* Card body: description + image grid */
.trace-detail-body {
  padding: 40px 60px 52px;
}

.trace-detail-desc {
  font-size: 20px;
  font-weight: 400;
  color: var(--dark);
  line-height: 1.75;
  margin-bottom: 40px;
}

/* Image grid: 3 colonnes, rangées multiples si besoin */
.trace-detail-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  grid-auto-rows: 1fr;
}

.trace-image-item {
  border-radius: 20px;
  overflow: hidden;
  background: #E8E8E8;
  align-self: start;
}

.trace-image-item img {
  width: 100%;
  height: auto;
  display: block;
}

.trace-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.trace-image-placeholder svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Lien externe — YouTube / Google Drive */
.trace-external-media {
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 40px 52px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.trace-youtube-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* ratio 16:9 */
  border-radius: 16px;
  overflow: hidden;
}

.trace-youtube-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 16px;
}

.trace-drive-text {
  font-size: 18px;
  font-weight: 400;
  color: var(--dark);
  line-height: 1.6;
}

.trace-drive-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 28px;
  border-radius: 50px;
  border: 2px solid var(--blue);
  color: var(--blue);
  background: rgba(55, 70, 255, 0.06);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  width: fit-content;
}

.trace-drive-link:hover {
  background: var(--blue);
  color: var(--white);
}

@media (max-width: 1100px) {
  .trace-external-media { padding: 32px 40px; }
}

@media (max-width: 768px) {
  .trace-external-media { padding: 24px 20px; }
  .trace-drive-text { font-size: 16px; }
}

/* Section title shared by files / ACs / comments */
.trace-section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 20px;
  font-family: 'Playfair Display', Georgia, serif;
}

/* Download section */
.trace-downloads {
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 40px 52px;
}

.trace-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 28px;
  border-radius: 50px;
  border: 2px solid var(--blue);
  color: var(--blue);
  background: rgba(55, 70, 255, 0.06);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  word-break: break-all;
}

.trace-download-btn:hover {
  background: var(--blue);
  color: var(--white);
}

/* ACs section */
.trace-acs {
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 40px 52px;
}

.trace-acs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trace-ac-badge {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 22px;
  border-radius: 40px;
  border: 2px solid var(--blue);
  color: var(--blue);
  background: rgba(55, 70, 255, 0.06);
  font-size: 14px;
  font-weight: 500;
}

/* Comments section */
.trace-comments {
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 40px 52px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.comment-textarea {
  width: 100%;
  min-height: 130px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 16px;
  font-family: inherit;
  color: var(--black);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.6;
}

.comment-textarea:focus {
  border-color: var(--blue);
  background: var(--white);
}

.comment-textarea::placeholder { color: var(--gray-ph); }

.comment-submit {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 32px;
  border-radius: 50px;
  background: var(--blue);
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.comment-submit:hover { background: var(--blue-hover); }

.comment-empty {
  font-size: 16px;
  color: var(--gray-ph);
  font-style: italic;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comment-item {
  background: var(--gray-input);
  border-radius: 20px;
  padding: 24px 28px;
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.comment-author {
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
}

.comment-date {
  font-size: 13px;
  font-weight: 400;
  color: var(--gray-ph);
  white-space: nowrap;
}

.comment-content {
  font-size: 16px;
  font-weight: 400;
  color: var(--dark);
  line-height: 1.7;
  margin: 0;
}

/* Responsive — trace detail */
@media (max-width: 1100px) {
  .page-trace { padding: 40px 40px 60px; }
  .trace-detail-header { padding: 40px 40px 32px; }
  .trace-detail-body { padding: 32px 40px 40px; }
  .trace-downloads,
  .trace-acs,
  .trace-comments { padding: 32px 40px; }
}

@media (max-width: 900px) {
  .trace-detail-images { grid-template-columns: repeat(2, 1fr); }
  .trace-detail-title { font-size: 36px; }
}

@media (max-width: 768px) {
  .page-trace { padding: 28px 20px 48px; gap: 28px; }
  .trace-detail-header { padding: 28px 24px 24px; }
  .trace-detail-body { padding: 24px 24px 32px; }
  .trace-detail-title { font-size: 28px; }
  .trace-detail-desc { font-size: 17px; }
  .trace-detail-images { grid-template-columns: 1fr; }
  .trace-downloads,
  .trace-acs,
  .trace-comments { padding: 24px 20px; }
  .trace-section-title { font-size: 22px; }
}

/* ==========================================
   Messages reçus (messages.php)
   ========================================== */

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.message-card {
  background: var(--white);
  border-radius: 20px;
  padding: 24px 28px;
  border: 1.5px solid var(--border);
  transition: box-shadow 0.2s;
}

.message-card:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}

.message-non-lu {
  border-left: 4px solid var(--blue);
}

.message-lu {
  opacity: 0.75;
}

.message-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.message-card-from {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.message-badge-new {
  background: var(--blue);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 30px;
  text-transform: uppercase;
}

.message-entreprise {
  color: var(--gray-ph);
  font-size: 14px;
}

.message-email {
  color: var(--blue);
  font-size: 13px;
  text-decoration: none;
}
.message-email:hover { text-decoration: underline; }

.message-date {
  color: var(--gray-ph);
  font-size: 13px;
  white-space: nowrap;
}

.message-objet {
  font-size: 15px;
  margin-bottom: 10px;
  color: var(--dark);
}

.message-body {
  font-size: 15px;
  color: var(--dark);
  line-height: 1.6;
  background: var(--bg);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.message-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Badge messages non lus dans le dashboard */
.tdb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 30px;
  padding: 0 5px;
  margin-left: 4px;
  line-height: 1;
}

/* Bandeau messages non lus */
.messages-banner-nonlus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  color: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 30px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}

.messages-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(55, 70, 255, 0.4); }
  50%       { box-shadow: 0 0 0 5px rgba(55, 70, 255, 0); }
}
