/* =====================================================
   CDC Generator — Feuille de style principale
   Thème éco : vert naturel / lime / or
   ===================================================== */

/* ─── Variables CSS ─────────────────────────────────── */
:root {
  --bg-base:       #f0fdf4;
  --bg-surface:    #f6fef8;
  --bg-card:       #ffffff;
  --bg-card-hover: #dcfce7;
  --bg-input:      #f0fdf4;

  --border:        #bbf7d0;
  --border-focus:  #16a34a;

  --text-primary:  #052e16;
  --text-muted:    #166534;
  --text-faint:    #4b7a5a;

  --accent:        #16a34a;
  --accent-hover:  #15803d;
  --accent-light:  rgba(22, 163, 74, 0.1);

  --violet:        #84cc16;
  --cyan:          #22c55e;
  --green:         #16a34a;
  --red:           #dc2626;
  --orange:        #ca8a04;

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --shadow:        0 4px 24px rgba(22, 163, 74, 0.08);
  --shadow-lg:     0 8px 40px rgba(22, 163, 74, 0.14);
  --shadow-glow:   0 0 24px rgba(22, 163, 74, 0.25);

  --transition:    0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ─── Layout principal ──────────────────────────────── */
.app-main { min-height: calc(100vh - 64px); }
.app-main.no-header { min-height: 100vh; }

.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ─── Header ────────────────────────────────────────── */
.app-header {
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(22, 163, 74, 0.08);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary) !important;
  text-decoration: none;
}

.brand-icon { font-size: 1.4rem; }
.brand-name {
  background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link:hover, .nav-link.active { color: var(--accent); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--bg-base);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
}

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

.btn-logout {
  color: var(--text-faint);
  font-size: 1rem;
  cursor: pointer;
  transition: color var(--transition);
}
.btn-logout:hover { color: var(--red); }

/* ─── Boutons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
  color: white;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover { color: var(--accent); border-color: var(--accent); }

.btn-danger {
  background: rgba(220, 38, 38, 0.08);
  color: var(--red);
  border: 1px solid rgba(220, 38, 38, 0.25);
}
.btn-danger:hover { background: rgba(220, 38, 38, 0.15); }

.btn-yellow {
  background: linear-gradient(135deg, #ca8a04 0%, #d97706 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(202, 138, 4, 0.3);
}
.btn-yellow:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(202, 138, 4, 0.4);
  color: white;
}

.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

/* ─── Formulaires ───────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all var(--transition);
  resize: vertical;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
  background: var(--bg-card);
}

.form-input::placeholder { color: #9ab8a0; }

.form-hint {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 6px;
}

.required { color: var(--orange); }

.label-with-assist {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.label-with-assist .form-label { margin-bottom: 0; }

/* Bouton d'assistance IA */
.btn-ia-assist {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(22, 163, 74, 0.08);
  color: var(--accent);
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-ia-assist:hover {
  background: rgba(22, 163, 74, 0.18);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ─── Alertes ───────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.alert-success {
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: #166534;
}

.alert-error {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #991b1b;
}

/* ─── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-gray   { background: rgba(71, 85, 105, 0.1);  color: #475569; border: 1px solid rgba(71,85,105,0.2); }
.badge-blue   { background: rgba(37, 99, 235, 0.1);  color: #1d4ed8; border: 1px solid rgba(37,99,235,0.25); }
.badge-green  { background: rgba(22, 163, 74, 0.1);  color: #166534; border: 1px solid rgba(22,163,74,0.25); }
.badge-purple { background: rgba(124, 58, 237, 0.1); color: #6d28d9; border: 1px solid rgba(124,58,237,0.25); }
.badge-orange { background: rgba(202, 138, 4, 0.1);  color: #92400e; border: 1px solid rgba(202,138,4,0.25); }
.badge-red    { background: rgba(220, 38, 38, 0.1);  color: #991b1b; border: 1px solid rgba(220,38,38,0.25); }
.badge-teal   { background: rgba(22, 163, 74, 0.1);  color: #15803d; border: 1px solid rgba(22,163,74,0.25); }

/* ─── Page Login ─────────────────────────────────────── */
.login-page {
  background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 50%, #ecfef4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px rgba(22, 163, 74, 0.4));
}

.login-title {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-faint);
  font-size: 0.9rem;
  margin-top: 6px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.btn-oidc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 4px;
}
.btn-oidc:hover { background: var(--bg-tertiary); border-color: var(--accent); }
.oidc-icon { font-size: 1.1rem; }

.login-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  color: var(--text-faint);
  font-size: 0.8rem;
}
.login-separator::before,
.login-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Page d'accueil — Grille de projets ─────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-bottom: 8px;
  transition: color var(--transition);
}
.back-link:hover { color: var(--accent); }

