
/* ══ OVERLAY ══ */
#agentModalOverlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(18,18,28,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: agentFadeOverlay .3s ease both;
}
@keyframes agentFadeOverlay { from{opacity:0} to{opacity:1} }

/* ══ MODAL ══ */
#agentModal {
  background: #fff;
  border-radius: 18px;
  width: 100%; max-width: 420px;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,.28);
  animation: agentSlideUp .35s cubic-bezier(.34,1.28,.64,1) both;
  font-family: 'Inter', sans-serif;
}
@keyframes agentSlideUp {
  from { opacity:0; transform:translateY(20px) scale(.97); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}

.agent-modal-body { padding: 32px 32px 30px; }

.agent-modal-title {
  font-family: 'DM Serif Display', serif;
  font-size: 28px; color: #18181f;
  line-height: 1.1; margin-bottom: 6px;
}
.agent-modal-title em { font-style: italic; color: #D01F3C; }
.agent-modal-sub {
  font-size: 13.5px; color: #72728a; font-weight: 300;
  line-height: 1.6; margin-bottom: 24px;
}

/* Liste agents */
.agent-list {
  border: 1.5px solid #e8e8f0;
  border-radius: 12px; overflow: hidden;
  margin-bottom: 20px;
  max-height: 260px; overflow-y: auto;
}
.agent-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; cursor: pointer;
  transition: background .12s;
  border-bottom: 1px solid #e8e8f0;
}
.agent-item:last-child { border-bottom: none; }
.agent-item:hover { background: #f8f8fb; }
.agent-item.agent-selected { background: #fff0f2; }
.agent-item-name { font-size: 14px; font-weight: 500; color: #18181f; }
.agent-item.agent-selected .agent-item-name { color: #D01F3C; font-weight: 600; }
.agent-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid #e8e8f0;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 10px; font-weight: 700; color: transparent;
  transition: all .15s;
}
.agent-item.agent-selected .agent-check {
  background: #D01F3C; border-color: #D01F3C; color: #fff;
}

/* Boutons */
.agent-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.agent-btn-confirm {
  width: 100%; padding: 14px;
  background: #D01F3C; color: #fff; border: none;
  border-radius: 12px; font-size: 14.5px;
  font-family: 'Inter', sans-serif; font-weight: 700;
  cursor: pointer; letter-spacing: .2px;
  transition: background .18s, transform .15s, box-shadow .15s;
}
.agent-btn-confirm:hover:not(:disabled) {
  background: #b01830; transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(208,31,60,.22);
}
.agent-btn-confirm:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.agent-btn-secondary {
  width: 100%; padding: 13px;
  background: #fff; color: #18181f;
  border: 1.5px solid #e8e8f0; border-radius: 12px;
  font-size: 14px; font-family: 'Inter', sans-serif;
  font-weight: 500; cursor: pointer; transition: all .18s;
}
.agent-btn-secondary:hover { border-color: #18181f; }

/* Formulaire nouvel agent */
.agent-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.agent-form-grid .agent-col-full { grid-column: 1 / -1; }
.agent-form-group { display: flex; flex-direction: column; gap: 5px; }
.agent-form-group label {
  font-size: 10.5px; font-weight: 600; color: #72728a;
  letter-spacing: .5px; text-transform: uppercase;
}
.agent-req { color: #D01F3C; }
.agent-input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid #e8e8f0; border-radius: 10px;
  font-size: 13.5px; font-family: 'Inter', sans-serif;
  color: #18181f; background: #fff; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.agent-input:focus { border-color: #D01F3C; box-shadow: 0 0 0 3px rgba(208,31,60,.08); }
.agent-input::placeholder { color: #c0c0d0; }
.agent-input.agent-error { border-color: #D01F3C !important; box-shadow: 0 0 0 3px rgba(208,31,60,.13) !important; }
select.agent-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2372728a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px; cursor: pointer;
}

@media (max-width: 768px) {
  #agentModalOverlay { padding: 16px; align-items: flex-end; }
  #agentModal { border-radius: 18px 18px 0 0; max-width: 100%; }
  .agent-modal-body { padding: 24px 20px 28px; }
  .agent-form-grid { grid-template-columns: 1fr; }
  .agent-form-grid .agent-col-full { grid-column: 1; }
}
