/* Crew form - Équipe technique/production */
:root {
  --ac-primary-teal: #007b8f;
  --ac-gradient-start: #7c3aed;
  --ac-gradient-end: #2563eb;
  --ac-bg-soft: #f3f4f6;
  --ac-border-soft: #e5e7eb;
  --ac-text-dark: #0f172a;
}

.etape-main {
  background: var(--ac-bg-soft);
}

.groups-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.group-box {
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--ac-border-soft);
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(15, 23, 42, .06);
}

.group-header {
  width: 100%;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: none;
  cursor: pointer;
  background-image: linear-gradient(90deg, var(--ac-gradient-start), var(--ac-gradient-end));
  color: #f9fafb;
  position: relative;
}

.group-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .12));
  pointer-events: none;
}

.group-header-title {
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  letter-spacing: .01em;
}

.group-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  opacity: .95;
}

.group-header-right span:first-child {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .18);
  border: 1px solid rgba(15, 23, 42, .25);
}

.group-toggle-icon {
  font-size: 16px;
  transition: transform .2s ease;
}

.group-box.is-closed .group-toggle-icon {
  transform: rotate(-90deg);
}

.group-body {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--ac-border-soft);
  background: #fff;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.subrole-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subrole-title {
  font-weight: 700;
  color: var(--ac-text-dark);
  font-size: 13px;
}

/* Known chips (personnes identifiées) */
.role-known-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(0, 123, 143, .06);
  border: 1px solid rgba(0, 123, 143, .3);
  font-size: 12px;
}

.role-chip-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ac-text-dark);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.role-chip-main:hover {
  background: rgba(0, 123, 143, .12);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, .12);
}

.role-chip-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--ac-primary-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #f9fafb;
}

.role-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.role-chip-remove {
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  padding: 0 4px;
  font-size: 14px;
  line-height: 1;
}

.role-chip-remove:hover {
  color: #ef4444;
}

/* Input rows (personnes à ajouter/rechercher) */
.role-input-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.role-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.role-input-row-initials {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #4b5563;
  flex-shrink: 0;
}

.role-input-row input[type="text"] {
  flex: 1;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  background: #f9fafb;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.role-input-row input[type="text"]:focus {
  outline: none;
  border-color: var(--ac-primary-teal);
  box-shadow: 0 0 0 1px rgba(0, 123, 143, .35);
  background: #fff;
}

.role-input-remove {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
}

.role-input-remove:hover {
  color: #ef4444;
}

/* Boutons mini (ajouter) */
.btn-mini {
  margin-top: 4px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px dashed rgba(0, 123, 143, .6);
  background: rgba(0, 123, 143, .06);
  color: var(--ac-primary-teal);
  cursor: pointer;
  transition: background .15s ease;
}

.btn-mini:hover {
  background: rgba(0, 123, 143, .12);
}

.etape-actions {
  margin-top: 16px;
}

/* ===== Variant: Simple group title (série TV) ===== */
.group-title {
  padding: 10px 16px;
  background-image: linear-gradient(90deg, var(--ac-gradient-start), var(--ac-gradient-end));
  color: #f9fafb;
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  position: relative;
}

.group-title::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .12));
  pointer-events: none;
}

/* ===== People grid (série TV - cartes personnes) ===== */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.person-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--ac-border-soft);
  border-radius: 12px;
  background: #fff;
  transition: box-shadow .15s ease, transform .15s ease;
}

.person-card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, .1);
  transform: translateY(-2px);
}

.person-card.wide {
  grid-column: span 2;
}

.person-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--ac-primary-teal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.initial-avatar {
  font-size: 18px;
  font-weight: 700;
  color: #f9fafb;
  text-transform: uppercase;
}

.person-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: center;
}

.person-info input.form-input {
  text-align: center;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.person-info input.form-input:focus {
  outline: none;
  border-color: var(--ac-primary-teal);
  box-shadow: 0 0 0 1px rgba(0, 123, 143, .35);
  background: #fff;
}

.person-role {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
}

.btn-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  border: none;
  background: rgba(239, 68, 68, .1);
  color: #ef4444;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, transform .15s ease;
}

.btn-remove:hover {
  background: rgba(239, 68, 68, .2);
  transform: scale(1.1);
}

/* ===== Organizations grid (série TV) ===== */
.org-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.org-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.org-row input.form-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  background: #f9fafb;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.org-row input.form-input:focus {
  outline: none;
  border-color: var(--ac-primary-teal);
  box-shadow: 0 0 0 1px rgba(0, 123, 143, .35);
  background: #fff;
}

.org-row .btn-remove {
  position: static;
  width: 28px;
  height: 28px;
  font-size: 14px;
}