.page-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.page-subtitle { color: var(--text-muted); font-size: 1rem; margin-top: 4px; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Carte de création */
.project-card-new {
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card-new:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.new-card-content {
  text-align: center;
  padding: 32px;
}

.new-card-icon {
  width: 56px;
  height: 56px;
  background: var(--accent-light);
  border: 2px solid rgba(22, 163, 74, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--accent);
  margin: 0 auto 16px;
  transition: all var(--transition);
}

.project-card-new:hover .new-card-icon {
  background: rgba(22, 163, 74, 0.2);
  transform: scale(1.1);
}

.new-card-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.new-card-hint {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 4px;
}

/* Carte de projet existant */
.project-card-existing {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}

.project-card-existing:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 0;
}

.card-body { padding: 12px 16px; flex: 1; }

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.card-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 0.8rem;
  color: var(--text-faint);
  background: var(--bg-base);
  border-top: 1px solid var(--border);
}

.card-progress {
  height: 3px;
  background: var(--border);
}

.card-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  transition: width 0.5s ease;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card-existing:hover .card-actions { opacity: 1; }

.card-action-btn {
  background: none;
  border: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
}

.card-action-btn:hover {
  background: rgba(22, 163, 74, 0.12);
  color: var(--accent);
}

.card-action-delete:hover {
  background: rgba(220, 38, 38, 0.1);
  color: var(--red);
}

/* État vide */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 24px;
  color: var(--text-faint);
}

.empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 8px; }

/* ─── Wizard ─────────────────────────────────────────── */
.wizard-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 64px);
}

.wizard-sidebar {
  background: var(--bg-card);
  border-right: 2px solid var(--border);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.wizard-sidebar-header {
  margin-bottom: 28px;
}

.wizard-project-name {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 8px;
  color: var(--text-primary);
}

.wizard-steps-nav { flex: 1; }

.wizard-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.wizard-step-item:hover { background: var(--bg-card-hover); }
.wizard-step-item.active { background: var(--accent-light); }
.wizard-step-item.completed .step-num { display: none; }
.wizard-step-item.completed .step-check { display: flex !important; }

.step-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.wizard-step-item.active .step-indicator {
  border-color: var(--accent);
  background: var(--accent);
}

.wizard-step-item.completed .step-indicator {
  border-color: var(--green);
  background: var(--green);
}

.step-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-faint);
}

.step-check {
  display: none;
  font-size: 0.8rem;
  color: white;
}

.wizard-step-item.active .step-num,
.wizard-step-item.completed .step-num { color: white; }

.step-info .step-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.wizard-step-item.active .step-title { color: var(--accent); }

.step-info .step-desc {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 2px;
}

.wizard-step-connector {
  width: 2px;
  height: 12px;
  background: var(--border);
  margin: 2px 0 2px 26px;
}

.wizard-save-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-faint);
  padding: 12px 4px;
  margin-top: 16px;
}

.save-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.save-dot-idle { background: var(--green); }
.save-dot-saving { background: var(--orange); animation: pulse 1s infinite; }
.save-dot-error { background: var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Main du wizard */
.wizard-main {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px);
  background: var(--bg-base);
}

.wizard-progress {
  height: 4px;
  background: var(--border);
}

.wizard-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  transition: width 0.4s ease;
}

.wizard-step-content {
  display: none;
  flex: 1;
  padding: 40px;
  animation: fadeIn 0.3s ease;
}

.wizard-step-content.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--border);
}

.step-header-icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(22, 163, 74, 0.3));
}

.step-title-main {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.step-title-sub {
  color: var(--text-muted);
  margin-top: 6px;
}

.step-body { max-width: 700px; }

/* Navigation du wizard */
.wizard-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-top: 2px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  bottom: 0;
}

