/* Modales de confirmation / alerte — Cartimmo Agents
   Remplace les alert() / confirm() natifs. Palette alignée sur la charte
   agent (vert #00b894), border-radius ≤ 5px conforme à la règle UI.
   Charge via static/js/cartimo-dialogs.js + partial templates/agency/_dialogs.html */

.cd-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.18s ease-out;
  pointer-events: none;
}
.cd-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.cd-modal {
  background: #fff;
  border-radius: 5px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.28);
  padding: 26px 28px 22px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.cd-overlay.show .cd-modal { transform: translateY(0) scale(1); }

.cd-title {
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 8px;
  line-height: 1.35;
}

.cd-message {
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 22px;
  white-space: pre-line;
}

.cd-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  margin: -12px 0 22px;
  outline: none;
  transition: border-color .15s;
}
/* L'attribut [hidden] doit gagner sur le `display: block` ci-dessus
   (sinon le champ reste visible en mode confirm/alert). */
.cd-input[hidden] { display: none !important; }
.cd-input:focus { border-color: #00b894; box-shadow: 0 0 0 3px rgba(0,184,148,.12); }

.cd-dontask { display: flex; align-items: center; gap: 8px;
              font-size: 12px; color: #64748b;
              margin: 0 0 18px; cursor: pointer;
              user-select: none; }
.cd-dontask[hidden] { display: none !important; }
.cd-dontask input { width: 14px; height: 14px; cursor: pointer; margin: 0; }
.cd-dontask span { line-height: 1; }
.cd-dontask:hover span { color: #1e293b; }

.cd-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.cd-btn {
  padding: 9px 18px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cd-btn-ghost {
  background: #fff;
  color: #475569;
  border-color: #cbd5e1;
}
.cd-btn-ghost:hover { background: #f8fafc; border-color: #94a3b8; }

.cd-btn-primary {
  background: #00b894;
  color: #fff;
  border-color: #00b894;
}
.cd-btn-primary:hover { background: #00a383; border-color: #00a383; }

.cd-btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.cd-btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.cd-btn-warning {
  background: #d97706;
  color: #fff;
  border-color: #d97706;
}
.cd-btn-warning:hover { background: #b45309; border-color: #b45309; }

@media (max-width: 540px) {
  .cd-overlay { padding: 16px; align-items: flex-end; }
  .cd-modal { padding: 22px 20px 18px; }
  .cd-actions { flex-direction: column-reverse; align-items: stretch; }
  .cd-btn { width: 100%; justify-content: center; }
}