.wizard-nav-info {
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ─── Option cards ───────────────────────────────────── */
.option-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.option-cards-vertical {
  grid-template-columns: 1fr;
}

.option-card {
  cursor: pointer;
  display: block;
}

.option-card input[type="radio"] { display: none; }

.option-card-body {
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
}

.option-card-horiz .option-card-body {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 16px;
}

.option-card-horiz .option-text { flex: 1; }

.option-card input:checked + .option-card-body {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 1px var(--accent);
}

.option-card:hover .option-card-body { border-color: rgba(22, 163, 74, 0.5); }

.option-icon { font-size: 2rem; margin-bottom: 10px; }
.option-card-horiz .option-icon { font-size: 1.8rem; margin-bottom: 0; flex-shrink: 0; }

.option-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }

.option-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }

/* ─── Toggle options ─────────────────────────────────── */
.toggle-options { display: flex; flex-direction: column; gap: 4px; }

.toggle-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  gap: 16px;
}

.toggle-option:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.toggle-option-sm { padding: 10px 14px; }

.toggle-option-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.toggle-icon { font-size: 1.3rem; flex-shrink: 0; }
.toggle-title { font-weight: 600; font-size: 0.9rem; }
.toggle-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* Toggle switch */
.toggle-switch {
  position: relative;
  flex-shrink: 0;
}

.toggle-switch input { display: none; }

.toggle-slider {
  display: block;
  width: 44px;
  height: 24px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  transition: all var(--transition);
  cursor: pointer;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

/* ─── Routes dynamiques ──────────────────────────────── */
.route-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.btn-remove-route {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--red);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── Récapitulatif ──────────────────────────────────── */
.recap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.recap-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.recap-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.recap-card-content {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.generation-box {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(132, 204, 22, 0.08));
  border: 2px solid rgba(22, 163, 74, 0.25);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.generation-box-icon { font-size: 3rem; margin-bottom: 16px; }
.generation-box h3 { font-size: 1.3rem; margin-bottom: 10px; }
.generation-box p { color: var(--text-muted); margin-bottom: 24px; max-width: 500px; margin-left: auto; margin-right: auto; }

/* ─── Page résultat ──────────────────────────────────── */
.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.result-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius);
  width: fit-content;
}

.result-tab {
  padding: 8px 16px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.result-tab.active {
  background: var(--accent);
  color: white;
}

.result-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-base);
}

.result-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.result-badge-ia {
  color: var(--violet);
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
}

.btn-copy {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition);
}

.btn-copy:hover { border-color: var(--accent); color: var(--accent); }

.result-content { overflow: auto; max-height: 600px; }

.result-content pre {
  padding: 24px;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.result-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.result-summary h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-value { font-size: 0.9rem; font-weight: 500; }

.val-yes { color: var(--green); font-weight: 700; }
.val-no { color: var(--text-faint); }

/* Bannière "ajouter une fonctionnalité" */
.evolution-banner {
  background: linear-gradient(135deg, rgba(202, 138, 4, 0.08) 0%, rgba(22, 163, 74, 0.08) 100%);
  border: 2px solid rgba(202, 138, 4, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.evolution-banner-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.evolution-banner-text p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ─── Administration ─────────────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

.admin-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
  color: var(--text-primary);
}

.admin-card-secondary { opacity: 0.7; }

.admin-card-icon { font-size: 2.5rem; flex-shrink: 0; }

.admin-card-body { flex: 1; }

.admin-card-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }

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

.admin-card-stat {
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 8px;
  font-weight: 600;
}

.admin-card-arrow { font-size: 1.2rem; color: var(--text-faint); }

/* Tableau */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--bg-base);
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: rgba(22, 163, 74, 0.04); }

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

.user-avatar-sm {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.action-buttons { display: flex; gap: 8px; }

/* Paramètres */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 24px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.settings-icon { font-size: 1.8rem; }

.settings-title { font-size: 1.15rem; font-weight: 700; }

.settings-desc { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 24px; }

.settings-status {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.status-ok { background: rgba(22, 163, 74, 0.08); border: 1px solid rgba(22,163,74,0.2); color: #166534; }
.status-warning { background: rgba(202, 138, 4, 0.08); border: 1px solid rgba(202,138,4,0.2); color: #92400e; }

.form-row { display: flex; gap: 12px; }
.form-group-grow { flex: 1; }
.form-group-fixed { flex: 0 0 100px; }

/* Prompts */
.prompts-list { display: flex; flex-direction: column; gap: 20px; }

.prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

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

.prompt-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.prompt-card-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 14px; }

.prompt-preview {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
}

.prompt-preview pre {
  padding: 14px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: pre-wrap;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.prompt-textarea {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  min-height: 300px;
}

.prompt-edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* Section headers dans admin */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Options list (securite, evolutions, environnement) */
.options-list { display: flex; flex-direction: column; gap: 12px; }

.option-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: border-color var(--transition);
}

.option-row:hover { border-color: var(--accent); }

.option-row-icon { font-size: 1.5rem; flex-shrink: 0; }

.option-row-info { flex: 1; }
.option-row-label { font-weight: 600; font-size: 0.95rem; }
.option-row-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

.option-row-actions { display: flex; align-items: center; gap: 8px; }

.btn-ia-assist {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn-ia-assist:hover:not(:disabled) {
  background: var(--accent);
  color: white;
}
.btn-ia-assist:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.option-cdc-preview {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 4px;
  font-style: italic;
  line-height: 1.4;
}

.form-hint-inline {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-faint);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}

/* Type evolution cards */
.evolution-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.evolution-type-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  display: block;
}

.evolution-type-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: var(--text-primary);
}

.evolution-type-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 1px var(--accent);
}

.evolution-type-icon { font-size: 2.5rem; margin-bottom: 12px; }
.evolution-type-label { font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.evolution-type-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; }

/* ─── Modal ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 47, 46, 0.35);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 1.1rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color var(--transition);
  line-height: 1;
  padding: 4px;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px; }
.modal-form { display: contents; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ─── Modal IA ───────────────────────────────────────── */
.ia-loading {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ia-original, .ia-suggestion { margin-bottom: 16px; }
.ia-original label, .ia-suggestion label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.ia-text-box {
  padding: 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
}

.ia-text-original {
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.ia-text-improved {
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.3);
  color: var(--text-primary);
}

.ia-arrow {
  text-align: center;
  font-size: 1.5rem;
  color: var(--accent);
  margin: 8px 0;
}

.ia-error {
  padding: 14px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--radius);
  color: #991b1b;
  font-size: 0.875rem;
}

/* ─── Toast ──────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(22, 163, 74, 0.4);
  animation: toastIn 0.3s ease;
}

.toast-error {
  background: var(--red);
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── Classes supplémentaires admin / évolutions ────── */

.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.admin-form-inline { display: flex; flex-direction: column; gap: 12px; }

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.section-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.form-group-sm { flex: 1; min-width: 140px; }

.option-cle {
  font-size: 0.72rem;
  background: rgba(22, 163, 74, 0.08);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.option-row-hidden { opacity: 0.55; }

.option-edit-form {
  width: 100%;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  margin-top: 8px;
}

.toggle-inline { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

.toggle-slider-sm {
  display: inline-block;
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 20px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-slider-sm::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}
.toggle-inline input:checked + .toggle-slider-sm { background: var(--accent); }
.toggle-inline input:checked + .toggle-slider-sm::after { transform: translateX(16px); }
.toggle-inline input { position: absolute; opacity: 0; width: 0; height: 0; }

.prompt-card-inactive { opacity: 0.6; }

.admin-text-preview {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
}

.data-table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.table-cell-main { font-weight: 600; font-size: 0.9rem; }
.table-cell-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.table-cell-date { font-size: 0.8rem; color: var(--text-faint); white-space: nowrap; }

.evolution-intro {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.evolution-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 28px;
  box-shadow: var(--shadow);
}

.evolution-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.evolution-banner-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.evolution-banner-icon { font-size: 2rem; flex-shrink: 0; }
.evolution-banner-text { flex: 1; }
.evolution-banner-text strong { color: var(--text-primary); display: block; margin-bottom: 4px; }

/* ─── Result page — Evolutions tab ──────────────────── */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 6px;
  line-height: 1;
}

.evolutions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.evolutions-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.evolutions-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.evo-num {
  display: inline-block;
  min-width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.evo-type {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.evolution-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.evolution-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.evolution-detail-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.evolution-detail-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  .wizard-container {
    grid-template-columns: 1fr;
  }

  .wizard-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 2px solid var(--border);
  }

  .wizard-steps-nav { display: none; }

  .wizard-step-content { padding: 24px 20px; }

  .wizard-navigation { padding: 16px 20px; }
}

@media (max-width: 640px) {
  .projects-grid { grid-template-columns: 1fr; }
  .option-cards { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .recap-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .evolution-types-grid { grid-template-columns: 1fr; }
}
